lppl  v0.11.0
AncestorMetropolis< I, O, V, Q, Ts > Struct Template Reference

Metropolis Hastings using the prior distribution as the proposal. More...

#include "base.hpp"

Inheritance diagram for AncestorMetropolis< I, O, V, Q, Ts >:
Inference< AncestorMetropolis, I, O, V, Q, Ts... >

Public Member Functions

operator() (I &input)
 
void step (MetropolisState< Ts... > &state, pp_t< I, O, Ts... > f, Q< V, O, Ts... > &queryer, I input, inf_options_t opts)
 
- Public Member Functions inherited from Inference< AncestorMetropolis, I, O, V, Q, Ts... >
 Inference (pp_t< I, O, Ts... > f, Q< V, O, Ts... > &queryer, inf_options_t opts)
 
std::enable_if_t< has_proposal< G >::value==kernel::none, V > operator() (I &input)
 Runs the specified inference algorithm with the specified queryer. More...
 
std::enable_if_t< has_proposal< G >::value==kernel::full, V > operator() (I &input, P &proposal)
 Runs the specified inference algorithm with the specified queryer using the specified proposal distribution. More...
 
std::enable_if_t< has_proposal< G >::value==kernel::partial, V > operator() (I &input, pp_t< record_t< Ts... >, double, Ts... > &proposal)
 Runs the specified inference algorithm with the specified queryer using the specified proposal distribution. More...
 

Additional Inherited Members

- Public Attributes inherited from Inference< AncestorMetropolis, I, O, V, Q, Ts... >
pp_t< I, O, Ts... > f
 
inf_options_t opts
 
Q< V, O, Ts... > & queryer
 

Detailed Description

template<typename I, typename O, typename V, template< class, class, class... > class Q, typename... Ts>
struct AncestorMetropolis< I, O, V, Q, Ts >

Metropolis Hastings using the prior distribution as the proposal.

Suppose the generative model factors as \( p(x,z) = p(x|z)p(z) \). The acceptance ratio is \( \log \alpha = \log p(x|z') - \log p(x|z) \), where \( z' \sim p(z) \) is the new draw from the prior, and \( z \sim p(z) \) is the old/existing draw from the prior. Each weight passed to the queryer is \( \log w = 0 \).

Template Parameters
IThe input type of the program on which to perform inference
OThe output type of the program on which to perform inference
VThe type emitted by the queryer
QThe queryer type
TsThe distribution types used in the probabilistic program

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