37#ifndef STK_MODELBERNOULLI_PJ_H
38#define STK_MODELBERNOULLI_PJ_H
49template <
class Data,
class WColVector = CVectorX>
class ModelBernoulli_pj;
50class Bernoulli_pjParameters;
58template<
class Data_,
class WColVector_>
141template <
class Data_,
class WColVector_>
190template<
class Data_,
class WColVector_>
202template<
class Data_,
class WColVector_>
205 for (
int j=p_data()->dataij().beginCols();
j < p_data()->dataij().endCols(); ++
j)
208 int nbObs=p_data()->dataij().sizeRows();
210 for (
int i=p_data()->dataij().beginRows();
i<p_data()->dataij().endRows(); ++
i)
217template<
class Data_,
class WColVector_>
221 for (
int j=p_data()->dataij().beginCols();
j < p_data()->dataij().endCols(); ++
j)
224 for (
int i=p_data()->dataij().beginRows();
i<p_data()->dataij().endRows(); ++
i)
230 if (wsum != 0) { param().prob_[
j] =
sum/wsum;}
236template<
class Data_,
class WColVector_>
239 os <<
_T(
"prob = ") << prob();
240 os <<
_T(
"lnProb = ") << lnProb();
241 os <<
_T(
"ln1mProb = ") << ln1mProb();
In this file we define the class IMultiStatModel.
In this file we define the Bernoulli distribution.
In this file we define the constant and utilities methods used in the project Model.
#define _T(x)
Let x unmodified.
Structure encapsulating the parameters of a Joint Bernoulli model.
CPointX const & prob() const
Range const & range() const
CPointX const & lnProb() const
void resize(Range const &range)
resize the parameters only if the range is modified, otherwise, stay with the current values.
Bernoulli_pjParameters()
default constructor
Bernoulli_pjParameters(Bernoulli_pjParameters const ¶m)
copy constructor.
Bernoulli_pjParameters(Range const &size)
constructor with fixed size
~Bernoulli_pjParameters()
destructor
void setProb(int j, Real const &prob)
set the probability of success of the jth law
CPointX const & ln1mProb() const
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
A joint Bernoulli model is a statistical model of the form: following form.
CPointX const & ln1mProb() const
vector of the log probabilities of the reversed observations
WColVector_ WColVector
Type of the array storing the weights of the data.
DataBridge< Data_ > Data
Type of the container storing the data.
IMultiStatModel< ModelBernoulli_pj< Data_, WColVector_ > > Base
Base class.
CPointX const & prob() const
hidden::Traits< Data_ >::Type Type
Type of the data in the container.
~ModelBernoulli_pj()
destructor
ModelBernoulli_pj()
default constructor.
ModelBernoulli_pj(Data const *p_data)
Constructor with a ptr on the data set.
int computeNbFreeParameters() const
compute the number of free parameters
CPointX const & lnProb() const
vector of the log probabilities of the observations
void writeParametersImpl(ostream &os) const
Write the parameters on the output stream os.
hidden::Traits< Data_ >::Row RowVector
void computeParameters()
compute the parameters
ModelBernoulli_pj(ModelBernoulli_pj const &model)
Copy constructor.
ModelBernoulli_pj(Data const &data)
Constructor with data set.
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
@ binaryNA_
Not Available value.
double Real
STK fundamental type of Real values.
std::basic_ostream< Char > ostream
ostream for Char
The namespace STK is the main domain space of the Statistical ToolKit project.
Arithmetic properties of STK fundamental types.
static Type NA()
Adding a Non Available (NA) special number.
Bernoulli_pjParameters Parameters
Type of the parameters of the ModelBernoulli_pj.
Traits< Data_ >::Type Type
Type of the data in the container.
DataBridge< Data_ > Data
Type of the container storing the data.
WColVector_ WColVector
Type of the array storing the weights of the data.
Policy trait class for (Stat) Model classes.