R/pls_eigen.R

Defines functions pls_eigen

Documented in pls_eigen

pls_eigen <-
function(X,Y,a){

# Eigenvector method for PLS

X <- as.matrix(X)
Y <- as.matrix(Y)
P=eigen(t(X)%*%Y%*%t(Y)%*%X)$vectors[,1:a]
T=X%*%P
Q=eigen(t(Y)%*%X%*%t(X)%*%Y)$vectors[,1:a]
U=Y%*%Q

list(P=P,T=T,Q=Q,U=U)
}

Try the chemometrics package in your browser

Any scripts or data that you put into this service are public.

chemometrics documentation built on May 29, 2017, 10:42 a.m.