STK++ 0.9.13
STK::JointBernoulliParameters Class Reference

Structure encapsulating the parameters of a Joint Bernoulli model. More...

#include <STK_JointBernoulliModel.h>

Inheritance diagram for STK::JointBernoulliParameters:
Inheritance graph

Public Member Functions

 JointBernoulliParameters ()
 default constructor
 
 JointBernoulliParameters (Range const &size)
 constructor with fixed size
 
 JointBernoulliParameters (JointBernoulliParameters const &param)
 copy constructor.
 
 ~JointBernoulliParameters ()
 destructor
 
Real const prob (int const &j) const
 
Real const lnProb (int const &j) const
 
Real const ln1mProb (int const &j) const
 
void setProb (int const &j, Real const &prob)
 set the probability of success of the jth law
 
void resizeImpl (Range const &range)
 resize the set of parameter
 
- Public Member Functions inherited from STK::IMultiParameters< JointBernoulliParameters >
Range constrange () const
 
void resize (Range const &range)
 resize the parameters only if the range is modified, otherwise, stay with the current values.
 
- Public Member Functions inherited from STK::IRecursiveTemplate< Derived >
Derived & asDerived ()
 static cast : return a reference of this with a cast to the derived class.
 
Derived constasDerived () const
 static cast : return a const reference of this with a cast to the derived class.
 
Derived * asPtrDerived ()
 static cast : return a ptr on a Derived of this with a cast to the derived class.
 
Derived constasPtrDerived () const
 static cast : return a ptr on a constant Derived of this with a cast to the derived class.
 
Derived * clone () const
 create a leaf using the copy constructor of the Derived class.
 
Derived * clone (bool isRef) const
 create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not.
 

Protected Attributes

Array2DPoint< Realprob_
 
Array2DPoint< ReallnProb_
 
Array2DPoint< Realln1mProb_
 

Additional Inherited Members

- Protected Member Functions inherited from STK::IMultiParameters< JointBernoulliParameters >
 IMultiParameters ()
 default constructor.
 
 IMultiParameters (Range const &range)
 constructor with specified range
 
 IMultiParameters (IMultiParameters const &param)
 copy constructor.
 
 ~IMultiParameters ()
 Destructor.
 
- Protected Member Functions inherited from STK::IRecursiveTemplate< Derived >
 IRecursiveTemplate ()
 constructor.
 
 ~IRecursiveTemplate ()
 destructor.
 

Detailed Description

Structure encapsulating the parameters of a Joint Bernoulli model.

Definition at line 51 of file STK_JointBernoulliModel.h.

Constructor & Destructor Documentation

◆ JointBernoulliParameters() [1/3]

STK::JointBernoulliParameters::JointBernoulliParameters ( )
inline

default constructor

Definition at line 55 of file STK_JointBernoulliModel.h.

55{}

◆ JointBernoulliParameters() [2/3]

STK::JointBernoulliParameters::JointBernoulliParameters ( Range const size)
inline

constructor with fixed size

Definition at line 57 of file STK_JointBernoulliModel.h.

58 : prob_(size, 0.5)
59 , lnProb_(size, -Const::_LN2_)
60 , ln1mProb_(size, -Const::_LN2_)
61 {}

◆ JointBernoulliParameters() [3/3]

STK::JointBernoulliParameters::JointBernoulliParameters ( JointBernoulliParameters const param)
inline

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 63 of file STK_JointBernoulliModel.h.

64 : prob_(param.prob_)
65 , lnProb_(param.lnProb_)
66 , ln1mProb_(param.ln1mProb_)
67 {}

◆ ~JointBernoulliParameters()

STK::JointBernoulliParameters::~JointBernoulliParameters ( )
inline

destructor

Definition at line 69 of file STK_JointBernoulliModel.h.

69{}

Member Function Documentation

◆ ln1mProb()

Real const STK::JointBernoulliParameters::ln1mProb ( int const j) const
inline
Returns
the probability of success of the jth law

Definition at line 75 of file STK_JointBernoulliModel.h.

75{ return ln1mProb_[j];}

References ln1mProb_.

◆ lnProb()

Real const STK::JointBernoulliParameters::lnProb ( int const j) const
inline
Returns
the probability of success of the jth law

Definition at line 73 of file STK_JointBernoulliModel.h.

73{ return lnProb_[j];}

References lnProb_.

◆ prob()

Real const STK::JointBernoulliParameters::prob ( int const j) const
inline
Returns
the probability of success of the jth law

Definition at line 71 of file STK_JointBernoulliModel.h.

71{ return prob_[j];}

References prob_.

Referenced by setProb().

◆ resizeImpl()

void STK::JointBernoulliParameters::resizeImpl ( Range const range)
inline

resize the set of parameter

Definition at line 85 of file STK_JointBernoulliModel.h.

Derived & resize(Range const &I, Range const &J)
resize the array.

References ln1mProb_, lnProb_, prob_, STK::IMultiParameters< JointBernoulliParameters >::range(), and STK::IArray2D< Derived >::resize().

◆ setProb()

void STK::JointBernoulliParameters::setProb ( int const j,
Real const prob 
)
inline

set the probability of success of the jth law

Definition at line 77 of file STK_JointBernoulliModel.h.

78 { prob_[j] = prob;
79 if (prob>0) { lnProb_[j] = std::log(prob);}
80 else { lnProb_[j] = -Arithmetic<Real>::infinity();}
81 if (prob<1) { ln1mProb_[j] = std::log(1.-prob);}
82 else { ln1mProb_[j] = -Arithmetic<Real>::infinity();}
83 }
Real const prob(int const &j) const

References ln1mProb_, lnProb_, prob(), and prob_.

Member Data Documentation

◆ ln1mProb_

Array2DPoint<Real> STK::JointBernoulliParameters::ln1mProb_
protected

Definition at line 91 of file STK_JointBernoulliModel.h.

Referenced by ln1mProb(), resizeImpl(), and setProb().

◆ lnProb_

Array2DPoint<Real> STK::JointBernoulliParameters::lnProb_
protected

Definition at line 90 of file STK_JointBernoulliModel.h.

Referenced by lnProb(), resizeImpl(), and setProb().

◆ prob_

Array2DPoint<Real> STK::JointBernoulliParameters::prob_
protected

Definition at line 89 of file STK_JointBernoulliModel.h.

Referenced by prob(), resizeImpl(), and setProb().


The documentation for this class was generated from the following file: