bpp-core3
3.0.0
|
This class allows to perform a correspondence analysis. More...
#include <Bpp/Numeric/Stat/Mva/CorrespondenceAnalysis.h>
Public Member Functions | |
CorrespondenceAnalysis (const Matrix< double > &data, unsigned int nbAxes, double tol=0.0000001, bool verbose=true) | |
Build a new CorrespondenceAnalysis object. More... | |
virtual | ~CorrespondenceAnalysis () |
CorrespondenceAnalysis * | clone () const |
Create a copy of this object and send a pointer to it. More... | |
double | getSumOfAllValues () const |
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) |
Set the data and perform computations. More... | |
std::vector< double > | computeVariancePercentagePerAxis () |
size_t | getNbOfKeptAxes () const |
const std::vector< double > | getRowWeights () const |
const std::vector< double > | getColumnWeights () const |
const std::vector< double > & | getEigenValues () const |
const RowMatrix< double > & | getRowCoordinates () const |
const RowMatrix< double > & | getColCoordinates () const |
const RowMatrix< double > & | getPrincipalAxes () const |
const RowMatrix< double > & | getPrincipalComponents () const |
Private Member Functions | |
void | check_ (const Matrix< double > &matrix, const std::vector< double > &rowWeights, const std::vector< double > &colWeights, unsigned int nbAxes) |
void | compute_ (const Matrix< double > &matrix, double tol, bool verbose) |
Private Attributes | |
double | n_ |
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_ |
This class allows to perform a correspondence analysis.
All values in the input table have to be non-negative. The DualityDiagram class, core class of a multivariate analysis, is called internally.
The code of this class is deeply inspired from the R code of the dudi.coa function available in the ade4 package.
Definition at line 59 of file CorrespondenceAnalysis.h.
CorrespondenceAnalysis::CorrespondenceAnalysis | ( | const Matrix< double > & | data, |
unsigned int | nbAxes, | ||
double | tol = 0.0000001 , |
||
bool | verbose = true |
||
) |
Build a new CorrespondenceAnalysis object.
data | The input data (a RowMatrix) to analyse. |
nbAxes | The number of kept axes during the analysis. |
tol | Tolerance threshold for null eigenvalues (a value less than tol times the first one is considered as null) |
verbose | Should warnings be dispayed. |
Exception | if an error occured. |
Definition at line 50 of file CorrespondenceAnalysis.cpp.
References bpp::Matrix< Scalar >::getNumberOfColumns(), bpp::Matrix< Scalar >::getNumberOfRows(), bpp::MatrixTools::hadamardMult(), n_, bpp::MatrixTools::scale(), and bpp::DualityDiagram::setData().
Referenced by clone().
|
inlinevirtual |
Definition at line 81 of file CorrespondenceAnalysis.h.
|
privateinherited |
Definition at line 71 of file DualityDiagram.cpp.
References bpp::Matrix< Scalar >::getNumberOfColumns(), and bpp::Matrix< Scalar >::getNumberOfRows().
Referenced by bpp::DualityDiagram::DualityDiagram(), and bpp::DualityDiagram::setData().
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::Clonable.
Definition at line 83 of file CorrespondenceAnalysis.h.
References CorrespondenceAnalysis().
|
privateinherited |
Definition at line 115 of file DualityDiagram.cpp.
References bpp::DualityDiagram::colCoord_, bpp::DualityDiagram::colWeights_, bpp::ApplicationTools::displayWarning(), bpp::DualityDiagram::eigenValues_, bpp::DualityDiagram::eigenVectors_, bpp::RowMatrix< Scalar >::getNumberOfColumns(), bpp::Matrix< Scalar >::getNumberOfColumns(), bpp::RowMatrix< Scalar >::getNumberOfRows(), bpp::Matrix< Scalar >::getNumberOfRows(), bpp::EigenValue< Real >::getRealEigenValues(), bpp::EigenValue< Real >::getV(), bpp::MatrixTools::hadamardMult(), bpp::EigenValue< Real >::isSymmetric(), bpp::MatrixTools::mult(), bpp::DualityDiagram::nbAxes_, bpp::DualityDiagram::ppalAxes_, bpp::DualityDiagram::ppalComponents_, bpp::RowMatrix< Scalar >::resize(), bpp::DualityDiagram::rowCoord_, bpp::DualityDiagram::rowWeights_, and bpp::MatrixTools::transpose().
Referenced by bpp::DualityDiagram::DualityDiagram(), and bpp::DualityDiagram::setData().
|
inherited |
|
inlineinherited |
Definition at line 146 of file DualityDiagram.h.
References bpp::DualityDiagram::colCoord_.
|
inlineinherited |
Definition at line 143 of file DualityDiagram.h.
References bpp::DualityDiagram::colWeights_.
|
inlineinherited |
Definition at line 144 of file DualityDiagram.h.
References bpp::DualityDiagram::eigenValues_.
|
inlineinherited |
Definition at line 141 of file DualityDiagram.h.
References bpp::DualityDiagram::nbAxes_.
|
inlineinherited |
Definition at line 147 of file DualityDiagram.h.
References bpp::DualityDiagram::ppalAxes_.
|
inlineinherited |
Definition at line 148 of file DualityDiagram.h.
References bpp::DualityDiagram::ppalComponents_.
|
inlineinherited |
Definition at line 145 of file DualityDiagram.h.
References bpp::DualityDiagram::rowCoord_.
|
inlineinherited |
Definition at line 142 of file DualityDiagram.h.
References bpp::DualityDiagram::rowWeights_.
|
inline |
Definition at line 86 of file CorrespondenceAnalysis.h.
References n_.
|
inherited |
Set the data and perform computations.
matrix | The input data to analyse. |
rowWeights | A vector of values specifying the weights of rows. |
colWeights | A vector of values specifying the weights of columns. |
nbAxes | The number of kept axes during the analysis. |
tol | Tolerance threshold for null eigenvalues (a value less than tol times the first one is considered as null) |
verbose | Should warnings be dispayed. |
Exception | if an error occured. |
Definition at line 101 of file DualityDiagram.cpp.
References bpp::DualityDiagram::check_(), bpp::DualityDiagram::colWeights_, bpp::DualityDiagram::compute_(), bpp::DualityDiagram::nbAxes_, and bpp::DualityDiagram::rowWeights_.
Referenced by CorrespondenceAnalysis(), and bpp::PrincipalComponentAnalysis::PrincipalComponentAnalysis().
|
privateinherited |
Definition at line 68 of file DualityDiagram.h.
Referenced by bpp::DualityDiagram::compute_(), and bpp::DualityDiagram::getColCoordinates().
|
privateinherited |
Definition at line 63 of file DualityDiagram.h.
Referenced by bpp::DualityDiagram::compute_(), bpp::DualityDiagram::getColumnWeights(), and bpp::DualityDiagram::setData().
|
privateinherited |
Definition at line 65 of file DualityDiagram.h.
Referenced by bpp::DualityDiagram::compute_(), and bpp::DualityDiagram::getEigenValues().
|
privateinherited |
Definition at line 66 of file DualityDiagram.h.
Referenced by bpp::DualityDiagram::compute_().
|
private |
Definition at line 63 of file CorrespondenceAnalysis.h.
Referenced by CorrespondenceAnalysis(), and getSumOfAllValues().
|
privateinherited |
Definition at line 64 of file DualityDiagram.h.
Referenced by bpp::DualityDiagram::compute_(), bpp::DualityDiagram::getNbOfKeptAxes(), and bpp::DualityDiagram::setData().
|
privateinherited |
Definition at line 69 of file DualityDiagram.h.
Referenced by bpp::DualityDiagram::compute_(), and bpp::DualityDiagram::getPrincipalAxes().
|
privateinherited |
Definition at line 70 of file DualityDiagram.h.
Referenced by bpp::DualityDiagram::compute_(), and bpp::DualityDiagram::getPrincipalComponents().
|
privateinherited |
Definition at line 67 of file DualityDiagram.h.
Referenced by bpp::DualityDiagram::compute_(), and bpp::DualityDiagram::getRowCoordinates().
|
privateinherited |
Definition at line 62 of file DualityDiagram.h.
Referenced by bpp::DualityDiagram::compute_(), bpp::DualityDiagram::getRowWeights(), and bpp::DualityDiagram::setData().