Tsqmtx: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Jeremy
(Importing text file)
Line 7: Line 7:


:[tsqmat,tsqs] = tsqmtx(x,model)
:[tsqmat,tsqs] = tsqmtx(x,model)
:[tsqmat,tsqs] = tsqmtx(x,p,ssq)
:[tsqmat,tsqs] = tsqmtx(x,p,ssq)


Line 14: Line 13:
TSQMTX calculates the Hotelling's T<sup>2</sup> contributions for PCA.
TSQMTX calculates the Hotelling's T<sup>2</sup> contributions for PCA.


====INPUTS====
====Inputs====


* '''x''' = data matrix (class "double" or "dataset), and
* '''x''' = data matrix (class "double" or "dataset), and
Line 26: Line 25:
If a PCA model structure model is input, the loadings and variance captured table are extracted from the model. Additionally, the preprocessing from the model is applied to the data prior to estimating the scores. However, if the loadings p and variance captured table ssq are passed as inputs then the data must be preprocessed in a manner similar to the data used to calibrate the PCA model.
If a PCA model structure model is input, the loadings and variance captured table are extracted from the model. Additionally, the preprocessing from the model is applied to the data prior to estimating the scores. However, if the loadings p and variance captured table ssq are passed as inputs then the data must be preprocessed in a manner similar to the data used to calibrate the PCA model.


====OUTPUTS====
====Outputs====


* '''tsqmat''' = indivual variable contributions to Hotelling's T<sup>2</sup>, and
* '''tsqmat''' = indivual variable contributions to Hotelling's T<sup>2</sup>, and

Revision as of 17:35, 3 September 2008

Purpose

Calculates the Hotelling's T2 contributions for PCA.

Synopsis

[tsqmat,tsqs] = tsqmtx(x,model)
[tsqmat,tsqs] = tsqmtx(x,p,ssq)

Description

TSQMTX calculates the Hotelling's T2 contributions for PCA.

Inputs

  • x = data matrix (class "double" or "dataset), and
  • model = model structure returned from ANALYSIS or PCA, or
  • p = PCA loadings, and
  • ssq = variance captured table.

If a PCA model structure model is input, the loadings and variance captured table are extracted from the model. Additionally, the preprocessing from the model is applied to the data prior to estimating the scores. However, if the loadings p and variance captured table ssq are passed as inputs then the data must be preprocessed in a manner similar to the data used to calibrate the PCA model.

Outputs

  • tsqmat = indivual variable contributions to Hotelling's T2, and
  • tsqs = Hotelling's T2 for each sample.

ALGORITHM

If P is the loadings matrix and T is the scores matrix from the calibration data that had M samples, then S is a diagonal matrix defined as S = TTT/(M-1). For a new sample xnew (row vector that has been appropriately scaled) the T2 contribution tcon is calculated as tcon = xnewPS-1/2PT.

See Also

datahat, pca, pcr, pls