R/covariance_stabilisation.R
stabilize_eigenfloor.Rd
Stabilises a symmetric covariance matrix by replacing eigenvalues smaller than a positive threshold with that threshold.
stabilize_eigenfloor(Sigma, eps = 1e-06)
A square symmetric covariance matrix.
Positive eigenvalue floor.
A symmetric positive definite covariance matrix.
Sigma <- matrix(c(1, 1, 1, 1), nrow = 2) eigen(stabilize_eigenfloor(Sigma))$values #> [1] 2e+00 1e-06