# NOT RUN {
## generate data from multivariate normal with Identity covariance.
pdim <- 5
data <- matrix(rnorm(10*pdim), ncol=pdim)
## apply 4 different schemes
# mthr is a vector of regularization parameters to be tested
mthr <- seq(from=0.01,to=0.99,length.out=10)
out1 <- CovEst.adaptive(data, thr=0.1) # threshold value 0.1
out2 <- CovEst.adaptive(data, thr=0.5) # threshold value 0.5
out3 <- CovEst.adaptive(data, thr=0.1) # threshold value 0.9
out4 <- CovEst.adaptive(data, thr=mthr) # automatic threshold checking
## visualize 4 estimated matrices
opar <- par(no.readonly=TRUE)
par(mfrow=c(2,2), pty="s")
image(out1$S[,pdim:1], col=gray((0:100)/100), main="thr=0.1")
image(out2$S[,pdim:1], col=gray((0:100)/100), main="thr=0.5")
image(out3$S[,pdim:1], col=gray((0:100)/100), main="thr=0.9")
image(out4$S[,pdim:1], col=gray((0:100)/100), main="automatic")
par(opar)
# }
Run the code above in your browser using DataLab