|
STK++ 1.0
|
Computation of the Multivariate Statistics of a 2D Container of Real. More...
#include <STK_Stat_MultivariateReal.h>

Public Member Functions | |
| Multivariate (TContainer2D const *p_data) | |
| Constructor. | |
| virtual | ~Multivariate () |
| virtual destructor. | |
| Integer const & | nbVar () const |
| get the number of variables | |
| Integer const & | nbSamples () const |
| get the umber of samples | |
| TContainerHo const & | mean () const |
| get the Vector of the mean | |
| TContainerHo const & | variance () const |
| get the vector of the variance of the Variables | |
| MatrixSquare const & | covariance () const |
| Matrix of the covariance of the variables. | |
| virtual bool | run () |
| run the estimation of the Multivariate statistics. | |
| virtual bool | run (TContainerVe const &weights) |
| run the estimation of the weighted multivariate statistics. | |
Protected Attributes | |
| Integer | nbSamples_ |
| number of samples | |
| Integer | nbVar_ |
| Number of variables. | |
| TContainerHo | mean_ |
| Vector of the mean of the Variables. | |
| TContainerHo | var_ |
| Vector of the variance of the variables. | |
| MatrixSquare | cov_ |
| Matrix of the covariance of the variables. | |
Private Types | |
| typedef IRunnerPtr2D< Real, TContainerHo, TContainerVe, TContainer2D > | Runner2D |
| type of runner | |
Computation of the Multivariate Statistics of a 2D Container of Real.
This partial specialization if the class Multivariate is just a factory class for computing the mean, the variance and the covariance Matrix of a p_data set stored in a TContainer2D with n rows (the samples) and p columns (the variables).
The p_data set will be copied as a reference of the original p_data set.
The p_data set can be weighted with a vector of weight.
Definition at line 69 of file STK_Stat_MultivariateReal.h.
typedef IRunnerPtr2D< Real, TContainerHo, TContainerVe, TContainer2D> STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::Runner2D [private] |
type of runner
Definition at line 72 of file STK_Stat_MultivariateReal.h.
| STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::Multivariate | ( | TContainer2D const * | p_data | ) | [inline] |
Constructor.
Compute the Multivariate statistics of the Matrix p_data set.
| p_data | the p_data set |
Definition at line 79 of file STK_Stat_MultivariateReal.h.
| virtual STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::~Multivariate | ( | ) | [inline, virtual] |
| Integer const& STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::nbVar | ( | ) | const [inline] |
get the number of variables
Definition at line 94 of file STK_Stat_MultivariateReal.h.
References STK::Stat::Multivariate< TYPE, TContainerHo, TContainerVe, TContainer2D >::nbVar_.
{return nbVar_;}
| Integer const& STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::nbSamples | ( | ) | const [inline] |
get the umber of samples
Definition at line 98 of file STK_Stat_MultivariateReal.h.
References STK::Stat::Multivariate< TYPE, TContainerHo, TContainerVe, TContainer2D >::nbSamples_.
{return nbSamples_;}
| TContainerHo const& STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::mean | ( | ) | const [inline] |
get the Vector of the mean
Definition at line 101 of file STK_Stat_MultivariateReal.h.
{ return mean_;}
| TContainerHo const& STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::variance | ( | ) | const [inline] |
get the vector of the variance of the Variables
Definition at line 105 of file STK_Stat_MultivariateReal.h.
{ return var_;}
| MatrixSquare const& STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::covariance | ( | ) | const [inline] |
Matrix of the covariance of the variables.
Definition at line 109 of file STK_Stat_MultivariateReal.h.
{ return cov_;}
| virtual bool STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::run | ( | ) | [inline, virtual] |
run the estimation of the Multivariate statistics.
Implements STK::IRunnerBase.
Definition at line 111 of file STK_Stat_MultivariateReal.h.
References STK::ITContainer2D< TYPE, TContainerHo, TContainerVe, TContainer2D >::col(), STK::Stat::covarianceWithFixedMean(), STK::IContainer2D::firstCol(), STK::IContainer2D::lastCol(), STK::Stat::mean(), STK::IRunnerPtr2D< TYPE, TContainerHo, TContainerVe, TContainer2D >::p_data_, and STK::Stat::varianceWithFixedMean().
{
// get dimensions
const Integer first = this->p_data_->firstCol(), last = this->p_data_->lastCol();
// for each variables
for (Integer j= first; j<= last; j++)
{
mean_[j] = Stat::mean(this->p_data_->col(j));
// compute the variance
var_[j] = varianceWithFixedMean(this->p_data_->col(j), mean_[j]);
cov_(j, j) = var_[j];
// compute the covariances
for (Integer i= first; i<j; i++)
{
cov_(i, j) = covarianceWithFixedMean(this->p_data_->col(i), this->p_data_->col(j), mean_[i], mean_[j]);
cov_(j, i) = cov_(i, j);
}
}
return true;
}
| virtual bool STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::run | ( | TContainerVe const & | weights | ) | [inline, virtual] |
run the estimation of the weighted multivariate statistics.
| weights | the weights of the samples |
Implements STK::IRunnerPtr2D< Real, TContainerHo, TContainerVe, TContainer2D >.
Definition at line 135 of file STK_Stat_MultivariateReal.h.
References STK::ITContainer2D< TYPE, TContainerHo, TContainerVe, TContainer2D >::col(), STK::Stat::covarianceWithFixedMean(), STK::IContainer2D::firstCol(), STK::IContainer2D::lastCol(), STK::Stat::mean(), STK::IRunnerPtr2D< TYPE, TContainerHo, TContainerVe, TContainer2D >::p_data_, and STK::Stat::varianceWithFixedMean().
{
// get dimensions
const Integer first = this->p_data_->firstCol(), last = this->p_data_->lastCol();
// for each variables
for (Integer j= first; j<= last; j++)
{
mean_[j] = Stat::mean(this->p_data_->col(j), weights);
// compute the variance
var_[j] = varianceWithFixedMean(this->p_data_->col(j), weights, mean_[j]);
cov_(j, j) = var_[j];
// compute the covariances
for (Integer i= first; i<j; i++)
{
cov_(i, j) = covarianceWithFixedMean(this->p_data_->col(i), this->p_data_->col(j), weights, mean_[i], mean_[j]);
cov_(j, i) = cov_(i, j);
}
}
return true;
}
Integer STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::nbSamples_ [protected] |
number of samples
Definition at line 158 of file STK_Stat_MultivariateReal.h.
Integer STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::nbVar_ [protected] |
Number of variables.
Definition at line 160 of file STK_Stat_MultivariateReal.h.
TContainerHo STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::mean_ [protected] |
Vector of the mean of the Variables.
Definition at line 163 of file STK_Stat_MultivariateReal.h.
TContainerHo STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::var_ [protected] |
Vector of the variance of the variables.
Definition at line 165 of file STK_Stat_MultivariateReal.h.
MatrixSquare STK::Stat::Multivariate< Real, TContainerHo, TContainerVe, TContainer2D >::cov_ [protected] |
Matrix of the covariance of the variables.
Definition at line 167 of file STK_Stat_MultivariateReal.h.