All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Posterior< Model > Class Template Reference

Generic posterior class. More...

#include <sample_default.h>

Public Member Functions

 Posterior (const Model_eval &prior, const Model_eval &likelihood)
void set_short_circuiting (bool sc)
double operator() (const Model &m) const
void set_annealing_compensation (double temperature)

Detailed Description

template<class Model>
class Posterior< Model >

Generic posterior class.

This class represents an un-normalized log-posterior class, which is composed of the sum of the log-prior and log-likelihood.

This class offers a "short circuiting" feature in which the likelihood is not evaluated where the prior is zero; in this way, the prior may "protect" the likelihood from invalid values that would result in an error.

Constructor & Destructor Documentation

template<class Model >
Posterior< Model >::Posterior ( const Model_eval &  prior,
const Model_eval &  likelihood 

Member Function Documentation

template<class Model >
double Posterior< Model >::operator() ( const Model &  m) const
template<class Model >
void Posterior< Model >::set_annealing_compensation ( double  temperature)

If this posterior is to be used in simulated annealing, often it is desirable to only apply annealing to the likelihood function. Since annealing by default is applied to the entire target distribution, this function allows you to set a "compensation factor" which will cancel-out the affect of annealing on the prior, resulting in only the likelihood being annealed.

You can pass this as a callback to Annealing_sampler's add_temperature_changed_callback() so it is updated every time the temperature changes.

template<class Model >
void Posterior< Model >::set_short_circuiting ( bool  sc)

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