Description Usage Arguments Value References See Also Examples
Perform parameter updates for PPCA using the Variational Bayes framework
from Oba (2003). Not recommended to use standalone, rather it is called from within
bpcapM
and its wrapper pcapM
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
myMat |
|
covy |
|
N |
|
D |
|
hidden |
|
numberOfNonNAvaluesInEachCol |
|
nomissIndex |
|
missIndex |
|
nMissing |
|
nPcs |
|
threshold |
|
maxIterations |
|
A list
of 5 elements:
matrix
– the estimated loadings.
numeric
– the estimated model variance.
matrix
– the estimated covariance matrix.
matrix
– the estimated scores.
numeric
– the estimated mean vector.
Oba, S., Sato, M.A., Takemasa, I., Monden, M., Matsubara, K.I. and Ishii, S., 2003. doi.
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 19 20 21 | 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)
numberOfNonNAvaluesInEachCol <- colSums(X!=0)
nomissIndex <- which(rowSums(X!=0)==N)
missIndex <- which(rowSums(X!=0)!=N)
threshold <- 1e-4
bpcaNetOutput <- bpcaNet(myMat=X, covy=covX, N=N, D=D, hidden=hidden,
numberOfNonNAvaluesInEachCol=numberOfNonNAvaluesInEachCol,
nomissIndex=nomissIndex, missIndex=missIndex, nMissing=nMissing,
nPcs=nPcs, threshold=threshold, maxIterations=maxIterations)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.