TMtxPCA Class

Header: Dew.Stats/StatTools.h · Cross-compiler
tObjectTMtxComponentTMtxPCA

class TMtxPCA : public TMtxComponent;

Performs Principle Component Analysis (PCA).

Principal Components Analysis - PCA - is a data analysis tool that is usually used to reduce the dimensionality (number of variables) of a large number of interrelated variables, while retaining as much of the information (variation) as possible. PCA calculates an uncorrelated set of variables (factors or PCs). These factors are ordered so that the first few retain most of the variation present in all of the original variables.

The PCA procedure is reduced to an eigenvalue-eigenvector problem. PCA routines perform a PCA on either a correlation or a covariance matrix. Data matrix can be either "raw" data or pre-calculated correlation/covariance matrix.

How to use TMtxPCA component?

  • Drop a TMtxPCA component on the form.
  • By setting the TMtxPCA::PCAMode property define whether PCA will use correlation or covariance matrix to calculate PCA.
  • Define the actual TMtxPCA::Data (by changing Data matrix values).
  • Call the TMtxPCA::Recalc method to calculate PCA results.

Results:

Constructors

NameDescription
TMtxPCA (2)

Destructors

NameDescription
~TMtxPCA

Properties

NameTypeDescription
AutoUpdateboolIf true then changing any of the TMtxPCA properties will trigger the TMtxPCA::Recalc method.
BlockAssignboolBlock streaming of specific properties when storing only a "template".
DataTMtx*Defines the data to be analyzed by PCA.
DirtyboolWhen any of the TMtxPCA properties changes, this property is automatically set to true.
EditorActiveboolReturns True, if the component editor is displayed.
EigValuesTVec*Returns the eigenvalues.
NameDewString
PCTMtx*Returns the principal components (PC).
PCAModeTPCAModePCA type.
ReferenceTReferenceList*Stores a list of components that have to be notified, when this component is destroyed.
TotalVarPctTVec*Returns the percentage of the total variation in the variables.
ZScoresTMtx*Returns the Z-Scores.

Methods

NameDescription
AllowStreamingReturns the negatated value of BlockAssign.
AssignAssign values of all published properties from Source.
AssignTemplateAssign values of "template-like" published properties from Source.
EditorClassTo be overriden in descendanr classses.
LoadFromStreamLoad the component from Src stream.
LoadTemplateFromFileLoad a template from file.
LoadTemplateFromStreamLoad a template from stream.
RecalcTriggers PCA recalculation.
ReferenceRemoved
ResetReset is called after loading the data from stream or file.
SaveTemplateToFileSave template to file.
SaveTemplateToStreamSave template to stream.
SaveToStreamSave the component to Dst stream.

Fields

NameTypeDescription
Tagintptr_t