Description Usage Arguments Details Value Examples
Multifactor version of the rank-1 SPCA of spca
.Cmponents are found by
applying spca
to the original matrix after deflation by deducting
the components already found. It is possible to apply different penalties to
different components.
1 2 3 4 5 6 7 8 9 10 |
Z |
Matrix to be decomposed |
k |
Required rank of the result |
c |
L1-norm bound for V (greater than or equal to 1), either length-1, or
with k entries (one for each component). Feasible solutions are available
for values greater than or equal to 1. For values larger than |
start |
Starting values to use for the v vector in each iteration: Either |
maxit |
Maximum number of iterations |
eps |
Stopping criterion, and absolute error tolerance on the mean squared reconstruction error |
center |
Logical indicating whether to column-centre the matrix Z |
scale |
Logical indicating whether to set the standard deviations of the columns of Z equal to one before analysis |
This is similar to SPC
, but differs especially with respect to
the centring of the matrix.
A list with the following components:
The data matrix after projection to the principal component space
The matrix of component loadings
The standard deviations of each of the principal components
Data frame giving the proportion of variance explained by the obtained components
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Random matrix example, with n > p
set.seed(1)
Z <- matrix(rnorm(100), nrow = 20, ncol = 5)
mspca(Z, c = 1.25, k = 5)
## Random matrix example with n < p
Z2 <- matrix(rnorm(100), nrow = 5, ncol = 20)
mspca(Z2, c = 2.5, k = 5)
## Example with different c for components 1 and 2
mspca(Z, k = 2, c = c(1.5, 1.1))
## Comparison to PCA
summary(prcomp(Z2))
mspca(Z2, k = 5, c = max(dim(Z2)))$pve
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.