Commits

Casey Dunn committed 611f8d3

simplified thresholding code

Comments (0)

Files changed (1)

 # Bickel, P. J. & Levina, E. Covariance regularization by thresholding. 
 # Ann. Statist. 36, 2577–2604 (2008). http://dx.doi.org/10.1214/08-AOS600
 
-Zlist <- Array2List(Z)
-conlist <- lapply(Zlist, function(x) apply(x, 2, function(a) pic(a, phy)))
-
-relist.s <- lapply(conlist, function(x) {
-	cor(x)
-})
-
-bickel <- relist.s[[1]]*(abs(relist.s[[1]])>sqrt(log(p)/n))
 
+bickel <- contrastcor*(abs(contrastcor)>sqrt(log(p)/n))
 
 # Regularization by convex Minimization
 # Luo, X. High Dimensional Low Rank and Sparse Covariance Matrix Estimation via 
 # Convex Minimization. arXiv.org (2011). http://arxiv.org/abs/1111.1133
 
+
+Zlist <- Array2List(Z)
+conlist <- lapply(Zlist, function(x) apply(x, 2, function(a) pic(a, phy)))
+
 relist.l <- lapply( conlist, function(x) {
 	re.lorec <- lorec(cor(x), diag(1, 100), diag(1, 100), sqrt(p/n), sqrt(log(p)/n))
 	re.lorec.eig <- eigen(re.lorec$L)