You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Classes > TMtxPCA Class
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
TMtxPCA Class

Performs Principle Component Analysis (PCA).

Dew_Stats_TMtxPCA
Syntax
C#
Visual Basic
public class TMtxPCA : TMtxComponent;

StatTools.cs

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?  

  1. Drop a TMtxPCA component on the form.
  2. By setting the crefPCAMode property define whether PCA will use correlation or covariance matrix to calculate PCA.
  3. Define the actual crefData (by changing Data matrix values).
  4. Call the crefRecalc method to calculate PCA results.

Results:

  1. crefEigValues - Data eigenvalues
  2. crefPC - Data eigenvectors
  3. crefTotalVarPct - the percentage of the total variation in the variables (columns)
  4. crefZScores - Z-Scores (eigenvectors in PC space).

An example how to setup TMtxPCA component:

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 = TPCAMode.PCARawData; // using data matrix to evaluate PCA MtxPCA1.Recalc(); // force recalculation // ... } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!