37#ifndef STK_GAUSSIAN_MUJ_SJMODEL_H
38#define STK_GAUSSIAN_MUJ_SJMODEL_H
51template <
class Data_,
class WColVector = CVectorX>
class ModelDiagGaussian_muj_sj;
52struct DiagGaussian_muj_sjParameters;
60template<
class Data_,
class WColVector_>
131template <
class Data_,
class WColVector_>
179template<
class Data_,
class WColVector_>
189template<
class Data_,
class WColVector_>
192 for (
int j=p_data()->dataij().beginCols();
j < p_data()->dataij().endCols(); ++
j)
194 param().mu_[
j] = p_data()->dataij().col(
j).meanSafe();
195 param().sigma_[
j] = std::sqrt(p_data()->dataij().col(
j).varianceSafe(param().mu(
j)));
199template<
class Data_,
class WColVector_>
202 for (
int j=p_data()->dataij().beginCols();
j < p_data()->dataij().endCols(); ++
j)
204 param().mu_[
j] = p_data()->dataij().col(
j).wmeanSafe(
weights);
205 param().sigma_[
j] = std::sqrt(p_data()->dataij().col(
j).wvarianceSafe(param().mu(
j),
weights));
210template<
class Data_,
class WColVector_>
214 os <<
_T(
"sigma = ")<< sigma();
In this file we define the class IMultiStatModel.
In this file we define the Normal probability law class.
In this file we define the constant and utilities methods used in the project Model.
This file contain the functors computings statistics.
#define _T(x)
Let x unmodified.
Derived & resize(Range const &I, Range const &J)
resize the Array.
Interface base class for all Multivariate Statistical Models.
Real computeLnLikelihood() const
compute the log Likelihood of the statistical model.
Parameters const & param() const
Data const *const p_data() const
virtual Real lpdf(Real const &x) const
A DiagGaussian_muj_sj model is a statistical model of the form: following form.
ModelDiagGaussian_muj_sj(Data const &data)
Constructor with data set.
ModelDiagGaussian_muj_sj(Data const *p_data)
Constructor with a ptr on the data set.
ModelDiagGaussian_muj_sj(ModelDiagGaussian_muj_sj const &model)
Copy constructor.
int computeNbFreeParameters() const
compute the number of free parameters
ModelDiagGaussian_muj_sj()
default constructor.
CPointX const & sigma() const
vector of the mean log of the observations
DiagGaussian_muj_sjParameters Parameters
Type of the row vector of the container.
void computeParameters()
compute the parameters
CPointX const & mean() const
DataBridge< Data_ > Data
Type of the container storing the data.
hidden::Traits< Data_ >::Type Type
Type of the data in the container.
void writeParametersImpl(ostream &os) const
Write the parameters on the output stream os.
~ModelDiagGaussian_muj_sj()
destructor
hidden::Traits< Data_ >::Row RowVector
WColVector_ WColVector
Type of the array storing the weights of the data.
IMultiStatModel< ModelDiagGaussian_muj_sj< Data_, WColVector_ > > Base
Base class.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Index sub-vector region: Specialization when the size is unknown.
Arrays::SumOp< Lhs, Rhs >::result_type sum(Lhs const &lhs, Rhs const &rhs)
convenience function for summing two arrays
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...
std::basic_ostream< Char > ostream
ostream for Char
The namespace STK is the main domain space of the Statistical ToolKit project.
Structure encapsulating the parameters of a DiagGaussian_muj_sj model.
CPointX const & mu() const
Real const sigma(int j) const
CPointX const & sigma() const
void resize(Range const &range)
resize the parameters only if the range is modified, otherwise, stay with the current values.
DiagGaussian_muj_sjParameters()
default constructor
DiagGaussian_muj_sjParameters(DiagGaussian_muj_sjParameters const ¶m)
copy constructor.
~DiagGaussian_muj_sjParameters()
destructor
Real const mu(int j) const
DiagGaussian_muj_sjParameters(Range const &range)
default constructor
DiagGaussian_muj_sjParameters Parameters
Type of the parameters of the ModelDiagGaussian_muj_sj.
WColVector_ WColVector
Type of the array storing the weights of the data.
DataBridge< Data_ > Data
Type of the container storing the data.
Traits< Data_ >::Type Type
Type of the data in the container.
Policy trait class for (Stat) Model classes.