## Obtain some (high-dimensional) data
p = 25
n = 10
set.seed(333)
X = matrix(rnorm(n*p), nrow = n, ncol = p)
colnames(X)[1:25] = letters[1:25]
Cx <- cov(X)
## Obtain regularized precision under optimal penalty
OPT <- optPenaltyCV(X, 15, 30, 20, output = "light")
## Check symmetry
## OPT$optPrec is symmetric by definition
## But is not recognized as such due to rounding peculiarities
isSymmetric(OPT$optPrec)
## Symmetrize
symm(OPT$optPrec)
Run the code above in your browser using DataLab