bpp-core  2.1.0
bpp::DualityDiagram Class Reference

The core class of a multivariate analysis. More...

#include <Bpp/Numeric/Stat/Mva/DualityDiagram.h>

+ Inheritance diagram for bpp::DualityDiagram:
+ Collaboration diagram for bpp::DualityDiagram:

List of all members.

Public Member Functions

 DualityDiagram ()
 Build an empty DualityDiagram object.
 DualityDiagram (const Matrix< double > &matrix, const std::vector< double > &rowWeights, const std::vector< double > &colWeights, unsigned int nbAxes, double tol=0.0000001, bool verbose=true) throw (Exception)
 Build a new DualityDiagram object.
virtual ~DualityDiagram ()
DualityDiagramclone () const
 Create a copy of this object and send a pointer to it.
void setData (const Matrix< double > &matrix, const std::vector< double > &rowWeights, const std::vector< double > &colWeights, unsigned int nbAxes, double tol=0.0000001, bool verbose=true) throw (Exception)
 Set the data and perform computations.
std::vector< double > computeVariancePercentagePerAxis () throw (Exception)
size_t getNbOfKeptAxes () const throw (Exception)
const std::vector< double > getRowWeights () const throw (Exception)
const std::vector< double > getColumnWeights () const throw (Exception)
const std::vector< double > & getEigenValues () const throw (Exception)
const RowMatrix< double > & getRowCoordinates () const throw (Exception)
const RowMatrix< double > & getColCoordinates () const throw (Exception)
const RowMatrix< double > & getPrincipalAxes () const throw (Exception)
const RowMatrix< double > & getPrincipalComponents () const throw (Exception)

Private Member Functions

void check_ (const Matrix< double > &matrix, const std::vector< double > &rowWeights, const std::vector< double > &colWeights, unsigned int nbAxes) throw (Exception)
void compute_ (const Matrix< double > &matrix, double tol, bool verbose)

Private Attributes

std::vector< double > rowWeights_
std::vector< double > colWeights_
size_t nbAxes_
std::vector< double > eigenValues_
RowMatrix< double > eigenVectors_
RowMatrix< double > rowCoord_
RowMatrix< double > colCoord_
RowMatrix< double > ppalAxes_
RowMatrix< double > ppalComponents_

Detailed Description

The core class of a multivariate analysis.

In the constructor, the eigen values and vectors of the variance-covariance or correlation matrix are calculated. Eigen values and vectors are stored in the eigenValues_ and eigenVectors_ respectively. Furthermore, four matrices are calculated: the row and column coordinates as well as the principal axes and components.

The code of this class is deeply inspired from the R code of the as.dudi function available in the ade4 package.

Definition at line 57 of file DualityDiagram.h.


Constructor & Destructor Documentation

Build an empty DualityDiagram object.

Definition at line 77 of file DualityDiagram.h.

Referenced by clone().

DualityDiagram::DualityDiagram ( const Matrix< double > &  matrix,
const std::vector< double > &  rowWeights,
const std::vector< double > &  colWeights,
unsigned int  nbAxes,
double  tol = 0.0000001,
bool  verbose = true 
) throw (Exception)

Build a new DualityDiagram object.

Parameters:
matrixThe input data to analyse.
rowWeightsA vector of values specifying the weights of rows.
colWeightsA vector of values specifying the weights of columns.
nbAxesThe number of kept axes during the analysis.
tolTolerance threshold for null eigenvalues (a value less than tol times the first one is considered as null)
verboseShould warnings be dispayed.
Exceptions:
Exceptionif an error occured.

Definition at line 50 of file DualityDiagram.cpp.

Definition at line 288 of file DualityDiagram.cpp.


Member Function Documentation

void DualityDiagram::check_ ( const Matrix< double > &  matrix,
const std::vector< double > &  rowWeights,
const std::vector< double > &  colWeights,
unsigned int  nbAxes 
) throw (Exception) [private]

Definition at line 70 of file DualityDiagram.cpp.

DualityDiagram* bpp::DualityDiagram::clone ( ) const [inline, virtual]

Create a copy of this object and send a pointer to it.

Returns:
A pointer toward the copy object.

Implements bpp::Clonable.

Reimplemented in bpp::PrincipalComponentAnalysis, and bpp::CorrespondenceAnalysis.

Definition at line 114 of file DualityDiagram.h.

References DualityDiagram().

const RowMatrix<double>& bpp::DualityDiagram::getColCoordinates ( ) const throw (Exception) [inline]

Definition at line 151 of file DualityDiagram.h.

References colCoord_.

const std::vector<double> bpp::DualityDiagram::getColumnWeights ( ) const throw (Exception) [inline]

Definition at line 148 of file DualityDiagram.h.

References colWeights_.

const std::vector<double>& bpp::DualityDiagram::getEigenValues ( ) const throw (Exception) [inline]

Definition at line 149 of file DualityDiagram.h.

References eigenValues_.

size_t bpp::DualityDiagram::getNbOfKeptAxes ( ) const throw (Exception) [inline]

Definition at line 146 of file DualityDiagram.h.

References nbAxes_.

const RowMatrix<double>& bpp::DualityDiagram::getPrincipalAxes ( ) const throw (Exception) [inline]

Definition at line 152 of file DualityDiagram.h.

References ppalAxes_.

const RowMatrix<double>& bpp::DualityDiagram::getPrincipalComponents ( ) const throw (Exception) [inline]

Definition at line 153 of file DualityDiagram.h.

References ppalComponents_.

const RowMatrix<double>& bpp::DualityDiagram::getRowCoordinates ( ) const throw (Exception) [inline]

Definition at line 150 of file DualityDiagram.h.

References rowCoord_.

const std::vector<double> bpp::DualityDiagram::getRowWeights ( ) const throw (Exception) [inline]

Definition at line 147 of file DualityDiagram.h.

References rowWeights_.

void DualityDiagram::setData ( const Matrix< double > &  matrix,
const std::vector< double > &  rowWeights,
const std::vector< double > &  colWeights,
unsigned int  nbAxes,
double  tol = 0.0000001,
bool  verbose = true 
) throw (Exception)

Set the data and perform computations.

Parameters:
matrixThe input data to analyse.
rowWeightsA vector of values specifying the weights of rows.
colWeightsA vector of values specifying the weights of columns.
nbAxesThe number of kept axes during the analysis.
tolTolerance threshold for null eigenvalues (a value less than tol times the first one is considered as null)
verboseShould warnings be dispayed.
Exceptions:
Exceptionif an error occured.

Definition at line 100 of file DualityDiagram.cpp.


Member Data Documentation

Definition at line 68 of file DualityDiagram.h.

Referenced by getColCoordinates().

std::vector<double> bpp::DualityDiagram::colWeights_ [private]

Definition at line 63 of file DualityDiagram.h.

Referenced by getColumnWeights().

std::vector<double> bpp::DualityDiagram::eigenValues_ [private]

Definition at line 65 of file DualityDiagram.h.

Referenced by getEigenValues().

Definition at line 66 of file DualityDiagram.h.

size_t bpp::DualityDiagram::nbAxes_ [private]

Definition at line 64 of file DualityDiagram.h.

Referenced by getNbOfKeptAxes().

Definition at line 69 of file DualityDiagram.h.

Referenced by getPrincipalAxes().

Definition at line 70 of file DualityDiagram.h.

Referenced by getPrincipalComponents().

Definition at line 67 of file DualityDiagram.h.

Referenced by getRowCoordinates().

std::vector<double> bpp::DualityDiagram::rowWeights_ [private]

Definition at line 62 of file DualityDiagram.h.

Referenced by getRowWeights().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends