35#ifndef STK_STAT_MULTIVARIATEREAL_H
36#define STK_STAT_MULTIVARIATEREAL_H
65 typedef typename Array::Type
Type_;
75 , min_(), max_(), mean_(), var_(), cov_()
83 , min_(), max_(), mean_(), var_(), cov_()
92 , min_(), max_(), mean_(), var_(), cov_()
136 cov_.resize(this->
p_data_->cols());
139 cov_(
j,
j) = var_[
j];
143 cov_(
j,
i) = cov_(
i,
j);
149 this->
msg_error_ +=
_T(
"Error in Multivariate::run():\nWhat: ");
165 if (this->
p_data_->rows() != weights.range())
176 cov_.resize(this->
p_data_->cols());
180 cov_(
j,
j) = var_[
j];
185 cov_(
j,
i) = cov_(
i,
j);
191 this->
msg_error_ =
_T(
"Error in Multivariate::run(weights): ");
222 nbSamples_ = this->
p_data_->sizeRows();
223 nbVar_ = this->
p_data_->sizeCols();
A Array2DPoint is a one dimensional horizontal container.
In this file, we define Array2DSquare class.
#define STKERROR_NO_ARG(Where, Error)
This file contains the methods computing the covariance of an array.
This file contain the declaration of the base class Multivariate.
#define STK_STATIC_ASSERT(COND, MSG)
#define _T(x)
Let x unmodified.
Sdk class for all library Exceptions.
virtual const String error() const
Returns a C-style character string describing the general cause of the current error.
String msg_error_
String with the last error message.
String const & error() const
get the last error message.
Abstract class for all classes making unsupervised learning.
Array const * p_data() const
get the data set
Array const * p_data_
A pointer on the original data set.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
virtual void update()
udpating method in case we set a new data set
Multivariate()
Default Constructor.
Multivariate(Array const *p_data)
Constructor.
ArraySquareX const & covariance() const
PointX const & min() const
virtual Multivariate * clone() const
clone pattern
hidden::Traits< Array >::Row RowVector
hidden::Traits< Array >::Col ColVector
IRunnerUnsupervised< Array, ColVector > Runner
type of runner
virtual bool run(ColVector const &weights)
run the estimation of the weighted multivariate statistics.
int nbVar_
Number of variables.
int nbSamples_
number of samples
PointX mean_
Vector of the mean of the Variables.
Multivariate(Multivariate const &stat)
copy constructor.
ArraySquareX cov_
Array of the covariance of the variables.
Multivariate(Array const &data)
Constructor.
PointX min_
Vector of the mean of the Variables.
PointX var_
Vector of the variance of the variables.
PointX const & variance() const
PointX const & max() const
virtual bool run()
run the estimation of the Multivariate statistics.
PointX max_
Vector of the mean of the Variables.
PointX const & mean() const
virtual ~Multivariate()
virtual destructor.
Computation of the multivariate statistics of a Variable.
int nbSamples_
number of samples
int nbVar_
Number of variables.
double Real
STK fundamental type of Real values.
hidden::FunctorTraits< Derived, VarianceWithFixedMeanOp >::Row varianceWithFixedMean(Derived const &A, MeanType const &mean, bool unbiased)
Compute the VarianceWithFixedMean(s) value(s) of A.
hidden::FunctorTraits< Derived, MaxOp >::Row max(Derived const &A)
Compute the maximal(s) value(s) of A.
hidden::FunctorTraits< Derived, MeanOp >::Row mean(Derived const &A)
Compute the mean(s) value(s) of A.
Real covarianceWithFixedMean(ExprBase< XArray > const &X, ExprBase< YArray > const &Y, typename hidden::Traits< XArray >::Type const &xMu, typename hidden::Traits< YArray >::Type const &yMu, bool unbiased=false)
Compute the covariance of the variables X and Y with fixed means.
hidden::FunctorTraits< Derived, MinOp >::Row min(Derived const &A)
Compute the minimal(s) value(s) of A.
The namespace STK is the main domain space of the Statistical ToolKit project.
check if T and U are of the same type.