pesel-package: Automatic estimation of number of principal components in PCA

Description Details Author(s) References Examples

Description

Automatic estimation of number of principal components in PCA with PEnalized SEmi-integrated Likelihood (PESEL).

Details

Version: 0.7.4

Author(s)

Piotr Sobczyk, Julie Josse, Malgorzata Bogdan

Maintainer: Piotr Sobczyk pj.sobczyk@gmail.com

References

Piotr Sobczyk, Malgorzata Bogdan, Julie Josse Bayesian dimensionality reduction with PCA using penalized semi-integrated likelihood, Journal of Computational and Graphical Statistics 2017

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# EXAMPLE 1 - noise
with(set.seed(23), pesel(matrix(rnorm(10000), ncol = 100), npc.min = 0))

# EXAMPLE 2 - fixed effects PCA model
sigma <- 0.5
k <-  5
n <- 100
numb.vars <- 10
# factors are drawn from normal distribution
factors <- replicate(k, rnorm(n, 0, 1))
# coefficients are drawn from uniform distribution
coeff <- replicate(numb.vars, rnorm(k, 0, 1))
SIGNAL <- scale(factors %*% coeff)
X <- SIGNAL + replicate(numb.vars, sigma * rnorm(n))
pesel(X)

psobczyk/pesel documentation built on June 18, 2021, 3:02 p.m.