ppcaCV: Cross-validation for the PPCA model.

Description Usage Arguments Value References Examples

View source: R/alternative.R

Description

The function returns the profile log-likelihood of the PPCA model at respective MLEs for a specific choice of $K=k$ evaluated by cross-validation.

Usage

1
ppcaCV(k = NULL, x = NULL, fold = 5)

Arguments

k

an integer indicating the tested dimension, should be between 1 and the number of rows of x.

x

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

fold

an integer indicating the number of folds to be used.

Value

profile log-likelihood of the remaining fold evaluated at MLEs computed from other folds.

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>

Examples

1
2
3
4
5
6
7
## Not run: 
library(MASS)
X <- mvrnorm(1000, mu = rep(0,50), Sigma = diag(1,50))
ppcaCV(k = 5, x = X, fold = 5) # 5-fold cross-validation.

## End(Not run)
#'

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