Skip to contents

psd_check returns a boolean to determine if the covariance matrix after a perturbation is positive semi-definite.

Usage

psd_check(x, ...)

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

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

Arguments

x

object of class GBN or CI.

...

additional arguments for compatibility.

entry

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

delta

numeric vector, including the variation parameters that act additively.

type

character string. Type of model-preserving co-variation: either total, partial, row, column or all. If all, the Frobenius norms are computed for every type of co-variation matrix.

Value

A dataframe including the variations performed and the check for positive semi-definiteness.

Details

The details depend on the class the method psd_check is applied to.

Let \(\Sigma\) be the covariance matrix of a Gaussian Bayesian network and let \(D\) be a perturbation matrix acting additively. The perturbed covariance matrix \(\Sigma+D\) is positive semi-definite if $$\rho(D)\leq \lambda_{\min}(\Sigma)$$ where \(\lambda_{\min}\) is the smallest eigenvalue end \(\rho\) is the spectral radius.

Methods (by class)

  • GBN: psd_check for objects GBN

  • CI: psd_check for objects CI

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

psd_check(synthetic_gbn,c(2,4),-3)
#>   Variation   PSD
#> 1        -3 FALSE
psd_check(synthetic_gbn,c(2,3),seq(-1,1,0.1))
#>    Variation   PSD
#> 1       -1.0 FALSE
#> 2       -0.9 FALSE
#> 3       -0.8 FALSE
#> 4       -0.7 FALSE
#> 5       -0.6 FALSE
#> 6       -0.5 FALSE
#> 7       -0.4 FALSE
#> 8       -0.3 FALSE
#> 9       -0.2 FALSE
#> 10      -0.1  TRUE
#> 11       0.0  TRUE
#> 12       0.1  TRUE
#> 13       0.2 FALSE
#> 14       0.3 FALSE
#> 15       0.4 FALSE
#> 16       0.5 FALSE
#> 17       0.6 FALSE
#> 18       0.7 FALSE
#> 19       0.8 FALSE
#> 20       0.9 FALSE
#> 21       1.0 FALSE
psd_check(synthetic_ci,"partial",c(2,4),0.95)
#>   Variation psd.check
#> 1      0.95     FALSE
psd_check(synthetic_ci,"all",c(2,3),seq(0.9,1.1,0.01))
#>    Variation Total Partial Row_based Column_based
#> 1       0.90  TRUE   FALSE     FALSE        FALSE
#> 2       0.91  TRUE   FALSE     FALSE        FALSE
#> 3       0.92  TRUE   FALSE     FALSE        FALSE
#> 4       0.93  TRUE   FALSE     FALSE        FALSE
#> 5       0.94  TRUE   FALSE     FALSE        FALSE
#> 6       0.95  TRUE   FALSE     FALSE        FALSE
#> 7       0.96  TRUE   FALSE     FALSE        FALSE
#> 8       0.97  TRUE   FALSE     FALSE        FALSE
#> 9       0.98  TRUE   FALSE      TRUE        FALSE
#> 10      0.99  TRUE    TRUE      TRUE         TRUE
#> 11      1.00  TRUE    TRUE      TRUE         TRUE
#> 12      1.01  TRUE    TRUE      TRUE         TRUE
#> 13      1.02  TRUE   FALSE      TRUE        FALSE
#> 14      1.03  TRUE   FALSE     FALSE        FALSE
#> 15      1.04  TRUE   FALSE     FALSE        FALSE
#> 16      1.05  TRUE   FALSE     FALSE        FALSE
#> 17      1.06  TRUE   FALSE     FALSE        FALSE
#> 18      1.07  TRUE   FALSE     FALSE        FALSE
#> 19      1.08  TRUE   FALSE     FALSE        FALSE
#> 20      1.09  TRUE   FALSE     FALSE        FALSE
#> 21      1.10  TRUE   FALSE     FALSE        FALSE