Faq how are T contributions calculated and Faq how are error bars calculated regression model: Difference between pages

From Eigenvector Research Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Lyle
No edit summary
 
imported>Lyle
No edit summary
 
Line 1: Line 1:
===Issue:===
===Issue:===


How are T-contributions calculated?
How are the error bars calculated for a regression model and can they be related to a confidence limit (confidence in the prediction)?  


===Possible Solutions:===
===Possible Solutions:===


In PCA, T-contributions represent how the original variables contribute to give each sample its T<sup>2</sup> value in a given model. They are calculated as if you are reconstructing the data (relative to the mean of the calibration data) except that each factor is first normalized by the variance it captured in the original data. This gives the reconstruction of the data as if all principal components captured equal amounts of variance in the original data. In other words: this is how the original variables project into the normalized multivariate space of the model.
The error bars reported for inverse least squares models (and from the [[Ils_esterror]] function) represent the estimation error for each prediction, see:


To calculate the T-contributions for a given sample in a PLS_Toolbox PCA model, use the tconcalc function. Given the sample's data in variable data and the model in variable model, the following will calculate T-contributions.
Faber, N.M. and Bro, R., Chemomem. and Intell. Syst., 61, 133-149 (2002)


  T_con = tconcalc(data,model);
They can be read as a standard deviation of the estimate. However because the underlying distribution is not clearly known (and is a matter of research), a confidence limit is not reported.


Note that if data is a matrix of all your data and you want only a single sample's T contributions, pass only that sample's row:


data(row_number,:)
'''Still having problems? Please contact our helpdesk at [mailto:helpdesk@eigenvector.com helpdesk@eigenvector.com]'''
 
'''Numerical Calculation Details'''
 
To calculate the T-contributions for the "i"th sample (T_con_i) in Matlab notation:  
 
T_con_i = t_i*L*U
 
where <code>t_i</code> is a row vector of the scores (size: 1 x k) for a given sample, <code>U</code> is the transposed matrix of loadings (size: n x k), and <code>L</code> is a diagonal matrix containing the inverse of the square root of the eigenvalues for the k components. For example, with a three PC model, <code>L</code> would be:
 
  1/λ<sub>1</sub><sup>1/2</sup>  0        0
  0      1/λ<sub>2</sub><sup>1/2</sup>  0
  0      0        1/λ<sub>3</sub><sup>1/2</sup>
 
 
Where <code>λ<sub>j</sub></code> is the eigenvalue for component <code>j</code>. Note the similarity of the T-contributions equation to data reconstruction:
 
T_con_i = t_i*L*U      %calculate T-contributions
x_hat_i = t_i*  U      %calculate data approx.
 
<code>x_hat_i</code> is data approximation for sample <code>i</code> (relative to the mean of the calibration data).
 
Putting all this together, you can calculate <code>T_con_i</code> by hand for a given sample in the calibration data used for a PLS_Toolbox PCA model using:
 
T    = model.loads{1};  %Grab scores (note: for all samples!)
t_i  = T(i,:);          %grab scores for one sample
U    = model.loads{2}';  %Grab loadings
ncomp = size(U,1);
L    = diag(1./sqrt(model.detail.ssq(1:ncomp,2)));
T_con_i = t_i*L*U;      %calculate T-contributions


[[Category:FAQ]]
[[Category:FAQ]]

Revision as of 12:07, 5 December 2018

Issue:

How are the error bars calculated for a regression model and can they be related to a confidence limit (confidence in the prediction)?

Possible Solutions:

The error bars reported for inverse least squares models (and from the Ils_esterror function) represent the estimation error for each prediction, see:

Faber, N.M. and Bro, R., Chemomem. and Intell. Syst., 61, 133-149 (2002)

They can be read as a standard deviation of the estimate. However because the underlying distribution is not clearly known (and is a matter of research), a confidence limit is not reported.


Still having problems? Please contact our helpdesk at helpdesk@eigenvector.com