---
title: "Finding an ϵ-Close Minimal Variation of Parameters in Bayesian Networks"
authors:
  - "Bahare Salmani"
  - "Joost-Pieter Katoen"
doi: "10.24963/ijcai.2023/635"
url: "https://ijcai.org/proceedings/2023/635"
pdf: "https://ijcai.org/proceedings/2023/0635.pdf"
venue: "Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence"
year: 2023
pages: "5720-5729"
track: "Main Track"
keywords:
  - "Uncertainty in AI: UAI: Tractable probabilistic models"
  - "Uncertainty in AI: UAI: Bayesian networks"
  - "Uncertainty in AI: UAI: Graphical models"
---

# Finding an ϵ-Close Minimal Variation of Parameters in Bayesian Networks

Bahare Salmani, Joost-Pieter Katoen

*Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence*, pages 5720-5729. DOI: [10.24963/ijcai.2023/635](https://doi.org/10.24963/ijcai.2023/635)

## Abstract

This paper addresses the ε-close parameter tuning problem for Bayesian
networks (BNs): find a minimal ε-close amendment of probability entries
in a given set of (rows in) conditional probability tables that make a
given quantitative constraint on the BN valid. Based on the
state-of-the-art “region verification” techniques for parametric Markov
chains, we propose an algorithm whose capabilities go
beyond any existing techniques. Our experiments show that ε-close tuning
of large BN benchmarks with up to eight parameters is feasible. In
particular, by allowing (i) varied parameters in multiple CPTs and (ii)
inter-CPT parameter dependencies, we treat subclasses of parametric BNs
that have received scant attention so far.

## Full text

## 1 Introduction

Bayesian networks. Bayesian networks (BNs) [Pearl, 1988] are probabilistic graphical models that enable succinct knowledge representation and facilitate probabilistic reasoning [Darwiche, 2009]. Parametric Bayesian networks (pBNs) [Castillo et al., 1997] extend BNs by allowing polynomials in conditional probability tables (CPTs) rather than constants.

Parameter synthesis on Markov models. Parameter synthesis is to find the right values for the unknown parameters with respect to a given constraint. Various synthesis techniques have been developed for parametric Markov chains (pMCs) ranging over e.g., the gradient-based methods [Heck et al., 2022], convex optimization [Cubuktepe et al., 2018; Cubuktepe et al., 2022], and region verification [Quatmann et al., 2016]. Recently, Salmani and Katoen [2021a] have proposed a translation from pBNs to pMCs that facilitates using pMC algorithms to analyze pBNs. Proceeding from this study, we tackle a different problem [Kwisthout and van der Gaag, 2008] for Bayesian networks.

Minimal-change parameter tuning. Given a Bayesian network B, a hypothesis H, evidence E, λ ∈ [0, 1], and a constraint of the form Pr(H|E) ≤ λ (or ≥ λ),

what is a minimal change-with respect to a given measure of distance-in the probability values of (a subset of) CPT rows, such that the constraint holds?

We illustrate the problem with an example of testing COVID19 that is adopted from several medical studies [Barreiro et al., 2021; Nishiura et al., 2020; Dinnes et al., 2022]. The outcome of PCR tests only depends on whether the person is infected, while the antigen tests are less likely to correctly identify COVID-19 if the infection is asymptomatic (or presymptomatic). Figure 1a depicts a Bayesian network that models such probabilistic dependencies. In the original network, the probability of no COVID-19 given that both tests are positive, is 0.011089. Assume that in an application domain, the result of such a query is now required not to exceed 0.009: the aim is to make this constraint hold while imposing the least change in the original network with respect to a distance measure. This is an instance of the minimal-change parameter tuning problem. We consider the ϵ-bounded variant of the problem: for a subset of modifiable CPT rows, are there new values within the distance of ϵ from the original probability values that make the constraint hold?

Main contributions. Based on existing region verification and region partitioning techniques for pMCs,

- we propose a practical algorithm for ϵ-bounded tuning. More precisely, we find instantiations that (i) satisfy the constraint (if the constraint is satisfiable) and (ii) are ϵclose and (iii) lean towards the minimum distance instantiation depending on a coverage factor 0 ≤ η ≤ 1.
- We propose two region expansion schemes to realize ϵcloseness of the results both for Euclidean distance and for CD distance [Chan and Darwiche, 2005].
- Contrary to the existing techniques that restrict to hyperplane solution spaces, we handle pBNs with multiple parameters in multiple distributions and multiple CPTs.

Our experiments on our prototypical implementation 1 indicate that ϵ-bounded tuning of up to 8 parameters for large networks with 100 variables is feasible.

Paper organization. Section 2 includes the basic notations and Sec. 3 the preliminaries on parametric Bayesian networks. Section 4 introduces parametric Markov chains and the region verification techniques thereof. Section 5 details our main contributions and Sec. 6 our experimental results. Section 7 concludes the paper with an overview of the related studies that were not mentioned before.

[1 https://github.com/baharslmn/pbn-epsilon-tuning](https://github.com/baharslmn/pbn-epsilon-tuning)

Figure 1: Our running example: (a) the parametric BN COVID-19, (b) the parametric MC of COVID-19, for the topological order C;S;A;P, (c) the parametric MC of COVID-19 tailored to the evidence Antigen Test = pos and PCR Test = pos, abstracted from variable valuations.

![Image](https://ijcai.org/proceedings/2023/fulltext/635/image_000000_249b5d37f71c33ba8ec64a1072cba2ceb29991a55503a4875a3439c736f84c3c.png)

## 2 Background

Variables. Let V be a set ofmrandomvariables v1, . . . , vm and Dvi the domain of variable vi. For A ⊆ V , Eval(A) denotes the set of joint configurations for the variables in A.

Parameters. Let X={x1, . . . , xn} be a set of n realvalued parameters. A parameter instantiation is a function u :X→R that maps each parameter to a value. All parameters are bounded; i.e., lbxi ≤u(xi)≤ubxi for xi. Let Ii = [lbxi , ubxi ]. The parameter space U ⊆ Rn of X is the set of all possible values of X, i.e., the hyper-rectangle spanned by the intervals Ii for all i.

Substitution. Polynomials f over X are functions f : Rn → R where f(u) is obtained by replacing each occurrence of xi in f by u(xi); e.g., for f = 2x21+x2, u(x1) = 3 and u(x2) = 2, f (u) = 20. Let f [u] denote such substitution.

Parametric distributions. Let Distr(D) denote the set of probability distributions over D. Let Q[X] be the set of multivariate polynomials with rational coefficients over X. A parametric probability distribution is the function µ : D → Q[X] with ∑d∈D µ(d)=1. Let pDistr(D) denote the set of parametric probability distributions over D with parameters in X. Instantiation u is well-formed for µ∈pDistr(D) iff 0 ≤ µ(d)[u] ≤ 1 and Σd∈D µ(d)[u] = 1.

Distancemeasure. The function d : U×U →R≥0 is a distance measure if for all u, u′ , u′′ ∈ U, it satisfies: (I) positiveness: d(u, u′ ) ≥ 0, (II) symmetry: d(u, u′ ) = d(u′ , u), and (III) triangle inequality: d(u, u′′ ) ≤ d(u, u′ ) + d(u′ , u′′ ).

## 3 Parametric Bayesian Networks

A parametric Bayesian network (pBN) is a BN in which a subset of entries in the conditional probability tables (CPTs) are polynomials over the parameters in X. Let parvi denote the set of parents for the node vi in the graph G.

Definition 1. The tuple B=(G,X,Θ) is a parametric Bayesian network (pBN) with directed acyclic graph G=(V,W) over random variables V={v1, . . . , vm}, set of parameters X={x1, . . . , xn}, and parametric CPTs Θ={Θvi | vi∈V } where Θvi : Eval(parvi )→pDistr(Dvi ).

The CPT row Θv(par) is a parametric distribution over Dv given the parent evaluation par. The CPT entry Θv(par)(d), short θ(v,d,par), is the probability that v=d given par. A pBN without parameters, i.e., X = ∅, is an ordinary BN. A pBN B defines the parametric distribution function PrB over Eval(V ). For well-formed instantiation u, BN B[u] = (G,Θ[u]) is obtained by replacing the parameter xi in the parametric functions in the CPTs of B by u(xi).

Example 1. Fig. 1a shows a pBN over variables V = {C, S,A, P} (initial letters of node names) and parameters X = {p, q}. Instantiating with u0(p) = 0.72 and u0(q) = 0.95 yields the BN B[u0] as indicated using dashed boxes.

pBN constraints. Constraints PrB(H|E) ∼ λ involve a hypothesis H, an evidence E, ∼∈ {≤, ≥} and threshold 0 ≤ λ ≤ 1. For the instantiation u : X → R,

<!-- formula-not-decoded -->

Sensitivity functions. Sensitivity functions are rational functions that relate the result of a pBN query to the parameters [Castillo et al., 1997; Coup´e and van der Gaag, 2002].

Example 2. For the pBN B1 in Fig. 1a, let φ1 be the constraint: PrB1 (C = no | A = pos ∧ P = pos) ≤ 0.009. The left-hand side reduces to the sensitivity function

<!-- formula-not-decoded -->

Using instantiation u with u(p) = 0.92075 and u(q) = 0.97475, fB1,φ1 [u] = 0.008798 ≤ 0.009, i.e., B1[u] |= φ1.

Higher degree sensitivity functions. Contrary to the existing literature that is often restricted to multi-linear sensitivity functions, we are interested in analyzing pBNs with sensitivity functions of higher degrees.

Example 3. Consider a variant of the COVID-19 example, where the person only takes the antigen test twice rather than taking both the antigen and PCR tests to diagnose COVID19; see Fig. 2 for the parametric CPTs. Then,

<!-- formula-not-decoded -->

Figure 2: Parametric CPTs for a variant of COVID-19 example with two antigen tests; see the inter-CPT parameter dependencies.

|     |     | Antigen Test 1   | Antigen Test 1   | Antigen Test 1   | Antigen Test 1   |     |     | Antigen Test 2   | Antigen Test 2   | Antigen Test 2   | Antigen Test 2   | Antigen Test 2   |
|-----|-----|------------------|------------------|------------------|------------------|-----|-----|------------------|------------------|------------------|------------------|------------------|
| C   | S   | pos              | pos              | neg              | neg              | C   | S   | pos              | pos              |                  | neg              |                  |
| yes | yes | 0.72             | p                | 0.28             | 1-p              | yes | yes |                  | 0.72             | p                | 0.28             | 1-p              |
| yes | no  | 0.58             | r                | 0.42             | 1-r              | yes | no  |                  | 0.58             | r                | 0.42             | 1-r              |
| no  | yes | 0.005            | s                | 0.995            | 1-s              | no  | yes |                  | 0.005            | s                | 0.995            | 1-s              |
| no  | no  | 0.01             | t                | 0.99             | 1-t              | no  | no  |                  | 0.01             | t                | 0.99             | 1-t              |

Parametrization. Let Θmodif denote the CPT entries in BN B = (G, Θ) that are explicitly changed.

Definition 2 (BN parametrization). Tuple B = (G,X,Θ′ ) is a parametrization of BN B = (G,Θ) over X w.r.t. Θmodif if

<!-- formula-not-decoded -->

The parametrization B is monotone iff for each parametric entry f , f is a monotonic polynomial. The parametrization B is valid iff B is a pBN, i.e., iff Θ′v (par)∈pDistr(Dv) for each random variable v ∈V and its parents configuration par.

A valid monotone parametrization is obtained by the linear proportional [Coup´e and van der Gaag, 2002] that is the most established scheme in the literature to parametrize BNs.

Definition 3 (Linear proportional parametrization). A linear proportional parametrization over X maps the CPTs Θ onto the parametric CPTs Θ′ w.r.t. Θmodif if

<!-- formula-not-decoded -->

Note that we allow the repetition of parameters in multiple distributions and multiple CPTs, see e.g., Fig. 2.

Formal problem statement. Consider BN B = (G,Θ), its valid parametrization B = (G,X,Θ′ ) over X with constraint φ. Let u0 be the original value of the parameters X in B and d : U × U → R≥0 a distance measure. Let ˆ d0 denote an upperbound for d{u∈U}(u0, u). The minimum-distance parameter tuning problem is to find umin = argmin{u∈U | B[u]|=φ} d(u, u0). Its generalized variant for 0 ≤ ϵ ≤ ˆ d0 and 0 ≤ η ≤ 1 is:

Definition 4. The (ϵ, η)-parameter tuning problem is to find u∈U s.t. B[u] |=φ, d(u, u0)≤ϵ, and d(u, umin)≤(1-η) · ˆ d0.

( ˆ d0, 1)-tuning gives the minimum-distance tuning. We call η the coverage factor that determines, intuitively speaking, the minimality of the result; we discuss this in Sec. 5.4. We consider two distance measures.

Euclidean distance (EC distance). The ECdistance between u and u′ (both in U) is defined as:

<!-- formula-not-decoded -->

Corollary 1. For n = |X|, ˆ d0 = √n is an upperbound for the EC distance of any u0 from any instantiation u∈U.

Corollary 2. Let 0 ≤ ϵ ≤ √n and u0(xi) - ϵn ≤ u(xi) ≤ u0(xi) + ϵn . Then, EC(u, u0) ≤ ϵ.

Chan-Darwiche distance (CD distance). CD is a measure to quantify the distance between the probability distributions of two BNs, defined as [Chan and Darwiche, 2005]:

<!-- formula-not-decoded -->

where both 0/0 = 1 and ∞/∞ = 1 by definition. Whereas the EC distance can be computed in O(n), this is for CD distance NP-complete [Kwisthout and van der Gaag, 2008]. It has known closed-forms only for limited cases, e.g., single parameter and single-CPT pBNs [Chan and Darwiche, 2004]. Let Θv be the CPT that is parametrized to Θ′v by a monotone parametrization. Let the minimum (maximum) probability entry of Θv be θmin (θmax) parametrized to θ′min with x (θ′max with y). Let lbx, ubx, lby, uby ̸= 0, 1 be the upperbounds and the lowerbounds of x and y in U.

Corollary 3. An upperbound for the CD distance of u0 from any instantiation u∈U is:

<!-- formula-not-decoded -->

as derived from the single CPT closed-form [Chan, 2005].

Corollary 4. Let 0≤ϵ≤ ˆ d0 and α=eϵ/2 . Let for each θ ∈ Θv, α-1 · θ′ [u0] ≤ θ′ [u] ≤ α · θ′ [u0] . Then, CD(u, u0) ≤ ϵ.

We use the proportional parametrization (Def. 3) that has several useful properties: e.g., it is zero-preserving and minimizes the CD distance for single-CPT pBNs [Renooij, 2014].

## 4 Parametric Markov Chains

Parametric Markov chains are an extension of Markov chains (MCs) that allow parametric polynomials as transition labels: Definition 5. A parametric Markov chain (pMC) M is a tuple (S, sI,X,P) where S is a finite set of states, sI ∈ S is the initial state, X is a finite set of real-valued parameters, and P : S → pDistr(S) is a transition function over the states.

Example 4. Figures 1b and 1c are examples of pMCs.

Reachability constraints. A reachability constraint ϕ = (T, ∼, λ) is defined over pMC M = (S, sI , X, P) with targets T ⊆ S, threshold 0 ≤ λ ≤ 1, and ∼ ∈ {≤,≥}. For pMC M and instantiation u : X → R:

<!-- formula-not-decoded -->

where PrM[u](♦T) denotes the probability that MC M[u] reaches a state in T .

Example 5. Consider the pMC MB,E in Fig. 1c. Let T = {s10}. Then, PrMB,E (♦s10) = 361 34900 · p · q + 8758 · q + 361 . Let R ⊆ Rn with n = |X| and let

<!-- formula-not-decoded -->

We now define the parameter synthesis problems for pMCM and reachability constraint ϕ that are relevant to our setting.

Figure 3: The parameter lifting steps for the COVID-19 example with parameter dependencies (Fig. 2): (a) the original (sub-)pMC Relaxation -----→ (b) pMC without parameter dependencies Substitution ------→ (c) non-parametric MDP. Note that 0.9875 ≤ 1-t, 1-t′ , 1-t′′ ≤ 0.9925.

![Image](https://ijcai.org/proceedings/2023/fulltext/635/image_000001_7f836a15995ff0d1fe6504f2eb0a5b7eac638ef69f97f22555a5d8367f21e163.png)

Definition 6 (Region partitioning). Partition region R into R+, R-, and R? such that:

<!-- formula-not-decoded -->

and R? = R \ (R+ ∪ R-) with ||R?|| ≤ (1-η)·||R|| for some given coverage factor 0 ≤ η ≤ 1.

The sub-region R? denotes the fragment of R that is inconclusive for ϕ. This fragment should cover at most fraction 1-η of R's volume. Region partitioning is exact if R? = ∅.

Definition 7 (Region verification). For the region R and the specification φ, the problem is to check whether:

<!-- formula-not-decoded -->

## 4.1 Parameter Lifting

The parameter lifting algorithm (PLA) [Quatmann et al., 2016] is an abstraction technique that reduces region verification to a probabilistic model checking problem for which efficient algorithms exist [Katoen, 2016]. It first removes parameter dependencies by making all parameters unique. Then it considers for each parameter xi only its bounds lbxi and ubxi within the region R. This yields a non-parametric Markov Decision Process (MDP).

Definition 8. A Markov decision process (MDP) is a tuple M = (S, sI, Act,P) with a finite set S of states, an initial state sI ∈ S, a finite set Act of actions, and a (partial) transition probability function P : S × Act → Distr(S).

While resolving the non-determinism in the obtained MDP, a trade-off between maximizing or minimizing xi may occur. This occurs in particular when parameter xi repeats in the outgoing transitions of multiple states, see e.g., parameter t in Fig. 3a. PLA handles the issue by a relaxation step that introduces intermediate parameters; see e.g., Fig. 3b, where parameter t in the outgoing edges of state C=no,A=pos is replaced by t′ . The relaxation step yields an over-approximation of the region verification problem.

Example 6. Consider the pMC in Fig. 3(a) and region t ∈ [0.0075, 0.0125]. Fig. 3b shows the pMC after relaxation, e.g., parameter t in the outgoing transitions of state C=no,A=pos is replaced by t′ . Fig. 3c shows the MDP

obtained by substituting the parameters with their extremal values. Consider e.g., state C = no, S = no. Its outgoing dotted (blue) edges have probability 0.0075 and 1-0.0075 obtained from lb(t). The probabilities 0.0125 and 1-0.0125 of the dashed (purple) edges stem from ub(t).

After substitution, region verification reduces to a simple model-checking query that over-approximates the original higher-order polynomial, e.g., Example 3. The region accepts ϕ for the pMC if the resulting MDP satisfies ϕ for all schedulers. If all the schedulers satisfy ¬ϕ, the region is rejecting. If the region is neither accepting nor rejecting (i.e., inconclusive), it is partitioned into smaller subregions that are more likely to be either accepting or rejecting. Partitioning ends when at least η% of the region is conclusive.

## 4.2 Parametric Markov Chain for pBNs

To enable the use of PLA to parameter tuning of pBNs, we map pBNs onto pMCs as proposed in [Salmani and Katoen, 2021a; Salmani and Katoen, 2021b]; see the next example.

Example 7. Consider the acyclic pMC in Fig. 1b for the pBN in Fig. 1a for the topological ordering ϱ : C &lt; S &lt; A &lt; P. Initially, all variables are don't care. The initial state can evolve into C=yes and C=no. Its transition probabilities 0.05 and 0.95 come from the CPT entries of C. Generally, at "level" i of the pMC, the outgoing transitions are determined by the CPT of the i+1-st variable in ϱ.

pBN constraints relate to reachability constraints in its pMC.

Example 8. Consider the pBN B1 from Fig. 1a and the query PrB(C = no | A = pos ∧ P = pos) from Example 2. Let MϱB be the pMC in Fig. 1b. The query coincides with

<!-- formula-not-decoded -->

## 5 Region-basedMinimal Change Tuning

Our approach to the parameter tuning problem for a pBN and constraint φ consists of two phases. The ϵ-close partitioning exploits parameter lifting on the pMC for reachability constraint ϕ of φ. We start with a rectangular region enclosing the original instantiation u0. This region is iteratively expanded if it rejects ϕ. Inconclusive regions are partitioned. Any iteration that finds some accepting subregion ends the first phase. The second phase (Alg. 2) extracts a minimal-change instantiation from the set of accepting sub-regions.

Figure 4: The iterative procedure of region-based parameter tuning for n = 2 and γ = 1/2.

![Image](https://ijcai.org/proceedings/2023/fulltext/635/image_000002_3e341e0db74f56301828c18f0d9928ecf339bfdc567a490622aaafe3ce57f47a.png)

## 5.1 Obtaining Epsilon-Close Subregions

Alg. 1 is the main thread of our approach. Its inputs are the pBNB = (V,W,X,Θ), the initial instantiation u0 : X →R, and the constraint φ. It starts with obtaining the pMCMB of the pBN and reachability constraint ϕ of φ (lines 1-2). The output is either (i) u0 ifM[u0] |= ϕ, or (ii) the instantiation u with a minimal distance from u0 or (iii) no instantiation if ϕ is infeasible, that is, in the η = 100% of the checked parameter space, no satisfying instantiation has been found. The hyperparameters of the algorithm are the coverage factor 0 &lt; η &lt; 1, the region expansion factor 0 &lt; γ &lt; 1, and the maximum number of iterations K ∈ N. The hyper-parameters γ and K steer the iterative procedure. They initially determine the distance bound ϵ, see line 3. The bound ϵ determines region Rϵ, i.e., how far the region bounds deviate from u0. PLA then verifies Rϵ. If Rϵ is rejecting, ϵ is extended by the factor γ-1 (l. 9). Figure 4 visualizes the procedure for γ=1/2 and n=2. At iteration i, (a) PLA is invoked on Rϵ and either (b) R+ ̸= ∅ or (c) R+ = ∅. For case (b), the iterative procedure

## Algorithm 1: Minimal change tuning

![Image](https://ijcai.org/proceedings/2023/fulltext/635/image_000003_8c012a4bf00cab74edabb64b5e1214e8318af3b49b9a2ab592d3fb1f00b2f4c7.png)

ends and Alg. 2 is called to obtain an instantiation in R+ that is closest to u0. For case (c), the region is expanded by factor γ-1 and passed to PLA, see (d). Note that the loop terminates when the distance bound ϵ reaches its upper bound ˆ d0 (l. 2). We refer to Sec. 3 Corollary 1 and 3 for computing ˆ d0.

Region expansion schemes. Region Rϵ is determined by factor ϵ, see line 16. The methods makeRegion-EC and makeRegion-CD detail this for each of our distance measures. For the EC distance (line 20), the parameters have an absolute deviation from u0. We refer to Corollary 2, Sec. 3. For CD distance (lines 23 and 24), the deviation is relative to the initial value of the parameter. We refer to Corollary 4, Sec. 3. Such deviation schemes ensure ϵ-closeness of Rϵ both for EC and CD distance, that is, all the instantiations in Rϵ have at most distance ϵ from u0.

## 5.2 Obtaining aMinimal-Distance Instantiation

Once R+ ̸= ∅ ⊆ Rϵ is found, it remains to find the instantiation u+ in R+ that is closest to u0. Region R+ includes infinitely many instantiations, yet minimal-distance instantiation is computable in O(k·n) for n = |X| and the regions R+ = {R+,1, · · · ,R+,k}: (i) PLA ensures that the subregions R+,1 to R+,k are rectangular and mutually disjoint. (ii) Due to the triangle equality of the distance measure, a minimum-distance instantiation can be picked from the bounded region. Alg. 2 simplifies finding u+. The idea (l. 4-14) is to pick u+,i fromR+,i that has minimal distance from u0. Let lbxj be the lower bound for parameter xj in the region R+,i and ubxj be its upper bound. We set the value for each parameter based on three possible cases. (1) If u0(xj)∈ [lbxj , ubxj ], we set u+,i(xj)=u0(xj). This yields the least distance, i.e., 0 in the dimension of xj, see Fig. 5

## Algorithm 2: R+-minimal distance instantiation

![Image](https://ijcai.org/proceedings/2023/fulltext/635/image_000004_6b8fad1b49228e89f64cafb6f5f325280f3ec33fced2dd6b8b1f42855ed94411.png)

(left). (2) The second case is u0(xj)&lt;lbxj , see Fig. 5 (middle). Then the lower bound lbxj has the least distance from u0(xj) in the dimension xj , i.e., |lbxj -u0(xj)| &lt; |a-u0(xj)| for every value a ∈ [lbxj , ubxj ] and similarly for CD distance, ln lbxj u0(xj) &lt; ln a u0(xj) . In this case, we set u+,i(xj)=lbxj to minimize the distance in dimension xj. (3) By symmetry, for u0(xj) &gt; ubxj , we set u+,i(xj) = ubxj ; see Fig. 5 (right). It remains to compute the distance for each candidate in U+ = {u+,1, · · · , u+,k} and pick u+ closest to u0 (l. 15).

Figure 5: Obtaining the minimal-change value for parameter x ∈ X.

![Image](https://ijcai.org/proceedings/2023/fulltext/635/image_000005_5b69d024741f8bdaa4c2b0dd882e5ab4253352efb6fc7fb6ddce3378d57cf6be.png)

## 5.3 Example

We apply the entire algorithm on the pBN in Fig. 1a, constraint φ = Pr(C=no | A=pos ∧ P=pos) ≤ 0.009, u0 : p → 0.72, q → 0.95, and η=0.99. The pMCMB,E is given in Fig. 1c and the reachability constraint is ϕ : Pr(♦s10) ≤ 0.009. We take ˆ d0=√n, γ=1/2, and ϵ0=1/16.

1. The initial region Rϵ is obtained by ϵ=1/8: [0.72-1/8√2, 0.72+1/8√2] × [0.95-1/8√2, 0.95+1/8√2].
2. Running PLA on Rϵ gives no sub-region accepting ϕ.
3. Expanding the region by the factor γ-1 = 2 yields: [0.72-1/4√2, 0.72+1/4√2] × [0.95-1/4√2, 0.95+1/4√2].
4. Running PLA gives 12 regions accepting ϕ, e.g., R+,1 : [0.92075, 0.960375] × [0.97475, 1] and R+,2 : [0.960375, 0.97028175] × [0.9431875, 0.9495].
5. Running Alg. 2 on R+,1 through R+,12 gives minimal distance candidates u+,1 through u+,12; e.g., u+,2(p)=lbp=0.960375 as u0(p) &lt; lbp and u+,2(q)=ubq=0.9495 as ubq &lt; u0(q); see Fig. 5.
6. Running Alg. 2 using the distance measure of choicehere: EC distance-for the candidates U+ returns u+ closest to u0: u+(p) = 0.92075 and u+(q) = 0.97475; distance 0.040913125.

## 5.4 Discussion

Let us shortly discuss the hyper-parameters: η, γ, and K. The hyper-parameter η is the coverage factor for the region partitioning. Our region partitioning algorithm, i.e., parameter lifting (line 17 Alg. 1) works based on this factor: the procedure stops when R? is at most (1 - η) · ||R|| of the entire region R, e.g., for η = 0.99, it continues until at least 99% of R is either rejecting or accepting and at most 1% is unknown. This relates η to the approximation bounds of our algorithm, see Problem statement, Def. 4. Intuitively speaking, the coverage factor η means that if the algorithm provides a minimal-distance value D(u, u0) = d, then with the probability 1 - η there may exist a smaller value distance than d that works too but has not been found. One can thus consider η as the confidence factor for the minimality of the results.

The hyper-parameter γ specifies the factor by which the region is expanded at each iteration, see Line 9, Alg. 1. The hyper-parameters γ and K specify the size of the initial region, see Lines 3 and 16 of Alg. 1. Our experiments (not detailed in the paper) with γ = {0.2, 0.5, 0.8} and K = {2, · · · , 12} reveal that γ = 1/2 and K = 6 gave the best balance. Large values for γ (0.8) and small K lead to unnecessary computations in the initial iteration for the simple cases i.e., when small perturbations of the parameters make the constraint satisfied. Small values for γ (0.2) lead to large regions in the next iterations due to the expansion by γ-1 .

## 6 Experimental Evaluation

We empirically evaluated our approach using a prototypical realization on top of the probabilistic model checker Storm [Hensel et al., 2022] (version 1.7.0). As baseline, we used the latest version (10.4) of Bayesserver 2 , a commercial BN analysis tool that features sensitivity analysis and parameter tuning for pBNs. It supports pBNs with a single parameter only. We parametrized benchmarks from bnlearn repository and defined different constraints. We (i) parametrized the CPTs of the parents (and grandparents) of the evidence nodes, and (ii) used the SamIam tool 3 to pick the CPT entries Θmodif most relevant to the constraint. To get well-formed BNs, we used the linear proportional parametrization, see Def. 3. In all experiments, we picked evidences from the last nodes in the topological order; they have a long dependency path to the BN roots. This selection reflects the worst-case in [Salmani and Katoen, 2020]. We took γ=1/2 and K=6 for our experiments, see Sec. 5.4. We conducted all our experiments on a 2.3 GHz Intel Core i5 processor with 16 GB RAM.

RQ1: Comparison to Bayesserver. We used small, medium, and large BNs from the bnlearn repository. For each BN, we parameterized one distribution in a single CPT to align with the restrictions from Bayesserver. Figure 6a indicates the results, comparing the tuning times (in sec) of Bayesserver (x-axis) to those of our implementation (y-axis). The latter includes the time for region refinements by PLA. For each pair (pBN, constraint), we did experiments for coverage factors η = 1-10-i for i ∈ {1, · · · , 6}. The influence of η on the exactness of our results is addressed under RQ2.

Findings. Storm outperforms Bayesserver for several benchmarks (cancer, sachs, win95pts, and multiple instances of hailfinder), whereas Bayesserver is faster by about an order of magnitude for the other pBNs, such as hepar2. We noted that Bayesserver exploits specific methods for one-way sensitivity analysis and relies on the linear form of the sensitivity function. These techniques are very efficient yet not applicable to pBNs with multiple parameters in multiple CPTs. For our experiments on those subclasses, see RQ4. Such subclasses are not supported by Bayesserver and-to the best of our knowledge-not any existing BN tool. This applies e.g., also to Bayesfusion which considers only the change of a single parameter at a time, and SamIam which is limited to the single parameter and single-CPT.

[2 https://www.bayesserver.com/](https://www.bayesserver.com/)

[3 http://reasoning.cs.ucla.edu/samiam/](http://reasoning.cs.ucla.edu/samiam/)

Figure 6: The plots (a), (b): Storm vs. Bayesserver, the tuning time and the instantiation closeness; see RQ1. The plots (b), (c), (d): the effect of the coverage factor (η) on the tightness of the distance, the number of iterations, and the tuning time; see RQ2. Corner case: the number of iterations only changes when a satisfying instantiation was not found (NF) with a certain coverage; see sachs at η=0.9 and η=0.99.

![Image](https://ijcai.org/proceedings/2023/fulltext/635/image_000006_81577f748d1fb2a2f18d62083f11c8bb3e401ec14ee7d9505dd171e9c38dbd68.png)

RQ2: Sensitivity to the coverage factor η. For each pBN and constraint, we decreased (the refinement factor) 1-η in a step-wise manner by a factor 10-1 . To quantify the tightness of our results, we measured how our approximatelyclose instantiation, denoted uStorm, differs from the absolute minimum-distance from Bayesserver, denoted uBayes. Figure 6b (log-log scale) plots the tightness of the results |uStorm-uBayes| (y-axis) against the refinement factor (x-axis). Figures 6c and 6d indicate the number of iterations and the tuning time (log scale, seconds) for each refinement factor.

Findings. (I) Mostly, 1-η bounds the difference between our approximately-close solution and Bayesserver's solution. For e.g., η = 1-10-4 , the difference is at most 10-4 . Recall from Def. 6 that the value of 1-η bounds the size of the unknown regions in the region partitioning procedure. This explains why |uStorm - uBayes| is bounded by 1-η. (II) On increasing the coverage, the difference to the minimum distance rapidly decreases. (III) The computation time moderately increases on increasing the coverage, but the number of iterations was mostly unaffected. At a higher coverage factor, the region partitioning is more fine-granular possibly yielding more accepting regions to analyze. Therefore the computation becomes more expensive. (IV) The timing is not correlated to the number of iterations. This is because the ϵ-close iterations before the last iteration are often completed by a single region verification and are very fast. Similar observations have been made for n&gt;1 parameters; see RQ4.

RQ3: Sensitivity to the threshold λ. We varied the constraint's threshold (λ) by steps of 1/20 for the benchmarks alarm hepar2, and hailfinder with n=1 and η=99.99999%. Figures 7a, 7b, and 7c display the outcomes with the x-axis indicating the threshold and the y-axis indicating the tuning time (in seconds), the distance (log-scale), and the number of iterations.

Findings. For small perturbations the original BNs (B[u0]) may already satisfy the constraints. In general, for the constraints close to the original probability PrB[u0],φ, the number of iterations is low, the distance is naturally small, and the minimal-change tuning is completed fast. This is because region refinement starts with small regions in the close vicinity of the original values of the parameters without the need to analyze larger regions. By strengthening the threshold, the possibly satisfying regions get further away from u0. Thus the distance, the number of iterations, and sometimes the tuning time grow. For very large perturbations the constraint may become infeasible with the confidence factor η = 100%. Similar findings are valid for n&gt;1 parameters; see RQ4.

1

Figure 7: The effect of the constraint restrictiveness (the value of the threshold) on ϵ-bounded tuning: (a) on the tuning time, (b) on the distance, (c) and on the number of iterations; see RQ3. Corner cases: for the constraints with thresholds before 0.4, the original BN satisfies the constraints. For hailfinder with the thresholds λ≥0.55 and alarm with the thresholds λ≥0.7, the constraints become infeasible.

![Image](https://ijcai.org/proceedings/2023/fulltext/635/image_000007_98907ced1b42be6446cbc912f4c83fc8a33d1806f22f40172d73fa833650a3f1.png)

Table 1: The scalability of our approach to pBNs with multiple parameters, detailed results for (left) win95pts and (right) alarm.

|   pBN info - pCPT | pBN info - par   | constraint - thresh.   | setting - cover.   | results - EC   | results - iter   | results - t(s)   |   pBN info - pCPT | pBN info - par   | constraint - thresh.   | setting - cover.   | results - EC   | results - iter t(s)   |
|-------------------|------------------|------------------------|--------------------|----------------|------------------|------------------|-------------------|------------------|------------------------|--------------------|----------------|-----------------------|
|                 1 | 2                | ≥ 0.115                | 99%                | 0.8365285878   | 5                | 4.200            |                 1 | 2                | ≤ 0.30                 | 85%                | 1.138343094    | 5 2.090               |
|                 1 | 2                | ≥ 0.25                 | 100%               | Infeasible     | 6                | 3.750            |                 1 | 2                | ≤ 0.30                 | 99%                | 1.091371208    | 5 2.134               |
|                 3 | 4                | ≥ 0.115                | 90%                | 0.1350477346   | 2                | 5.210            |                 1 | 2                | ≤ 0.30                 | 99.99%             | 1.090202067    | 5 302.1               |
|                 3 | 4                | ≥ 0.25                 | 80%                | 0.4479118217   | 4                | 5.210            |                 1 | 4                | ≤ 0.30                 | 70%                | 0.909491616    | 5 5.701               |
|                 3 | 4                | ≥ 0.25                 | 90%                | 0.4238956239   | 4                | 30.82            |                 1 | 4                | ≤ 0.30                 | 85%                | 0.890217670    | 5 142.1               |
|                 3 | 4                | ≥ 0.25                 | 95%                | 0.4098399078   | 4                | 1128             |                 1 | 4                | ≤ 0.30                 | 90%                | -              | - TO                  |
|                 3 | 4                | ≥ 0.25                 | 99%                | -              | -                | TO               |                 1 | 4                | ≤ 0.20                 | 100%               | Infeasible     | 6 1.869               |
|                 4 | 8                | ≥ 0.115                | 80%                | 0.8805679985   | 2                | 4.496            |                 1 | 4∗ (3)           | ≤ 0.30                 | 99%                | 0.472406250    | 5 2.731               |
|                 4 | 8                | ≥ 0.11                 | 90%                | 0.1350477346   | 2                | 15.91            |                 1 | 8                | ≤ 0.30                 | 20%                | 0.5628159113   | 5 534.6               |
|                 4 | 8                | ≥ 0.30                 | 60%                | 0.8805679985   | 6                | 809.7            |                 1 | 8                | ≤ 0.25                 | 20%                | 0.9405485102   | 5 216.6               |
|                 4 | 8                | ≥ 0.35                 | 99.99%             | Infeasible     | 6                | 3.757            |                 1 | 8                | ≤ 0.20                 | 20%                | 1.010395962    | 6 305.9               |
|                 4 | 8∗ (2)(2)        | ≥ 0.115                | 80%                | 0.013153540    | 1                | 180.6            |                 1 | 8∗ (3)           | ≤ 0.70                 | 20%                | 0.118671026    | 5 608.2               |
|                 4 | 16               | ≥ 0.35                 | 10%                | -              | 1                | MO               |                 1 | 8                | ≤ 0.001                | 100%               | Infeasible     | 6 1.886               |

RQ4: Scaling the number of parameters. We took the win95pts and alarm benchmarks and parameterized them in multiple ways. Their pMCs have 9, 947 and 1, 118 states and 17, 948 and 3, 147 transitions respectively. The set of parameters for each pBN is including (and doubles the number of) parameters in the previous pBN. Table 1(left) and (right) list the results for win95pts and alarm. We list for each pBN, the number of affected CPTs, the number of parameters, the threshold λ, and the coverage η. E.g., win95pts with par=8 has 8 parameters occurring in 4 CPTs. The columns EC, iter, and t(s) report the EC distance, the number of iterations, and the total time in seconds (incl. model building time, time for region refinement, and tuning time) respectively. TO and MO indicate time-out (30 minutes) and memory-out (&gt;16 GB).

Findings. (I) Approximately-close parameter tuning is feasible for pBNs with up to 8 parameters. This is significantly higher than the state of the art-one parameter. As the number of sub-regions by PLA grows exponentially, treating more parameters is practically infeasible. (II) More parameters often ease finding satisfying instantiations. E.g., the threshold ≥ 0.25 is unsatisfiable for win95pts with n=2, but is satisfied with n=4. (III) The results for multiple parameter pBNs confirm the findings for RQ2 and RQ3; see the rows for each pBN instance with (i) varied coverage and (ii) varied threshold. (IV) The unsatisfiability of a constraint can be computed fast (with 100% confidence), regardless of the number of parameters, see e.g., alarm with 8 parameters for the constraint ≤ 0.001. For infeasibility, a single verification suffices; no partitioning is needed.

RQ5: Handling pBNs with parameter dependencies. Parameter lifting algorithm (Section 4.1) enables handling models with parameter dependencies, see e.g., Example 3: the parameters are allowed in multiple local distributions and the pBN sensitivity function is of higher degree. We extended our experiments to such cases for win95pts and alarm: we parameterized the entries θ1 · · · θk ∈ Θmodif over the same parameter x ∈ X when the original values of θ1 · · · θk were the same in the original BN. The eleventh row in Table 1 (left) and the eighth and eleventh rows in Table 1 (right) correspond to such cases. The term 8∗ (2)(2) e.g., denotes that out of the 8 parameters, 2 parameters repeatedly occurred in two distinct distributions. The term 8∗ (3) denotes that out of the 8 parameters, one was occurring in 3 distinct distributions.

Findings. (I) Our method is applicable to pBNs with parameter dependencies where the sensitivity function is of a higher degree. (II) For the same coverage factor, the pBNs with parameter dependency are more expensive to analyze. See e.g., the two rows for win95pts with 8 parameters, threshold ≥ 0.115, and the coverage 80%. This is due to more complex sensitivity functions that give a higher number of sub-regions to verify. (III) The pBNs with parameter dependency yielded notably smaller distances.

## 7 Epilogue

Related work. Kwisthout and van der Gaag [2008] studied the theoretical complexity of tuning problems. Renooij [2014] studied the properties of the co-variation schemes for BN tuning. She shows that the linear proportional scheme optimizes the CD distance for single-CPT pBNs. Similar are the studies by Bolt and van der Gaag [2015; 2017] that consider tuning heuristics for distance optimizations. Peng and Ding [2005] propose an iterative proportional fitting procedure (IPFP) to minimize the KL-divergence distance for a set of constraints. The method does not scale to large networks. Santos et al. [2013] exploits linear programming for BN parameter tuning. Yak- aboski and Santos [2018] consider a new distance measure for parameter learning and tuning of BNs. Leonelli [2019] considers nonlinear sensitivity functions, yet only for single parameter pBNs and BallesterRipoll and Leonelli [2022] efficiently compute the derivatives of sensitivity functions to select the most relevant parameters to a query, yet they limit to single parameter variation.

Conclusion. A novel algorithm for parameter tuning in Bayesian networks is presented and experimentally evaluated. Whereas existing algorithms come with severe restrictions-single parameters and/or linear functions-our approach is applicable to multiple (in practice about 8) parameters, large BNs (up to 100 variables), and polynomial functions. Future work includes considering balanced tuning heuristic [Bolt and van der Gaag, 2017] and using monotonicity of parameters [Spel et al., 2019].

## Acknowledgements

This research was funded by the ERC AdG Projekt FRAPPANT (Grant Nr. 787914). We kindly thank Alexandra Ivanova for her implementation efforts and Tim Quatmann for the fruitful discussions.

## References

1. [Ballester-Ripoll and Leonelli, 2022] Rafael Ballester- Ripoll and Manuele Leonelli. You only derive once (YODO): automatic differentiation for efficient sensitivity analysis in Bayesian networks. In PGM, volume 186 of Proceedings of Machine Learning Research, pages 169-180. PMLR, 2022.
2. [Barreiro et al., 2021] Pablo Barreiro, Jesús San-Román, Maria del Mar Carretero, and Francisco Javier Candel. In- fection and infectivity: Utility of rapid antigen tests for the diagnosis of covid-19. Revista Española de Quimioter- apia, 34(Suppl1):46, 2021.
3. [Bolt and van der Gaag, 2015] Janneke H. Bolt and Linda C. van der Gaag. Balanced tuning of multi-dimensional Bayesian network classifiers. In ECSQARU, volume 9161 of Lecture Notes in Computer Science, pages 210-220. Springer, 2015.
4. [Bolt and van der Gaag, 2017] Janneke H. Bolt and Linda C. van der Gaag. Balanced sensitivity functions for tuning multi-dimensional Bayesian network classifiers. Int. J. Ap- prox. Reason., 80:361-376, 2017.
5. [Castillo et al., 1997] Enrique F. Castillo, José Manuel Gutiérrez, and Ali S. Hadi. Sensitivity analysis in discrete Bayesian networks. IEEE Trans. Syst. Man Cybern. Part A, 27(4):412-423, 1997.
6. [Chan and Darwiche, 2004] Hei Chan and Adnan Darwiche. Sensitivity analysis in Bayesian networks: From single to multiple parameters. In UAI, pages 67-75. AUAI Press, 2004.
7. [Chan and Darwiche, 2005] Hei Chan and Adnan Darwiche. A distance measure for bounding probabilistic belief change. Int. J. Approx. Reason., 38(2):149-174, 2005.
8. [Chan, 2005] Hei Chan. Sensitivity analysis of probabilistic graphical models. University of California, Los Angeles, 2005.
9. [Coupé and van der Gaag, 2002] Veerle M. H. Coupé and Linda C. van der Gaag. Properties of sensitivity analy- sis of Bayesian belief networks. Ann. Math. Artif. Intell., 36(4):323-356, 2002.
10. [Cubuktepe et al., 2018] Murat Cubuktepe, Nils Jansen, Se- bastian Junges, Joost-Pieter Katoen, and Ufuk Topcu. Syn- thesis in pMDPs: A tale of 1001 parameters. In ATVA, vol- ume 11138 of Lecture Notes in Computer Science, pages 160-176. Springer, 2018.
11. [Cubuktepe et al., 2022] Murat Cubuktepe, Nils Jansen, Se- bastian Junges, Joost-Pieter Katoen, and Ufuk Topcu. Convex optimization for parameter synthesis in MDPs. IEEE Trans. Autom. Control., 67(12):6333-6348, 2022.
12. [Darwiche, 2009] Adnan Darwiche. Modeling and Reason- ing with Bayesian Networks. Cambridge University Press, 2009.
13. [Dinnes et al., 2022] Jacqueline Dinnes, Pawana Sharma, Sarah Berhane, Susanna S van Wyk, Nicholas Nyaaba, Julie Domen, Melissa Taylor, Jane Cunningham, Clare Davenport, Sabine Dittrich, et al. Rapid, point-of- care antigen tests for diagnosis of sars-cov-2 infection. Cochrane Database of Systematic Reviews, 7, 2022.
14. [Heck et al., 2022] Linus Heck, Jip Spel, Sebastian Junges, Joshua Moerman, and Joost-Pieter Katoen. Gradient- descent for randomized controllers under partial observ- ability. In VMCAI, volume 13182 of Lecture Notes in Computer Science, pages 127-150. Springer, 2022.
15. [Hensel et al., 2022] Christian Hensel, Sebastian Junges, Joost-Pieter Katoen, Tim Quatmann, and Matthias Volk. The probabilistic model checker storm. Int. J. Softw. Tools Technol. Transf., 24(4):589-610, 2022.
16. [Katoen, 2016] Joost-Pieter Katoen. The probabilistic model checking landscape. In LICS, pages 31-45. ACM, 2016.
17. [Kisa et al., 2014] Doga Kisa, Guy Van den Broeck, Arthur Choi, and Adnan Darwiche. Probabilistic sentential deci- sion diagrams. In KR. AAAI Press, 2014.
18. [Kwisthout and van der Gaag, 2008] Johan Kwisthout and Linda C. van der Gaag. The computational complexity of sensitivity analysis and parameter tuning. In UAI, pages 349-356. AUAI Press, 2008.
19. [Leonelli, 2019] Manuele Leonelli. Sensitivity analysis be- yond linearity. Int. J. Approx. Reason., 113:106-118, 2019.
20. [Nishiura et al., 2020] Hiroshi Nishiura, Tetsuro Kobayashi, Takeshi Miyama, Ayako Suzuki, Sung-mok Jung, Kat- suma Hayashi, Ryo Kinoshita, Yichi Yang, Baoyin Yuan, Andrei R Akhmetzhanov, et al. Estimation of the asymp- tomatic ratio of novel coronavirus infections (covid-19). Int. Journal of Infectious Diseases, 94:154-155, 2020.
21. [Pearl, 1988] Judea Pearl. Probabilistic reasoning in intel- ligent systems: networks of plausible inference. Morgan kaufmann, 1988.
22. [Peng and Ding, 2005] Yun Peng and Zhongli Ding. Mod- ifying Bayesian networks by probability constraints. In UAI, pages 459-466. AUAI Press, 2005.
23. [Quatmann et al., 2016] Tim Quatmann, Christian Dehnert, Nils Jansen, Sebastian Junges, and Joost-Pieter Katoen. Parameter synthesis for Markov models: Faster than ever. In ATVA, volume 9938 of Lecture Notes in Computer Sci- ence, pages 50-67, 2016.
24. [Renooij, 2014] Silja Renooij. Co-variation for sensitivity analysis in Bayesian networks: Properties, consequences and alternatives. Int. J. Approx. Reason., 55(4):1022- 1042, 2014.
25. [Salmani and Katoen, 2020] Bahare Salmani and Joost- Pieter Katoen. Bayesian inference by symbolic model checking. In QEST, volume 12289 of Lecture Notes in Computer Science, pages 115-133. Springer, 2020.
26. [Salmani and Katoen, 2021a] Bahare Salmani and Joost- Pieter Katoen. Fine-tuning the odds in Bayesian networks. In ECSQARU, volume 12897 of Lecture Notes in Com- puter Science, pages 268-283. Springer, 2021.
27. [Salmani and Katoen, 2021b] Bahare Salmani and Joost- Pieter Katoen. Fine-tuning the odds in Bayesian networks. CoRR, abs/2105.14371, 2021.
28. [Santos et al., 2013] Eugene Santos, Qi Gu, and Eunice E. Santos. Bayesian knowledge base tuning. Int. J. Approx. Reason., 54(8):1000-1012, 2013.
29. [Spel et al., 2019] Jip Spel, Sebastian Junges, and Joost- Pieter Katoen. Are parametric Markov chains monotonic? In ATVA, volume 11781 of Lecture Notes in Computer Sci- ence, pages 479-496. Springer, 2019.
30. [Yakaboski and Santos, 2018] Chase Yakaboski and Eugene Santos. Bayesian knowledge base distance-based tuning. In WI, pages 64-72. IEEE Computer Society, 2018.
