Skip to contents

KL.GBN returns the Kullback-Leibler (KL) divergence between an object of class GBN and its update after a standard parameter variation.

Usage

# S3 method for GBN
KL(x, where, entry, delta, ...)

Arguments

x

object of class GBN.

where

character string: either mean or covariance for variations of the mean vector and covariance matrix respectively.

entry

if where == "mean", entry is the index of the entry of the mean vector to vary. If where == "covariance", entry is a vector of length 2 indicating the entry of the covariance matrix to vary.

delta

numeric vector, including the variation parameters that act additively.

...

additional arguments for compatibility.

Value

A dataframe including in the first column the variations performed and in the second column the corresponding KL divergences.

Details

Computation of the KL divergence between a Bayesian network and the additively perturbed Bayesian network, where the perturbation is either to the mean vector or to the covariance matrix.

References

Gómez-Villegas, M. A., Maín, P., & Susi, R. (2007). Sensitivity analysis in Gaussian Bayesian networks using a divergence measure. Communications in Statistics—Theory and Methods, 36(3), 523-539.

Gómez-Villegas, M. A., Main, P., & Susi, R. (2013). The effect of block parameter perturbations in Gaussian Bayesian networks: Sensitivity and robustness. Information Sciences, 222, 439-458.

Examples

KL(synthetic_gbn,"mean",2,seq(-1,1,0.1))
#>    Variation    KL
#> 1       -1.0 1.500
#> 2       -0.9 1.215
#> 3       -0.8 0.960
#> 4       -0.7 0.735
#> 5       -0.6 0.540
#> 6       -0.5 0.375
#> 7       -0.4 0.240
#> 8       -0.3 0.135
#> 9       -0.2 0.060
#> 10      -0.1 0.015
#> 11       0.0 0.000
#> 12       0.1 0.015
#> 13       0.2 0.060
#> 14       0.3 0.135
#> 15       0.4 0.240
#> 16       0.5 0.375
#> 17       0.6 0.540
#> 18       0.7 0.735
#> 19       0.8 0.960
#> 20       0.9 1.215
#> 21       1.0 1.500
KL(synthetic_gbn,"covariance",c(3,3),seq(-1,1,0.1))
#>    Variation         KL
#> 1       -1.0         NA
#> 2       -0.9         NA
#> 3       -0.8         NA
#> 4       -0.7         NA
#> 5       -0.6         NA
#> 6       -0.5         NA
#> 7       -0.4         NA
#> 8       -0.3         NA
#> 9       -0.2         NA
#> 10      -0.1 0.09657359
#> 11       0.0 0.00000000
#> 12       0.1 0.04726745
#> 13       0.2 0.15342641
#> 14       0.3 0.29185463
#> 15       0.4 0.45069386
#> 16       0.5 0.62361852
#> 17       0.6 0.80685282
#> 18       0.7 0.99796130
#> 19       0.8 1.19528104
#> 20       0.9 1.39762595
#> 21       1.0 1.60412027