powered by
Calculate the CPVE.
cpve(x, v, is.cov = FALSE)
a numeric vector of length ncol(v), the i-th value is the CPVE of the first i columns in v.
numeric
ncol(v)
v
matrix or Matrix, the original data matrix or the Gram matrix.
matrix
Matrix
matrix or Matrix, coefficients of linear transformation, e.g., loadings (in PCA).
logical, whether the input matrix is a covariance matrix (or a Gram matrix).
logical
pve
## use the "swiss" data ## find two sparse PCs s.sca <- sca(swiss, 2, gamma = sqrt(ncol(swiss))) ld <- loadings(s.sca) cpve(as.matrix(swiss), ld)
Run the code above in your browser using DataLab