Description Usage Arguments Value Examples
Multifactor version of the rank-1 L1-penalized matrix decomposition in
pmd
. Components are found by applying pmd
to the original matrix after deflation by deducting the components already
found.
1 2 3 4 5 6 7 8 9 |
Z |
Matrix to be decomposed |
k |
Required rank of the result |
c1 |
L1-norm bound for U (greater than or equal to 1), either length-1, or with k entries (one for each component). |
c2 |
L1-norm bound for V (greater than or equal to 1), either length-1, or with k entries (one for each component) |
maxit |
Maximum number of iterations |
eps |
Stopping criterion, an absolute error tolerance on the mean squared reconstruction error |
centre |
Logical indicating whether to centre the matrix Z using the overall mean before analysis |
A list with the penalized singular value decomposition (d
, U
, V
).
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Simple random test matrix
set.seed(1)
Z <- matrix(rnorm(100), nrow = 20, ncol = 5)
## Ordinary SVD (equivalent up to changes in sign)
mpmd(Z, c1 = 5, c2 = 3, k = 5)
svd(Z)
## Test with constant c1 and c2
mpmd(Z, c1 = 2, c2 = 1.25, k = 5)
## Test with different c1 and c2 for different components
mpmd(Z, c1 = c(3, 1.25), c2 = c(2, 1.25), k = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.