rls {ENCA}R Documentation

Restricted least squares

Description

Function calculates P for mimimizing X-TP with restriction diag(PP') = 1, given a matrix T. For more information, see Westerhuis et al. (2007).

Usage

rls(X, T, P0)

Arguments

X

An I by J data matrix.

T

An I by Q matrix.

P0

An initial J by Q matrix.

Value

P

A matrix satisfying diag(PP') = 1

References

Westerhuis, JA, Derks, EPPA, Hoefsloot, HCJ, & Smilde, AK (2007). Grey component analysis. Journal of Chemometrics, 21 , 474-485.

Examples

#Load data and set input parameters
I=50
J=100
X=matrix(rnorm(I*J,0,1),nrow=I)
Q=5
P=matrix(rnorm(J*Q,0,1),nrow=J)
T=matrix(rnorm(I*Q,0,1),nrow=I)

# Run rls
p=rls(X,T,P)

[Package ENCA version 1.0 Index]