Unit
StatTools
Hierarchy
TMtxPCA
Subclasses
None
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.
Results:
1) EigValues - Data eigenvalues
2) PC - Data eigenvectors
3) TotalVarPct - the percentage of the total variation in the variables (columns)
4) ZScores - Z-Scores (eigenvectors in PC space)
Uses StatTools, MtxVec, Statistics; procedure Example(MtxPCA1: TMtxPCA); begin // ... MtxPCA1.Data.SetIt(4,3,false,[1,2,3, 5,7,9, 1,11,13, 3,7,4]); MtxPCA1.PCAMode := PCACorrMat; // using correlation matrix to evaluate PCA MtxPCA1.DataFormat := DataFormatRaw; // raw data MtxPCA1.Recalc; // force recalculation // ... end;
#include "StatTools.hpp" #include "Statistics.hpp" void __fastcall Example (TMtxPCA* MtxPCA1) { // ... MtxPCA1->Data->SetIt(4,3,false,OPENARRAY(TSample, (1,2,3, 5,7,9, 1,11,13, 3,7,4))); MtxPCA1->PCAMode = PCACorrMat; // using correlation matrix to evaluate PCA MtxPCA1->DataFormat = DataFormatRaw; // raw data MtxPCA1->Recalc(); // force recalculation // ... }
using Dew.Stats; using Dew.Stats.Units; using Dew.Math; namespace Dew.Examples { private void Example(StatTools.TMtxPCA MtxPCA1) { // ... MtxPCA1.Data.SetIt(4,3,false,new double[] {1,2,3, 5,7,9, 1,11,13, 3,7,4}); MtxPCA1.PCAMode = StatTools.PCACorrMat; // using correlation matrix to evaluate PCA MtxPCA1.DataFormat = StatTools.DataFormatRaw; // raw data MtxPCA1.Recalc(); // force recalculation // ... } }
| Name | Summary |
|---|---|
| AutoUpdate | |
| Data | Defines the data to be analyzed by PCA. |
| DataFormat | Defines data format for Data matrix. |
| Dirty | |
| EigValues | Returns the eigenvalues. |
| PC | Returns the principal components (PC). |
| PCAMode | PCA type. |
| TotalVarPct | Returns the percentage of the total variation in the variables. |
| ZScores | Returns the Z-Scores. |
| Name | Summary |
|---|---|
| Loaded | |
| Recalc | Triggers PCA recalculation. |
| Copyright 2008 Dew Research |