Tconcalc: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Donal
imported>Donal
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===


Calculate Hotelling's T<sup>2</sup> contributions for predictions on orthogonal models.
Calculate Hotelling's T<sup>2</sup> contributions for predictions on orthogonal models.
If the input (model) is a PCA model structure then p = model.loads{2} and the output contributions (tcon) and T<sup>2</sup> (tsqs) are calculated for a row vector x [e.g., a row of input (newx)] as
If the input (model) is a PCA model structure then p = model.loads{2} and the output contributions (tcon) and T<sup>2</sup> (tsqs) are calculated for a row vector x [e.g., a row of input (newx)] as


Line 9: Line 9:
===Synopsis===
===Synopsis===


:tcon = tconcalc(newx,model)
:[tcon,tsqs] = tconcalc(newx,model)
:tcon = tconcalc(pred,model)
:[tcon,tsqs] = tconcalc(pred,model)
:tcon = tconcalc(model)
:[tcon,tsqs] = tconcalc(model)
:[tcon,tsqs] = tconcalc(newx,p,ssq)


===Description===
===Description===


Inputs are the new data <tt>newx</tt> and the 2-way PCA or regression model for which T<sup>2</sup> contributions should be calculated <tt>model</tt>. Alternatively, the prediction structure <tt>pred</tt> calculated with new data can be used in place of the new data itself or both can be omitted (passing <tt>model</tt> only) to get T<sup>2</sup> contributions for the calibration data.
Inputs are the new data <tt>newx</tt> and the 2-way PCA or regression model for which T<sup>2</sup> contributions should be calculated <tt>model</tt>. Alternatively, the prediction structure <tt>pred</tt> calculated with new data can be used in place of the new data itself or both can be omitted (passing <tt>model</tt> only) to get T<sup>2</sup> contributions for the calibration data.
====Inputs====
* '''newx''' = new X-block class "double" or "dataset"
* '''model''' =  2-way PCA or regression model for which T2 contributions are to be calculated.
* '''pred''' = prediction structure calculated for the new data.
* '''p''' = PCA loadings
* '''ssq''' = variance table (ssq). See PCA for more information. Note: For this I/O the data matrix (newx) must be scaled in a similar manner to the data used to determine the loadings (p).
====Outputs====
* '''tcon''' =  T^2 contributions.
* '''tsqs''' = Hotelling's T^2.


===See Also===
===See Also===


[[datahat]], [[pca]], [[pcr]], [[pls]], [[qconcalc]]
[[datahat]], [[pca]], [[pcr]], [[pls]], [[qconcalc]]

Latest revision as of 10:56, 6 March 2013

Purpose

Calculate Hotelling's T2 contributions for predictions on orthogonal models. If the input (model) is a PCA model structure then p = model.loads{2} and the output contributions (tcon) and T2 (tsqs) are calculated for a row vector x [e.g., a row of input (newx)] as

    tcon = x*p*sqrt(inv(s))*p';
    tsqs = tcon*tcon';

Synopsis

[tcon,tsqs] = tconcalc(newx,model)
[tcon,tsqs] = tconcalc(pred,model)
[tcon,tsqs] = tconcalc(model)
[tcon,tsqs] = tconcalc(newx,p,ssq)

Description

Inputs are the new data newx and the 2-way PCA or regression model for which T2 contributions should be calculated model. Alternatively, the prediction structure pred calculated with new data can be used in place of the new data itself or both can be omitted (passing model only) to get T2 contributions for the calibration data.

Inputs

  • newx = new X-block class "double" or "dataset"
  • model = 2-way PCA or regression model for which T2 contributions are to be calculated.
  • pred = prediction structure calculated for the new data.
  • p = PCA loadings
  • ssq = variance table (ssq). See PCA for more information. Note: For this I/O the data matrix (newx) must be scaled in a similar manner to the data used to determine the loadings (p).

Outputs

  • tcon = T^2 contributions.
  • tsqs = Hotelling's T^2.

See Also

datahat, pca, pcr, pls, qconcalc