Partial least-squares regression evalutaion
15 views (last 30 days)
Show older comments
Hi
I am new to PLSR and I went throguh several literature that indicate the eqution of Y=BX+E as the PLSR eqution.
I am trying to use :[XL,YL,XS,YS] = plsregress(X,Y,ncomp) but I cannot match the output with the general form of eqution.
From the matlab description I could figure out the B=XL and I guess that YL should be a coefficient for Y, but I am not sure about neither YL nor XS,YS.
Can anyone help me with explaning how to match them?
and also how can I use them to predict other values?
Thanks
0 Comments
Accepted Answer
Vladimir Sovkov
on 6 Feb 2020
Edited: Vladimir Sovkov
on 6 Feb 2020
The equation considered in PLS of Matlab is rather
Y = X(:,:)*B(2:end,:) + repmat( B(1,:),n,1 ) + E,
where:
X is an n-by-p matrix of predictor variables: in analitical chemistry this can be experimentlal data (e.g., spectroscopic measurements), every row of which contains the full set of measurements dealing with one "standard sample"; p measurements (predictors) for each of n samples;
Y is an n-by-m response matrix (sometimes called "scores"), every row of which contains known values of responces (e.g. concentrations of some elements) in the corresponding "standard sample"; m "concentrations" (responces) for each of n samples;
B is the (p+1)-by-m matrix of coefficients ("loadings") to compute scores ("concentrations") from predictors ("spectra"); its 1st row presents intercepts.
E is unknown noise (is not used further on at all, introduced by some authors for a better undestanding of physics).
Matlab command:
[XL,YL,XS,YS,B,PCTVAR,MSE] = plsregress(X,Y,ncomp)
For predicting "concentrations" from new "spectroscopic data", only B is needed.
To understand other output, you should get deeper into the theory of PLS, which is hard to explain in a few words.
Many of those outputs serve the purpose of finding the appropriate number ncomp of components, but you can just estimate the quality of the approximation with different ncomp directly via the initial equation.
When you already understand the PLS method, you can address the Matlab documentation to deciper their designations; it also contains an example, which is able to make the things clearer.
2 Comments
Vladimir Sovkov
on 7 Feb 2020
Edited: Vladimir Sovkov
on 7 Feb 2020
(1)
Matlab documentation states that XL = (XS\X0)' = X0'*XS, YL = (XS\Y0)' = Y0'*XS
where X0 and Y0 are the centered versions of X and Y : X0 = X - mean(X,1); Y0 = Y - mean(Y,1).
Hence, approximately (i.e., via separating out some noisy components): X0 ~= XS*XL', Y0 ~= XS*YL'
The last equation looks similar to your Y=TQ+E with T=XS, Q=YL' and Y -> Y0.
Factually, Y ~= XS*YL' + mean(Y,1)
(2)
Yes, Y_new=X_new*B(2:end,:) + repmat( B(1,:),n,1 ) = [ones(n,1),X_new]*B
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!