minka2001: Automatic Choice of Dimensionality for PCA using Bayesian...

Description Usage Arguments Value References Examples

View source: R/minka.R

Description

The function returns the choice dimension for PCA under the PPCA setup using Laplace approximation.

Usage

1
minka2001(lambda, M, verbose = FALSE, tau = 0.001, BIC = FALSE)

Arguments

lambda

a numeric vector of sample eigenvalues of the covariance matrix of X of dimension n by M.

M

the number of columns of X.

verbose

a logical specifying whether the posterior evidence or the integer that minimized the evidence should be returned

tau

a tolerance threshold for the smallest eigenvalue, the default value is 0.001.

BIC

a logical indicating whether the Laplace's method or the BIC approximation should be used.

Value

an integer K between 1 and n that maximizes the posterior evidence by Laplace's method or BIC approximation.

References

Minka, T. (2000). Automatic choice of dimensionality for PCA. **Advances in neural information processing systems**, *13*, 598-604. [http://dblp.uni-trier.de/db/conf/nips/nips2000.html#Minka00]

Examples

1
2
3
4
5
6
7
8
## Not run: 
X <- MASS::mvrnorm(1000, mu = rep(0,10), Sigma = diag(1,10))
eigen_values <- eigen(as.matrix(Matrix::nearPD(stats::cov(scale(X)))$mat))$val
minka2001(lambda = eigen_values, M = 100, BIC=TRUE)
minka2001(lambda = eigen_values, M = 100, BIC=FALSE)
minka2001(lambda = eigen_values, M = 5000)

## End(Not run)

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