Skip to contents

Functions that return an updated Bayesian network using the proportional, uniform and order-preserving co-variation schemes.

Usage

proportional_covar(bnfit, node, value_node, value_parents, new_value)

orderp_covar(bnfit, node, value_node, value_parents, new_value)

uniform_covar(bnfit, node, value_node, value_parents, new_value)

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 value between 0 and 1. Value to which the parameter should be updated.

Value

An object of class bn.fit with updated probabilities.

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

For orderp_covar, if two or more parameters in a distribution have the same value, the order is given by the one in the respective conditional probability table. Furthermore, the parameter associated to the largest probability of the conditional probability law cannot be varied.

References

Laskey, K. B. (1995). Sensitivity analysis for probability assessments in Bayesian networks. IEEE Transactions on Systems, Man, and Cybernetics, 25(6), 901-909.

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

Leonelli, M., & Riccomagno, E. (2018). A geometric characterisation of sensitivity analysis in monomial models. arXiv preprint arXiv:1901.02058.

Examples

proportional_covar(synthetic_bn, "y3", "2", c("2","1"), 0.3)
#> 
#>   Bayesian network parameters
#> 
#>   Parameters of node y1 (multinomial distribution)
#> 
#> Conditional probability table:
#>  
#>   1   2   3 
#> 0.2 0.3 0.5 
#> 
#>   Parameters of node y2 (multinomial distribution)
#> 
#> Conditional probability table:
#>  
#>    y1
#> y2    1   2   3
#>   1 0.2 0.3 0.7
#>   2 0.3 0.3 0.2
#>   3 0.5 0.4 0.1
#> 
#>   Parameters of node y3 (multinomial distribution)
#> 
#> Conditional probability table:
#>  
#> , , y2 = 1
#> 
#>    y1
#> y3    1   2   3
#>   1 0.1 0.1 0.2
#>   2 0.2 0.3 0.3
#>   3 0.7 0.6 0.5
#> 
#> , , y2 = 2
#> 
#>    y1
#> y3    1   2   3
#>   1 0.1 0.3 0.3
#>   2 0.4 0.6 0.5
#>   3 0.5 0.1 0.2
#> 
#> , , y2 = 3
#> 
#>    y1
#> y3    1   2   3
#>   1 0.8 0.7 0.4
#>   2 0.1 0.2 0.5
#>   3 0.1 0.1 0.1
#> 
#> 
uniform_covar(synthetic_bn, "y2", "1", "2", 0.3)
#> 
#>   Bayesian network parameters
#> 
#>   Parameters of node y1 (multinomial distribution)
#> 
#> Conditional probability table:
#>  
#>   1   2   3 
#> 0.2 0.3 0.5 
#> 
#>   Parameters of node y2 (multinomial distribution)
#> 
#> Conditional probability table:
#>  
#>    y1
#> y2     1    2    3
#>   1 0.20 0.30 0.70
#>   2 0.30 0.35 0.20
#>   3 0.50 0.35 0.10
#> 
#>   Parameters of node y3 (multinomial distribution)
#> 
#> Conditional probability table:
#>  
#> , , y2 = 1
#> 
#>    y1
#> y3    1   2   3
#>   1 0.1 0.1 0.2
#>   2 0.2 0.3 0.3
#>   3 0.7 0.6 0.5
#> 
#> , , y2 = 2
#> 
#>    y1
#> y3    1   2   3
#>   1 0.1 0.3 0.3
#>   2 0.4 0.6 0.5
#>   3 0.5 0.1 0.2
#> 
#> , , y2 = 3
#> 
#>    y1
#> y3    1   2   3
#>   1 0.8 0.7 0.4
#>   2 0.1 0.2 0.5
#>   3 0.1 0.1 0.1
#> 
#> 
orderp_covar(synthetic_bn, "y1", "1", NULL, 0.3)
#> 
#>   Bayesian network parameters
#> 
#>   Parameters of node y1 (multinomial distribution)
#> 
#> Conditional probability table:
#>  
#>     1     2     3 
#> 0.300 0.325 0.375 
#> 
#>   Parameters of node y2 (multinomial distribution)
#> 
#> Conditional probability table:
#>  
#>    y1
#> y2    1   2   3
#>   1 0.2 0.3 0.7
#>   2 0.3 0.3 0.2
#>   3 0.5 0.4 0.1
#> 
#>   Parameters of node y3 (multinomial distribution)
#> 
#> Conditional probability table:
#>  
#> , , y2 = 1
#> 
#>    y1
#> y3    1   2   3
#>   1 0.1 0.1 0.2
#>   2 0.2 0.3 0.3
#>   3 0.7 0.6 0.5
#> 
#> , , y2 = 2
#> 
#>    y1
#> y3    1   2   3
#>   1 0.1 0.3 0.3
#>   2 0.4 0.6 0.5
#>   3 0.5 0.1 0.2
#> 
#> , , y2 = 3
#> 
#>    y1
#> y3    1   2   3
#>   1 0.8 0.7 0.4
#>   2 0.1 0.2 0.5
#>   3 0.1 0.1 0.1
#> 
#>