We have seen how the scores and loadings are calculated when developing a PLS regression, but what about the Weights?.
To calculate the X scores and the loadings we need the weights, and in particular the first one (to start all the process), after this calculation the scores are calculated as projections of the spectra on the weights, and after the scores are calculated we calculate the loadings.
The first weight is calculated a the Singular Value Decomposition of the cross product of X centered and transposed and Y, beeing X the spectra matrix and Y the constituent matrix.
When we do this we get (as we saw in other posts): "u", "d" and "v".
The first weight are the values in "u".
Xt<-t(X_msc_centered[odd,]) #100.327
Y<-as.matrix(Prot[odd,]) #327.1
Xt.Y<-Xt%*%Y #100.1
svd.XtY<-svd(Xt.Y)
dim(svd.XtY$d)
dim(svd.XtY$u) #100.1
plot(svd.XtY$u)
par(new=TRUE)
plot(Xodd_pls3_w1,type="l",col="red",lwd=2)
We continue in next post with the reconstruction of all the PLS process.
No hay comentarios:
Publicar un comentario