Skip to contents

Chan-Darwiche (CD) distance between a Bayesian network and its update after parameter variation.

Usage

CD(
  bnfit,
  node,
  value_node,
  value_parents,
  new_value,
  covariation = "proportional"
)

Arguments

bnfit

object of class bn.fit.

node

character string. Node of which the conditional probability distribution is being changed.

value_node

character string. Level of node.

value_parents

character string. Levels of node's parents. The levels should be defined according to the order of the parents in bnfit[[node]][["parents"]]. If node has no parents, then it should be set to NULL.

new_value

numeric vector with elements between 0 and 1. Values to which the parameter should be updated. It can take a specific value or more than one. In the case of more than one value, these should be defined through a vector with an increasing order of the elements. new_value can also be set to the character string all: in this case a sequence of possible parameter changes ranging from 0.05 to 0.95 is considered.

covariation

character string. Co-variation scheme to be used for the updated Bayesian network. Can take values uniform, proportional, orderp, all. If equal to all, uniform, proportional and order-preserving co-variation schemes are used. Set by default to proportional.

Value

The function CD returns a dataframe including in the first column the variations performed, and in the following columns the corresponding CD distances for the chosen co-variation schemes.

Details

The Bayesian network on which parameter variation is being conducted should be expressed as a bn.fit object. The name of the node to be varied, its level and its parent's levels should be specified. The parameter variation specified by the function is:

P ( node = value_node | parents = value_parents ) = new_value

The CD distance between two probability distributions \(P\) and \(P'\) defined over the same sample space \(\mathcal{Y}\) is defined as $$CD(P,P')= \log\max_{y\in\mathcal{Y}}\left(\frac{P(y)}{P'(y)}\right) - \log\min_{y\in\mathcal{Y}}\left(\frac{P(y)}{P'(y)}\right)$$

References

Chan, H., & Darwiche, A. (2005). A distance measure for bounding probabilistic belief change. International Journal of Approximate Reasoning, 38(2), 149-174.

Renooij, S. (2014). Co-variation for sensitivity analysis in Bayesian networks: Properties, consequences and alternatives. International Journal of Approximate Reasoning, 55(4), 1022-1042.

See also

Examples

CD(synthetic_bn, "y2", "1", "2", "all", "all")
#>    New_value   Uniform Proportional Order Preserving
#> 1       0.05 2.2512918    2.0971411     2.097141e+00
#> 2       0.10 1.5040774    1.3499267     1.349927e+00
#> 3       0.15 1.0414539    0.8873032     8.873032e-01
#> 4       0.20 0.6931472    0.5389965     5.389965e-01
#> 5       0.25 0.4054651    0.2513144     2.513144e-01
#> 6       0.30 0.2876821    0.0000000     2.220446e-16
#> 7       0.30 0.2876821    0.0000000     2.220446e-16
#> 8       0.35 0.3617900    0.2282587               NA
#> 9       0.40 0.5753641    0.4418328               NA
#> 10      0.45 0.7801586    0.6466272               NA
#> 11      0.50 0.9808293    0.8472979               NA
#> 12      0.55 1.1814999    1.0479686               NA
#> 13      0.60 1.3862944    1.2527630               NA
#> 14      0.65 1.5998685    1.4663371               NA
#> 15      0.70 1.8281271    1.6945957               NA
#> 16      0.75 2.0794415    1.9459101               NA
#> 17      0.80 2.3671236    2.2335922               NA
#> 18      0.85 2.7154303    2.5818989               NA
#> 19      0.90 3.1780538    3.0445224               NA
#> 20      0.95 3.9252682    3.7917368               NA
CD(synthetic_bn, "y1", "2", NULL, 0.3, "all")
#>   New_value   Uniform Proportional Order Preserving
#> 1       0.3 0.9162907            0                0