36#ifndef STK_DIAGGAUSSIANPARAMETERS_H
37#define STK_DIAGGAUSSIANPARAMETERS_H
39#include "../STK_Clust_Util.h"
83 inline Real const&
mean(
int k,
int j)
const {
return mean_[k][
j];}
85 inline Real const&
sigma(
int k,
int j)
const {
return sigma_[k][
j];}
90 void resize(
Range const& range);
93 void updateStatistics();
97 void releaseStatistics();
104 template<
class Array>
107 for(
int k=mean_.begin(),
kp=
params.beginRows(); k<mean_.end(); ++k,
kp+=2)
146 inline Real const&
mean(
int k,
int j)
const {
return mean_[k][
j];}
148 inline Real const&
sigma(
int k,
int j)
const {
return sigma_[k];}
153 void resize(
Range const& range);
156 void updateStatistics();
158 void setStatistics();
160 void releaseStatistics();
167 template<
class Array>
170 for(
int k=mean_.begin(),
kp=
params.beginRows(); k<mean_.end(); ++k,
kp+=2)
173 sigma_[k] =
params.row(
kp+1).mean();
209 inline Real const&
mean(
int k,
int j)
const {
return mean_[k][
j];}
216 void resize(
Range const& range);
219 void updateStatistics();
221 void setStatistics();
223 void releaseStatistics();
230 template<
class Array>
234 for(
int k=mean_.begin(),
kp=
params.beginRows(); k<mean_.end(); ++k,
kp+=2)
239 sigma_ /= mean_.size();
274 inline Real const&
mean(
int k,
int j)
const {
return mean_[k][
j];}
276 inline Real const&
sigma(
int k,
int j)
const {
return sigma_;}
281 void resize(
Range const& range);
284 void updateStatistics();
286 void setStatistics();
288 void releaseStatistics();
295 template<
class Array>
299 for(
int k=mean_.begin(),
kp=
params.beginRows(); k<mean_.end(); ++k,
kp+=2)
304 sigma_ /= mean_.size();
339 inline Real const&
mean(
int k,
int j)
const {
return mean_[k][
j];}
341 inline Real sigma(
int k,
int j)
const {
return sigmak_[k] * sigmaj_[
j];}
356 template<
class Array>
360 for(
int k=mean_.begin(),
kp=
params.beginRows(); k<mean_.end(); ++k,
kp+=2)
367 Real cte = std::sqrt((sigma/(sigmak_ * sigmaj_)).
mean());
In this file we define and implement the final class Array1D.
In this file we implement the final class CArrayPoint.
In this file we implement the final class CArrayVector.
In this file we implement the final class CArray.
This file contain the functors computings statistics.
This file contain the definition and implementation of the Online classes.
hidden::CSlice< Derived, 1, sizeCols_ >::Result row(int i) const
implement the row operator using a reference on the row of the allocator
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Index sub-vector region: Specialization when the size is unknown.
double Real
STK fundamental type of Real values.
hidden::SliceVisitorSelector< Derived, hidden::MeanVisitor, Arrays::by_col_ >::type_result mean(Derived const &A)
If A is a row-vector or a column-vector then the function will return the usual mean value of the vec...
hidden::FunctorTraits< Derived, MeanOp >::Row meanByCol(Derived const &A)
hidden::FunctorTraits< Derived, MeanOp >::Col meanByRow(Derived const &A)
The namespace STK is the main domain space of the Statistical ToolKit project.
Stat::Online< Real, Real > stat_sigma_
Array of the standard deviation statistics.
Real const & mean(int k, int j) const
Real sigma_
standard deviation of the variables
Array1D< Stat::Online< CPointX, Real > > stat_mean_
Array of the mean statistics.
Array1D< CPointX > mean_
array of size nbCluster with the parameters mean of the variables
Real const & sigma(int k, int j) const
void setParameters(ExprBase< Array > const ¶ms)
Set the parameters of the mixture model.
Real const & mean(int k, int j) const
Stat::Online< CPointX, Real > stat_sigma_
Array of the standard deviation statistics.
Array1D< Stat::Online< CPointX, Real > > stat_mean_
Array of the mean statistics.
Real const & sigma(int k, int j) const
void setParameters(ExprBase< Array > const ¶ms)
Set the parameters of the mixture model.
Array1D< CPointX > mean_
array of size nbCluster with the parameters mean of the variables
CPointX sigma_
standard deviation of the variables
Array1D< Stat::Online< CPointX, Real > > stat_mean_
Array of the mean statistics.
Array1D< CPointX > sigma_
standard deviation of the variables
Array1D< Stat::Online< CPointX, Real > > stat_sigma_
Array of the standard deviation statistics.
Array1D< CPointX > mean_
array of size nbCluster with the parameters mean of the variables
Real const & mean(int k, int j) const
void setParameters(ExprBase< Array > const ¶ms)
Set the parameters of the mixture model.
Real const & sigma(int k, int j) const
~ModelParameters()
destructor
void setParameters(ExprBase< Array > const ¶ms)
Set the parameters of the mixture model.
ModelParameters(int nbCluster)
default constructor
void setStatistics()
Set the computed statistics.
Array1D< Stat::Online< CPointX, Real > > stat_mean_
Array of the mean statistics.
Real const & mean(int k, int j) const
Stat::Online< Real, Real > stat_sigmak_
Array of the standard deviation k statistics.
Array1D< CPointX > mean_
array of size nbCluster with the parameters mean of the variables
CPointX sigmaj_
standard deviation of the variables by variables
CVectorX sigmak_
standard deviation of the variables
void releaseStatistics()
Release the computed statistics.
void updateStatistics()
update statistics of the parameters.
ModelParameters(ModelParameters const ¶m)
copy constructor.
void resize(Range const &range)
resize the set of parameter
Real sigma(int k, int j) const
Stat::Online< CPointX, Real > stat_sigmaj_
Array of the standard deviation j statistics.
Array1D< Real > sigma_
standard deviation of the variables
Real const & mean(int k, int j) const
Array1D< CPointX > mean_
array of size nbCluster with the parameters mean of the variables
Array1D< Stat::Online< Real, Real > > stat_sigma_
Array of the standard deviation statistics.
Real const & sigma(int k, int j) const
void setParameters(ExprBase< Array > const ¶ms)
Set the parameters of the mixture model.
Array1D< Stat::Online< CPointX, Real > > stat_mean_
Array of the mean statistics.
struct storing the parameters of the mixture.