ParameterT< T > Class Template Reference

Base class for model parameters. More...

#include <MCMC.h>

Inheritance diagram for ParameterT< T >:

Inheritance graph
[legend]
Collaboration diagram for ParameterT< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ParameterT (std::string label)
virtual ~ParameterT (void)
virtual double llike (const T x) const
virtual double lPrior (const T x) const
virtual T propose (const T current) const
virtual double lQ (const T x, const T y) const
void Assign (const T &x)
virtual const T Function (const bool doCalc=true) const
virtual const T Value (void) const

Detailed Description

template<typename T>
class ParameterT< T >

Base class for model parameters.

ParameterT is one of the three workhorses in the simulation framework. Each parameter in the statistical model must be derived separately from ParameterT. It is not necessary to declare and define separate classes for parameters that share the same probabilistic structure, e.g., allele counts in different populations or measurements of yields in different experimental blocks, but each parameter must be pushed separately onto the step_ stack in Model.

It is often useful for the derived class to store a pointer to the model of which it is part. This allows the Model class to define access functions to the values of other parameters, facilitating calculation of the full conditionals.

lPrior() and llike(), the log prior and log likelihood for a particular parameter respectively, are used only as a sum. Thus, if it is more convenient to write the full conditional in a single function, either may be used. I typically find it easiest to write lPrior() as expressing the "probability" of the parameter, given hyperparameters on which it depends and llike() as expressing the "probability" of parameters (or data that depend on this one. But your mileage may vary.

Definition at line 125 of file MCMC.h.


Constructor & Destructor Documentation

template<typename T>
ParameterT< T >::ParameterT ( std::string  label  )  [inline]

Constructor

Parameters:
label a string identifier for the parameter

Definition at line 131 of file MCMC.h.

template<typename T>
virtual ParameterT< T >::~ParameterT ( void   )  [inline, virtual]

Destructor

Definition at line 137 of file MCMC.h.


Member Function Documentation

template<typename T>
virtual double ParameterT< T >::llike ( const T  x  )  const [inline, virtual]

Returns likelihood associated with current parameter

Parameters:
x Value of the parameter in the current iteration

Definition at line 148 of file MCMC.h.

template<typename T>
virtual double ParameterT< T >::lPrior ( const T  x  )  const [inline, virtual]

Returns prior associated with current parameter

Parameters:
x Value of the parameter in the current iteration

Definition at line 156 of file MCMC.h.

template<typename T>
virtual T ParameterT< T >::propose ( const T  current  )  const [inline, virtual]

Propose a new value for a parameter in an M-H step

Parameters:
current Value of the parameter in the current iteration

Definition at line 164 of file MCMC.h.

template<typename T>
virtual double ParameterT< T >::lQ ( const T  x,
const T  y 
) const [inline, virtual]

Probability of proposing x, given starting from y

Parameters:
x 
y 

Definition at line 173 of file MCMC.h.

template<typename T>
void ParameterT< T >::Assign ( const T &  x  )  [inline]

Assign value

Parameters:
x Value to assign to this parameter

Definition at line 180 of file MCMC.h.

Referenced by SliceStep::DoStep().

template<typename T>
virtual const T ParameterT< T >::Function ( const bool  doCalc = true  )  const [inline, virtual]

Function used to update a deterministic node

Definition at line 186 of file MCMC.h.

template<typename T>
virtual const T ParameterT< T >::Value ( void   )  const [inline, virtual]

Value of the parameter

Reimplemented from ParameterBase.

Definition at line 192 of file MCMC.h.

Referenced by SliceStep::DoStep(), StepBase::dVecValue(), StepBase::iValue(), StepBase::iVecValue(), and StepBase::Value().


The documentation for this class was generated from the following file:
Generated on Tue Mar 27 16:03:51 2007 for mcmc by  doxygen 1.5.1