pve | R Documentation |
Calculate the Proportion of variance explained by a set of linear transformation, (e.g. eigenvectors).
pve(x, v, is.cov = FALSE)
x |
|
v |
|
is.cov |
|
a numeric
value between 0 and 1, the proportion of total variance in x
explained by the PCs whose loadings are in v
.
Shen, H., & Huang, J. Z. (2008). "Sparse principal component analysis via regularized low rank matrix approximation." Journal of multivariate analysis, 99(6), 1015-1034.
## use the "swiss" data
## find two sparse PCs
s.sca <- sca(swiss, 2, gamma = sqrt(ncol(swiss)))
ld <- loadings(s.sca)
pve(as.matrix(swiss), ld)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.