## Define population covariance
set.seed(333)
p = 25
n = 1000
X = matrix(rnorm(n*p), nrow = n, ncol = p)
colnames(X)[1:25] = letters[1:25]
Truecov <- covML(X)
## Obtain sample
samples <- X[sample(nrow(X), 10), ]
Cxx <- covML(samples)
## Obtain regularized precision
P <- ridgeS(Cxx, 10, type = "Alt")
## Evaluate estimated precision against population
## precision under Frobenius loss
loss(symm(P), Truecov, precision = FALSE, type = "frobenius")
Run the code above in your browser using DataLab