IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Meta.Numerics.Statistics.PrincipalComponentAnalysis Class Reference

Represents a principal component analysis. More...

Public Member Functions

int MinimumDimension (double P)
 Gets the minimum number of principal components that must be included to explain the given fraction of the total variance. More...
 
PrincipalComponent Component (int componentIndex)
 Gets the requested principal component. More...
 
MultivariateSample TransformedSample ()
 Represents the original data in terms of principal components. More...
 

Properties

int Dimension [get]
 Gets the number of components. More...
 
int Count [get]
 Gets the number of data entries. More...
 

Private Attributes

int cols
 
double[] wStore
 
double[] vStore
 

Detailed Description

Represents a principal component analysis.

Principal component analysis (PCA) is a form of factor analysis. It attempts to identify a small number number of factors such that, by specifing only values of these few factors for each row, the value of each variable can be accurately predicted.

Mathematically, PCA constructs an alternative set of orthonormal basis vectors for a multi-variate data set. These basis vectors, called principal components, are ordered by the total variance explained by each.

Suppose, for example, you measure the value of different possessions possessions for a sample of people: home value, car value, furniture value, etc. You might expect that much of the variation in these numbers can be explained by one underlying factor, which you might call "richness". If this is true, then a PCA analysis will show that the most principal component explains a very large faction of the total variance, and the other less principal components will explain only small fractions of the total variance.

Note that PCA is not invariant with respect to the re-scaling of individual variables.

Note that PCA is an exploratory technique, not a hypothesis test.

Member Function Documentation

int Meta.Numerics.Statistics.PrincipalComponentAnalysis.MinimumDimension ( double  P)
inline

Gets the minimum number of principal components that must be included to explain the given fraction of the total variance.

Parameters
PThe fraction of the variance to explain, which must lie between zero and one.
Returns
The required number of components.
PrincipalComponent Meta.Numerics.Statistics.PrincipalComponentAnalysis.Component ( int  componentIndex)
inline

Gets the requested principal component.

Parameters
componentIndexThe (zero-based) index of the principal component.
Returns
The requested principal component.

Principal components are ordered by strength. The most principal component, i.e. the component which explains the most variance, has index zero. The least principal component has the highest index.

Exceptions
ArgumentOutOfRangeExceptioncomponentIndex lies outside the range [0, Dimension-1].

Referenced by Test.RectangularMatrixTest.PC(), and Test.MultivariateSampleTest.PrincipalComponentAnalysis().

MultivariateSample Meta.Numerics.Statistics.PrincipalComponentAnalysis.TransformedSample ( )
inline

Represents the original data in terms of principal components.

Returns
A multivariate sample whose columns are the weights of each principal component in each entry of the originally analyzed sample.

References Meta.Numerics.Statistics.MultivariateSample.Add().

Referenced by Test.RectangularMatrixTest.PC(), and Test.MultivariateSampleTest.PrincipalComponentAnalysis().

Member Data Documentation

int Meta.Numerics.Statistics.PrincipalComponentAnalysis.cols
private
double [] Meta.Numerics.Statistics.PrincipalComponentAnalysis.wStore
private
double [] Meta.Numerics.Statistics.PrincipalComponentAnalysis.vStore
private

Property Documentation

int Meta.Numerics.Statistics.PrincipalComponentAnalysis.Dimension
get

Gets the number of components.

The number of components is equal to the number of variables used in the analysis.

Referenced by Test.RectangularMatrixTest.PC(), and Test.MultivariateSampleTest.PrincipalComponentAnalysis().

int Meta.Numerics.Statistics.PrincipalComponentAnalysis.Count
get

The documentation for this class was generated from the following file: