Skip to contents

Jeffreys.CI returns the Jeffreys divergence between an object of class CI and its update after a model-preserving parameter variation.

Usage

# S3 method for CI
Jeffreys(x, type, entry, delta, ...)

Arguments

x

object of class CI.

type

character string. Type of model-preserving co-variation: either "total", "partial", row,column or all. If all the Jeffreys divergence is computed for every type of co-variation matrix.

entry

a vector of length 2 indicating the entry of the covariance matrix to vary.

delta

numeric vector with positive elements, including the variation parameters that act multiplicatively.

...

additional arguments for compatibility.

Value

A dataframe including in the first column the variations performed, and in the following columns the corresponding Jeffreys divergences for the chosen model-preserving co-variations.

Details

Computation of the Jeffreys divergence between a Bayesian network and its updated version after a model-preserving variation.

References

C. Görgen & M. Leonelli (2020), Model-preserving sensitivity analysis for families of Gaussian distributions. Journal of Machine Learning Research, 21: 1-32.

Examples

Jeffreys(synthetic_ci,"total",c(1,1),seq(0.9,1.1,0.01))
#>    Variation      Jeffreys
#> 1       0.90  4.500000e-01
#> 2       0.91  3.169565e-01
#> 3       0.92  2.215385e-01
#> 4       0.93  1.520690e-01
#> 5       0.94  1.012500e-01
#> 6       0.95  6.428571e-02
#> 7       0.96  3.789474e-02
#> 8       0.97  1.975610e-02
#> 9       0.98  8.181818e-03
#> 10      0.99  1.914894e-03
#> 11      1.00 -1.154632e-14
#> 12      1.01  1.698113e-03
#> 13      1.02  6.428571e-03
#> 14      1.03  1.372881e-02
#> 15      1.04  2.322581e-02
#> 16      1.05  3.461538e-02
#> 17      1.06  4.764706e-02
#> 18      1.07  6.211268e-02
#> 19      1.08  7.783784e-02
#> 20      1.09  9.467532e-02
#> 21      1.10  1.125000e-01
Jeffreys(synthetic_ci,"partial",c(1,4),seq(0.9,1.1,0.01))
#>    Variation      Jeffreys
#> 1       0.90            NA
#> 2       0.91  5.546515e+00
#> 3       0.92  2.386087e+00
#> 4       0.93  1.401482e+00
#> 5       0.94  9.022547e-01
#> 6       0.95  5.913793e-01
#> 7       0.96  3.758904e-01
#> 8       0.97  2.187536e-01
#> 9       0.98  1.044670e-01
#> 10      0.99  2.921112e-02
#> 11      1.00 -1.154632e-14
#> 12      1.01  4.310592e-02
#> 13      1.02  2.426367e-01
#> 14      1.03  9.874965e-01
#> 15      1.04  1.372000e+01
#> 16      1.05            NA
#> 17      1.06            NA
#> 18      1.07            NA
#> 19      1.08            NA
#> 20      1.09            NA
#> 21      1.10            NA
Jeffreys(synthetic_ci,"column",c(1,2),seq(0.9,1.1,0.01))
#>    Variation      Jeffreys
#> 1       0.90            NA
#> 2       0.91            NA
#> 3       0.92            NA
#> 4       0.93            NA
#> 5       0.94            NA
#> 6       0.95  3.185714e+00
#> 7       0.96  9.096194e-01
#> 8       0.97  3.480288e-01
#> 9       0.98  1.227907e-01
#> 10      0.99  2.656130e-02
#> 11      1.00 -1.154632e-14
#> 12      1.01  2.354191e-02
#> 13      1.02  9.519481e-02
#> 14      1.03  2.279154e-01
#> 15      1.04  4.603681e-01
#> 16      1.05  9.032787e-01
#> 17      1.06  1.988852e+00
#> 18      1.07  8.363301e+00
#> 19      1.08            NA
#> 20      1.09            NA
#> 21      1.10            NA
Jeffreys(synthetic_ci,"row",c(3,2),seq(0.9,1.1,0.01))
#>    Variation      Jeffreys
#> 1       0.90            NA
#> 2       0.91            NA
#> 3       0.92            NA
#> 4       0.93            NA
#> 5       0.94            NA
#> 6       0.95            NA
#> 7       0.96            NA
#> 8       0.97  2.844994e+00
#> 9       0.98  4.140902e-01
#> 10      0.99  6.394370e-02
#> 11      1.00 -1.154632e-14
#> 12      1.01  3.898137e-02
#> 13      1.02  1.359300e-01
#> 14      1.03  2.800207e-01
#> 15      1.04  4.769514e-01
#> 16      1.05  7.504484e-01
#> 17      1.06  1.161735e+00
#> 18      1.07  1.889495e+00
#> 19      1.08  3.716283e+00
#> 20      1.09  2.343924e+01
#> 21      1.10            NA
Jeffreys(synthetic_ci,"all",c(3,2),seq(0.9,1.1,0.01))
#>    Variation         Total       Partial     Row_based  Column_based
#> 1       0.90  2.222222e-02            NA            NA            NA
#> 2       0.91  1.780220e-02            NA            NA            NA
#> 3       0.92  1.391304e-02            NA            NA            NA
#> 4       0.93  1.053763e-02            NA            NA            NA
#> 5       0.94  7.659574e-03            NA            NA            NA
#> 6       0.95  5.263158e-03            NA            NA            NA
#> 7       0.96  3.333333e-03            NA            NA            NA
#> 8       0.97  1.855670e-03            NA  2.844994e+00            NA
#> 9       0.98  8.163265e-04  1.798459e+00  4.140902e-01  8.333333e-01
#> 10      0.99  2.020202e-04  1.433278e-01  6.394370e-02  9.877622e-02
#> 11      1.00 -1.154632e-14 -1.154632e-14 -1.154632e-14 -1.154632e-14
#> 12      1.01  1.980198e-04  6.294876e-02  3.898137e-02  5.092593e-02
#> 13      1.02  7.843137e-04  2.002346e-01  1.359300e-01  1.691176e-01
#> 14      1.03  1.747573e-03  3.786784e-01  2.800207e-01  3.331882e-01
#> 15      1.04  3.076923e-03  5.882775e-01  4.769514e-01  5.416667e-01
#> 16      1.05  4.761905e-03  8.280151e-01  7.504484e-01  8.068182e-01
#> 17      1.06  6.792453e-03  1.102738e+00  1.161735e+00  1.161290e+00
#> 18      1.07  9.158879e-03  1.423943e+00  1.889495e+00  1.686594e+00
#> 19      1.08  1.185185e-02  1.814278e+00  3.716283e+00  2.631579e+00
#> 20      1.09  1.486239e-02  2.320121e+00  2.343924e+01  5.245482e+00
#> 21      1.10  1.818182e-02  3.050000e+00            NA            NA