pcaSparse: Sparse Principal Components Analysis

Description Usage Arguments Value References Examples

View source: R/PCAandFA.R

Description

This function is based on the original paper by Zou, Hastie, and Tibsharini (2006) where an elastic net formulation of principal components analysis was demonstrated.

Usage

1
2
3
4
5
6
7
8
9
pcaSparse(
  x,
  ncomp = min(nrow(x) - 1, ncol(x)),
  alpha = 0.75,
  lambda = 1e-04,
  scale = T,
  max.iter = 1000,
  tol = 1e-16
)

Arguments

x

a data frame or matrix of numeric variables

ncomp

the number of components to extract.

alpha

the elastic net mixing parameter, which can take values of 0 ≤ α ≥ 1.

lambda

the shrinkage parameter. as in the elastic net, the L1 shrinkage penalty is λ_1 = α * λ, and the L2 shrinkage penalty is λ_2 = (1-α) * λ.

scale

should the variables be scaled prior to analysis? Defaults to TRUE.

max.iter

maximum number of iterations

tol

tolerance for convergence

Value

an object of class PrincipalComp

References

Zou, H.; Hastie, T.; Tibshirani, R. (2006). Sparse principal component analysis. Journal of Computational and Graphical Statistics. 15 (2): 262–286. doi:10.1198/106186006x113430.

Examples

1
pcaSparse(x, 3, 0.5, 0.12)

abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.