Datahat: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Neal
No edit summary
Line 1: Line 1:
===Purpose===
===Purpose===


Line 11: Line 10:
===Description===
===Description===


Given a standard model structure model DATAHAT computes the model estimate of the data xhat. For example, if model is a PCA model of a matrix '''X'''<sub>cal</sub> such that '''X'''<sub>cal</sub> = '''TP'''<sup>T</sup> + '''E''', then '''X'''<sub>hat</sub> = '''TP'''<sup>T</sup>. (i.e. '''X'''<sub>cal</sub> = '''TP'''<sup>T</sup> + '''E''' = '''X'''<sub>hat</sub> + '''E''').
Given a standard model structure (model), DATAHAT computes the model estimate of the data (xhat). For example, if (model) is a PCA model of a matrix '''X'''<sub>cal</sub> such that '''X'''<sub>cal</sub> = '''TP'''<sup>T</sup> + '''E''', then '''X'''<sub>hat</sub> = '''TP'''<sup>T</sup> i.e., '''X'''<sub>cal</sub> = '''TP'''<sup>T</sup> + '''E''' = '''X'''<sub>hat</sub> + '''E''').
 
 
If optional input (''data'') is supplied then DATAHAT computes the model estimate of (''data'') that is output in (xhat). For the PCA model of matrix '''X'''<sub>cal</sub>, and (''data'') is a data matrix '''X'''<sub>new</sub> then '''X'''<sub>hat</sub> = '''X'''<sub>new</sub>'''PP'''<sup>T</sup> = '''T'''<sub>new</sub>'''P'''<sup>T</sup>. The output (resids) is a matrix with the corresponding residuals '''E''' = '''X'''<sub>new</sub>-'''X'''<sub>new</sub>'''PP'''<sup>T</sup> = '''X'''<sub>new</sub>('''I'''-'''PP'''<sup>T</sup>). If (''data'') is '''X'''<sub>cal</sub> then '''X'''<sub>hat</sub> = '''TP'''<sup>T</sup> and resids is '''E''' = '''X'''<sub>cal</sub>('''I'''-'''PP'''<sup>T</sup>).


If optional input ''data'' is supplied then DATAHAT computes the model estimate of ''data'' that is output in xhat. For the PCA model of matrix '''X'''<sub>cal</sub>, and ''data'' is a data matrix '''X'''<sub>new</sub> then '''X'''<sub>hat</sub> = '''X'''<sub>new</sub>'''PP'''<sup>T</sup> = '''T'''<sub>new</sub>'''P'''<sup>T</sup>. The output resids is a matrix with the corresponding residuals '''E''' ['''E''' = '''X'''<sub>new</sub>-'''X'''<sub>new</sub>'''PP'''<sup>T</sup> = '''X'''<sub>new</sub>('''I'''-'''PP'''<sup>T</sup>)]. If ''data'' is '''X'''<sub>cal</sub> then '''X'''<sub>hat</sub> = '''TP'''<sup>T</sup> and resids is '''E''' = '''X'''<sub>cal</sub>('''I'''-'''PP'''<sup>T</sup>)].


Note that preprocessing in model will be performed before the residuals are calculated. If data is not provided, only xhat is available.
Note that preprocessing in (model) will be performed before the residuals are calculated. If data is not provided, only (xhat) of the calibration data is available.


Note that DATAHAT works with almost all standard model structures.
Note that DATAHAT works with almost all standard model structures.

Revision as of 16:12, 7 October 2008

Purpose

Calculates the model estimate and residuals of the data.

Synopsis

xhat = datahat(model);
[xhat,resids] = datahat(model,data);

Description

Given a standard model structure (model), DATAHAT computes the model estimate of the data (xhat). For example, if (model) is a PCA model of a matrix Xcal such that Xcal = TPT + E, then Xhat = TPT i.e., Xcal = TPT + E = Xhat + E).


If optional input (data) is supplied then DATAHAT computes the model estimate of (data) that is output in (xhat). For the PCA model of matrix Xcal, and (data) is a data matrix Xnew then Xhat = XnewPPT = TnewPT. The output (resids) is a matrix with the corresponding residuals E = Xnew-XnewPPT = Xnew(I-PPT). If (data) is Xcal then Xhat = TPT and resids is E = Xcal(I-PPT).


Note that preprocessing in (model) will be performed before the residuals are calculated. If data is not provided, only (xhat) of the calibration data is available.

Note that DATAHAT works with almost all standard model structures.

See Also

analysis, parafac