STK++ 0.9.13
STK::Bernoulli_pjParameters Class Reference

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

#include <STK_ModelBernoulli_pj.h>

Public Member Functions

 Bernoulli_pjParameters ()
 default constructor
 
 Bernoulli_pjParameters (Range const &size)
 constructor with fixed size
 
 Bernoulli_pjParameters (Bernoulli_pjParameters const &param)
 copy constructor.
 
 ~Bernoulli_pjParameters ()
 destructor
 
Range constrange () const
 
CPointX constprob () const
 
CPointX constlnProb () const
 
CPointX constln1mProb () const
 
void setProb (int j, Real const &prob)
 set the probability of success of the jth law
 
void resize (Range const &range)
 resize the parameters only if the range is modified, otherwise, stay with the current values.
 

Public Attributes

CPointX prob_
 
CPointX lnProb_
 
CPointX ln1mProb_
 
Range range_
 

Detailed Description

Structure encapsulating the parameters of a Joint Bernoulli model.

Definition at line 76 of file STK_ModelBernoulli_pj.h.

Constructor & Destructor Documentation

◆ Bernoulli_pjParameters() [1/3]

STK::Bernoulli_pjParameters::Bernoulli_pjParameters ( )
inline

default constructor

Definition at line 80 of file STK_ModelBernoulli_pj.h.

80{}

◆ Bernoulli_pjParameters() [2/3]

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

constructor with fixed size

Definition at line 82 of file STK_ModelBernoulli_pj.h.

83 : prob_(size, 0.5)
84 , lnProb_(size, -Const::_LN2_)
85 , ln1mProb_(size, -Const::_LN2_)
86 {}

◆ Bernoulli_pjParameters() [3/3]

STK::Bernoulli_pjParameters::Bernoulli_pjParameters ( Bernoulli_pjParameters const param)
inline

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 88 of file STK_ModelBernoulli_pj.h.

89 : prob_(param.prob_)
90 , lnProb_(param.lnProb_)
91 , ln1mProb_(param.ln1mProb_)
92 {}

◆ ~Bernoulli_pjParameters()

STK::Bernoulli_pjParameters::~Bernoulli_pjParameters ( )
inline

destructor

Definition at line 94 of file STK_ModelBernoulli_pj.h.

94{}

Member Function Documentation

◆ ln1mProb()

CPointX const & STK::Bernoulli_pjParameters::ln1mProb ( ) const
inline
Returns
the probability of success of the jth law

Definition at line 102 of file STK_ModelBernoulli_pj.h.

102{ return ln1mProb_;}

References ln1mProb_.

◆ lnProb()

CPointX const & STK::Bernoulli_pjParameters::lnProb ( ) const
inline
Returns
the probability of success of the jth law

Definition at line 100 of file STK_ModelBernoulli_pj.h.

100{ return lnProb_;}

References lnProb_.

◆ prob()

CPointX const & STK::Bernoulli_pjParameters::prob ( ) const
inline
Returns
the probability of success of the jth law

Definition at line 98 of file STK_ModelBernoulli_pj.h.

98{ return prob_;}

References prob_.

Referenced by setProb().

◆ range()

Range const & STK::Bernoulli_pjParameters::range ( ) const
inline
Returns
the range of the data set

Definition at line 96 of file STK_ModelBernoulli_pj.h.

References range_.

Referenced by resize().

◆ resize()

void STK::Bernoulli_pjParameters::resize ( Range const range)
inline

resize the parameters only if the range is modified, otherwise, stay with the current values.

Parameters
rangethe range of the parameters (= range of the variables of the model)

Definition at line 116 of file STK_ModelBernoulli_pj.h.

117 {
118 if (range != range_)
119 {
121 range_ = range;
122 }
123 }
Derived & resize(Range const &I, Range const &J)
resize the Array.

References ln1mProb_, lnProb_, prob_, range(), range_, and STK::ICArray< Derived >::resize().

◆ setProb()

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

set the probability of success of the jth law

Definition at line 105 of file STK_ModelBernoulli_pj.h.

106 { prob_[j] = prob;
107 if (prob>0) { lnProb_[j] = std::log(prob);}
108 else { lnProb_[j] = -Arithmetic<Real>::infinity();}
109 if (prob<1) { ln1mProb_[j] = std::log(1.-prob);}
110 else { ln1mProb_[j] = -Arithmetic<Real>::infinity();}
111 }

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

Member Data Documentation

◆ ln1mProb_

CPointX STK::Bernoulli_pjParameters::ln1mProb_

Definition at line 127 of file STK_ModelBernoulli_pj.h.

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

◆ lnProb_

CPointX STK::Bernoulli_pjParameters::lnProb_

Definition at line 126 of file STK_ModelBernoulli_pj.h.

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

◆ prob_

CPointX STK::Bernoulli_pjParameters::prob_

Definition at line 125 of file STK_ModelBernoulli_pj.h.

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

◆ range_

Range STK::Bernoulli_pjParameters::range_

Definition at line 128 of file STK_ModelBernoulli_pj.h.

Referenced by range(), and resize().


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