nipals: PCA calculation with the NIPALS algorithm

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

NIPALS is an algorithm for computing PCA scores and loadings.

Usage

1
nipals(X, a, it = 10, tol = 1e-04)

Arguments

X

numeric data frame or matrix

a

maximum number of principal components to be computed

it

maximum number of iterations

tol

tolerance limit for convergence of the algorithm

Details

The NIPALS algorithm is well-known in chemometrics. It is an algorithm for computing PCA scores and loadings. The advantage is that the components are computed one after the other, and one could stop at a desired number of components.

Value

T

matrix with the PCA scores

P

matrix with the PCA loadings

Author(s)

Peter Filzmoser <P.Filzmoser@tuwien.ac.at>

References

K. Varmuza and P. Filzmoser: Introduction to Multivariate Statistical Analysis in Chemometrics. CRC Press, Boca Raton, FL, 2009.

See Also

princomp

Examples

1
2
data(glass)
res <- nipals(glass,a=2)

Example output

Loading required package: rpart
actual precision:  36.75712 
actual precision:  14.58468 
actual precision:  6.270316 
actual precision:  2.651907 
actual precision:  1.116924 
actual precision:  0.4700405 
actual precision:  0.1977798 
actual precision:  0.08321793 
actual precision:  0.03501465 
actual precision:  0.0147327 

WARNING! Iteration stop in h= 1  without convergence!

actual precision:  24.90411 
actual precision:  4.770043 
actual precision:  1.23193 
actual precision:  0.3192441 
actual precision:  0.08275297 
actual precision:  0.02145126 
actual precision:  0.005560609 
actual precision:  0.001441425 
actual precision:  0.0003736473 
actual precision:  9.685712e-05 

chemometrics documentation built on May 1, 2019, 7:58 p.m.