Description Usage Arguments Value References Examples
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.
1 2 3 4 5 6 7 8 9 |
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 |
an object of class PrincipalComp
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.
1 | pcaSparse(x, 3, 0.5, 0.12)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.