Does anyone know where I can find an algorithm, as well as an R implementation of it, to carry out sparse principal component analysis (PCA)?
Asked
Active
Viewed 3,445 times
4
2 Answers
5
Another good package is the elasticnet package that Zou and Hastie put out. It has the function spca.
Be careful to select a good value of $\lambda$, the sparsity parameter (or vector of them).
I would be curious to know which package ends up working better for you since the other package mentioned by @Stephan Kolassa is a year newer and is by Hastie's coauthor, Tibshirani.
Deathkill14
- 2,200
1
Which function in which package are you interested in? All code is available on CRAN. For instance, if you are thinking about the PMA package (just the first one I found by googling for "CRAN Sparse Principal Components Analysis"), you can find the source code here.
Stephan Kolassa
- 123,354
-
Thank you very much for your useful answer.I want to use general form of lasso which elasticnet to select a group of highly correlated variables.if you have any idea which is better please tell me your opinion. – user46759 Jun 07 '14 at 07:16
Rcode. If it were changed to request an algorithm I think there would be no controversy. – whuber Jun 05 '14 at 13:14