ppcaMLE: MLEs for the PPPCA model

Description Usage Arguments Value References See Also Examples

View source: R/PPCA_MLE_EM.R

Description

The function returns the MLEs for the PPCA model at a given choice of dimension. This function is adapted from the one made available by Mark Clark on github with the link of the original code under “See also”.

Usage

1
ppcaMLE(x, nComp = 2, tol = 1e-06, maxits = 100)

Arguments

x

a data matrix with the number of rows to be reduced; only complete columns are used.

nComp

an integer specifying the number of principal components or effective dimension retained.

tol

a tolerance level for the EM algorithm to terminate computations.

maxits

the maximum number of iterations for EM to converge to the MLEs.

Value

a list of MLEs: the first item of the list is the loading matrix W, and the second item of the list is the error variance σ^{2} or sigma2.

References

Tipping, M. E., and Bishop, C. M. (1999). Probabilistic principal component analysis. **Journal of the Royal Statistical Society: Series B (Statistical Methodology)**, *61*(3), 611-622. <doi:10.1111/1467-9868.00196>

See Also

https://github.com/m-clark/Miscellaneous-R-Code/blob/master/ModelFitting/EM%20Examples/EM%20algorithm%20for%20ppca.R

Examples

1
2
3
4
5
6
## Not run: 
library(MASS)
X <- mvrnorm(1000, mu = rep(0,10), Sigma = diag(1,10))
ppcaMLE(x = t(X), nComp = 5)

## End(Not run)

WeiAkaneDeng/SPAC2 documentation built on Jan. 15, 2022, 5:01 a.m.