nipals: nipals

View source: R/nipals.R

nipalsR Documentation

nipals

Description

Nipals to compute the first score and loading vectors of a matrix.

Usage

nipals(X, tol = 1e-6, maxit = 100)

Arguments

X

Datamatrix (n, p).

tol

Tolerance for testing convergence of the NIPALS iterations for each PC.

maxit

Maximum number of NIPALS iterations for each PC.

Value

u

left singular vector (u * sv = scores).

v

right singular vector (loadings).

sv

singular value.

References

K.R. Gabriel, S. Zamir, Lower rank approximation of matrices by least squares with any choice of weights, Technometrics 21 (1979) 489–498.

Examples


n <- 8 ; p <- 6
X <- matrix(rnorm(n * p, mean = 10), ncol = p, byrow = TRUE)
nipals(X)


rchemo documentation built on June 30, 2026, 5:10 p.m.