queso-0.57.1
|
A templated class that represents a Markov Chain. More...
#include <MarkovChainPositionData.h>
Public Member Functions | |
Constructor/Destructor methods | |
MarkovChainPositionData (const BaseEnvironment &env) | |
Constructor 1. More... | |
MarkovChainPositionData (const BaseEnvironment &env, const V &vecValues, bool outOfTargetSupport, double logLikelihood, double logTarget) | |
Constructor 2. More... | |
MarkovChainPositionData (const MarkovChainPositionData< V > &rhs) | |
Constructor 3: copy. More... | |
~MarkovChainPositionData () | |
Destructor. More... | |
Set methods | |
MarkovChainPositionData< V > & | operator= (const MarkovChainPositionData< V > &rhs) |
Assignment operator. More... | |
Statistical/Mathematical methods | |
const V & | vecValues () const |
Values of the chain (vector); access to private attribute m_vecValues. More... | |
bool | outOfTargetSupport () const |
Whether or not a position is out of target support; access to private attribute m_outOfTargetSupport. More... | |
double | logLikelihood () const |
Logarithm of the value of the likelihood; access to private attribute m_logLikelihood. More... | |
double | logTarget () const |
Logarithm of the value of the target; access to private attribute m_logTarget. More... | |
void | set (const V &vecValues, bool outOfTargetSupport, double logLikelihood, double logTarget) |
Sets the values of the chain. More... | |
Private Attributes | |
const BaseEnvironment & | m_env |
V * | m_vecValues |
bool | m_outOfTargetSupport |
double | m_logLikelihood |
double | m_logTarget |
I/O methods | |
void | print (std::ostream &os) const |
TODO: Prints the Markov chain. More... | |
std::ostream & | operator<< (std::ostream &os, const MarkovChainPositionData< V > &obj) |
A templated class that represents a Markov Chain.
This class implements a Markov Chain. It contains important information about a position such as whether or not it is out of the target support and its logarithmic values of the likelihood and of the target, besides the position location. A Markov chain is collection of random variables {X_t}, where the index t runs through 0, 1, ..., having the property that, given the present, the future is conditionally independent of the past. For instance, a Markov chain is passed to the Metropolis-Hastings algorithm and on it is calculated the acceptance ration MetropolisHastingsSG::alpha().
Definition at line 49 of file MarkovChainPositionData.h.
QUESO::MarkovChainPositionData< V >::MarkovChainPositionData | ( | const BaseEnvironment & | env | ) |
Constructor 1.
It allocates a new Markov chain, given the environment. All the other private attributes are either NULL, false or zero.
Definition at line 32 of file MarkovChainPositionData.C.
QUESO::MarkovChainPositionData< V >::MarkovChainPositionData | ( | const BaseEnvironment & | env, |
const V & | vecValues, | ||
bool | outOfTargetSupport, | ||
double | logLikelihood, | ||
double | logTarget | ||
) |
Constructor 2.
It allocates a new Markov chain, and the vector vecValues
, given the environment, the likelihood and target values and sets whether or not it is out of target support.
Definition at line 43 of file MarkovChainPositionData.C.
QUESO::MarkovChainPositionData< V >::MarkovChainPositionData | ( | const MarkovChainPositionData< V > & | rhs | ) |
Constructor 3: copy.
The new Markov chain is a copy of rhs
.
Definition at line 59 of file MarkovChainPositionData.C.
QUESO::MarkovChainPositionData< V >::~MarkovChainPositionData | ( | ) |
double QUESO::MarkovChainPositionData< V >::logLikelihood | ( | ) | const |
Logarithm of the value of the likelihood; access to private attribute m_logLikelihood.
Definition at line 108 of file MarkovChainPositionData.C.
Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain().
double QUESO::MarkovChainPositionData< V >::logTarget | ( | ) | const |
Logarithm of the value of the target; access to private attribute m_logTarget.
Definition at line 116 of file MarkovChainPositionData.C.
Referenced by QUESO::Algorithm< V, M >::acceptance_ratio(), and QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain().
MarkovChainPositionData< V > & QUESO::MarkovChainPositionData< V >::operator= | ( | const MarkovChainPositionData< V > & | rhs | ) |
Assignment operator.
Definition at line 77 of file MarkovChainPositionData.C.
References QUESO::MarkovChainPositionData< V >::m_logLikelihood, QUESO::MarkovChainPositionData< V >::m_logTarget, QUESO::MarkovChainPositionData< V >::m_outOfTargetSupport, and QUESO::MarkovChainPositionData< V >::m_vecValues.
bool QUESO::MarkovChainPositionData< V >::outOfTargetSupport | ( | ) | const |
Whether or not a position is out of target support; access to private attribute m_outOfTargetSupport.
Definition at line 100 of file MarkovChainPositionData.C.
Referenced by QUESO::Algorithm< V, M >::acceptance_ratio().
void QUESO::MarkovChainPositionData< V >::print | ( | std::ostream & | os | ) | const |
TODO: Prints the Markov chain.
void QUESO::MarkovChainPositionData< V >::set | ( | const V & | vecValues, |
bool | outOfTargetSupport, | ||
double | logLikelihood, | ||
double | logTarget | ||
) |
Sets the values of the chain.
Definition at line 123 of file MarkovChainPositionData.C.
Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::delayedRejection().
const V & QUESO::MarkovChainPositionData< V >::vecValues | ( | ) | const |
Values of the chain (vector); access to private attribute m_vecValues.
Definition at line 91 of file MarkovChainPositionData.C.
Referenced by QUESO::Algorithm< V, M >::acceptance_ratio(), QUESO::MetropolisHastingsSG< P_V, P_M >::delayedRejection(), and QUESO::MetropolisHastingsSG< P_V, P_M >::generateFullChain().
|
friend |
Definition at line 106 of file MarkovChainPositionData.h.
|
private |
Definition at line 116 of file MarkovChainPositionData.h.
|
private |
Definition at line 119 of file MarkovChainPositionData.h.
Referenced by QUESO::MarkovChainPositionData< V >::operator=().
|
private |
Definition at line 120 of file MarkovChainPositionData.h.
Referenced by QUESO::MarkovChainPositionData< V >::operator=().
|
private |
Definition at line 118 of file MarkovChainPositionData.h.
Referenced by QUESO::MarkovChainPositionData< V >::operator=().
|
private |
Definition at line 117 of file MarkovChainPositionData.h.
Referenced by QUESO::MarkovChainPositionData< V >::operator=().