inline CDVector& EigenValues()
- Returns the eigen values in vector form
inline const CDVector& EigenValues() const
- Returns the eigen values in const vector form
inline const CDVector& EigenValuesOrg() const
- Returns the orignal eigen values in const vector form
inline CDMatrix& EigenVectors()
- Returns the eigen vectors in matrix form
inline const CDMatrix& EigenVectors() const
- Returns the eigen vectors in const matrix form
inline int NParameters() const
- Returns the number of princal parameters
inline int NParametersOrg() const
- Returns the number of princal parameters before any truncation
void ClearDataItems()
- Deletes the data matrix
const int NDataItems() const
- Returns the number of data items this basis is based on
double ParameterWeight( const int i, bool asPercentage ) const
-
Returns the eigenvalue of the i-th parameter in absolute
numbers or as percentage.
- Returns:
- The eigenvalue.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-17-2000
- See Also:
- ParameterWeightOrg
double ParameterWeightOrg( const int i, bool asPercentage ) const
-
Returns the eigenvalue of the i-th parameter in absolute
numbers or as percentage.
- Returns:
- The eigenvalue.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-17-2000
- See Also:
- ParameterWeightOrg
void InsertDataItem( const CDVector &v )
-
Inserts a data vector.
- Parameters:
- v - A data vector.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-17-2000
void UseIdentityTransformation()
-
Makes the object use an identity basis instead of PCA basis, i.e.
essentially a by-pass of this object.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-30-2002
void DoPCA( bool bWriteCoVarMarix )
-
Performs the principal component analysis on the data
items. Uses the Eckhart-Young theorem if necessary for
reduced memory and computational requirements.
- Parameters:
- bWriteCoVarMarix - If true the covariance matrix is written
to the current dir.
NOTE: Only in the case of more data items
than dimensions (samples).
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-17-2000
const CDVector& MeanDataItem() const
-
Returns the mean of all sample vectors.
- Returns:
- A mean vector.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-17-2000
void ToFile( FILE* fh ) const
-
Writes a PCA object to a binary file.
- Parameters:
- fh - File handle to binary file open for writing.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-18-2000
- See Also:
- FromFile
void FromFile( FILE* fh )
-
Reads a PCA object from a binary file.
- Parameters:
- fh - File handle to binary file open for reading.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-18-2000
- See Also:
- ToFile
void Dump( const char* szPath ) const
-
Debug method that provides a human readable
file dump of the object data.
- Parameters:
- szPath - Path including terminating backslash
where the data is dumped.
- Returns:
- Nothing.
@throws VisError
- Author:
- Mikkel B. Stegmann
- Version:
- 10-18-2000
void Deform( const CDVector ¶ms, CDVector &object ) const
-
Projects a set of PC scores to the original space.
- Parameters:
- params - PC scores, i.e. the model paramerisation.
object - Resulting projection into the original space, e.g. a shape.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 10-18-2000
double MahalanobisDistance( const CDVector ¶ms ) const
-
Returns the Mahalanobis distance of a set of PCA parameters.
- Parameters:
- params - A set of PCA parameters.
- Returns:
- The Mahalanobis distance.
- Author:
- Mikkel B. Stegmann
- Version:
- 6-11-2000
void ShuffleData()
-
Shuffle each dimension in all data items over all observations.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 7-17-2002
int TruncateParallel()
-
Truncate eigenvectors and eigenvalues using parallel analysis.
Also known as Horn's parallel analysis or Humphrey-Ilgen
parallel analysis.
Assumes the data items have not been cleared.
- Returns:
- The number of parameters in the truncated basis.
- Author:
- Mikkel B. Stegmann
- Version:
- 7-15-2002
- See Also:
- TruncateVar
int TruncateVar( const double retained_variance )
-
Truncate eigenvectors and eigenvalues to retain
'retained_variance'.
I.e. if retained_variance = .95 this function calculates how
many eigenvectors we need to explain 95% of the total
variation in the PCA training set.
- Parameters:
- retained_variance - Amount of variance to retain [0<x<1].
- Returns:
- The number of parameters in the truncated basis.
- Author:
- Mikkel B. Stegmann
- Version:
- 6-11-2000
int CalcNParam( const double retained_variance ) const
-
Calulates the needed number of parameters to retain
'retained_variance'. I.e. if
retained_variance = .95 then this function calculates how
many eigenvectors we need to explain 95% of the total
variation in the PCA training set.
Assumes that no eigenvalue cutoff has been done prior to the
call.
- Parameters:
- retained_variance - Amount of variance to retain [0<x<1].
- Returns:
- The number of model parameters.
- Author:
- Mikkel B. Stegmann
- Version:
- 6-5-2000
void Project( const CDVector &obs, CDVector ¶m ) const
-
Projects an observation into the PCA space.
Notice: Costly, due to the non-cached transpose
of the eigenvectors.
- Parameters:
- obs - Input observation.
param - Output model parameters of the (possibly truncated)
basis.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 3-6-2003
- See Also:
- BackProject, Filter
void BackProject( const CDVector ¶m, CDVector &synth_obs ) const
-
Back projects a set of PCA model parameters into the original space.
- Parameters:
- param - Input PCA model parameters.
synth_obs - Synthesized output observation.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 3-6-2003
- See Also:
- Project, Filter
void Filter( CDVector &obs ) const
-
Projects an observation into the PCA space and back.
Notice: Costly, due to the non-cached transpose
of the eigenvectors in the project call.
- Parameters:
- obs - Input observation.
- Returns:
- Nothing.
- Author:
- Mikkel B. Stegmann
- Version:
- 3-6-2003
- See Also:
- Project, BackProject