Description Usage Arguments Value References See Also Examples
Perform parameter updates for PPCA using the Expectation-Maximisation framework
from Porta (2005) and also in the R-package pcaMethods
(Stacklies, 2007).
Not recommended to use standalone, rather it is called from within
ppcapM
and its wrapper pcapM
.
1 2 3 4 5 6 7 8 9 10 11 |
myMat |
|
N |
|
D |
|
W |
|
hidden |
|
nMissing |
|
nPcs |
|
threshold |
|
maxIterations |
|
A list
of 4 elements:
matrix
– the estimated loadings.
numeric
– the estimated model variance.
matrix
– the estimated covariance matrix.
matrix
– the data matrix with missing values
replaced by their estimated projections.
Porta, J.M., Verbeek, J.J. and Kroese, B.J., 2005. link
Stacklies, W., Redestig, H., Scholz, M., Walther, D. and Selbig, J., 2007. doi.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | set.seed(102)
N <- 20
D <- 20
nPcs <- 2
maxIterations <- 1000
X <- matrix(rnorm(50), D, N)
X <- scale(X, center=TRUE, scale=FALSE) # mean 0
covX <- cov(X)
IX <- sample(1:D, 10)
JX <- sample(1:N, 10)
nMissing <- length(IX)+length(JX)
X[JX, IX] <- 0
hidden <- which(X==0)
threshold <- 1e-4
r <- sample(N)
W <- t(X[r[1:nPcs], ,drop = FALSE])
W <- matrix(rnorm(W), nrow(W), ncol(W), dimnames = labels(W) )
ppcaNetOutput <- ppcaNet(X, N, D, W, hidden, nMissing, nPcs, threshold, maxIterations)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.