lppl  v2.0.0
ImportanceSampling< I, O, V, Q, Ts > Struct Template Reference

Importance sampling using an arbitrary user-defined proposal distribution. More...

#include "generic.hpp"

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

Public Member Functions

operator() (I &input, exog_proposal_t< I, Ts... > &p)
 
void step (record_t< DTypes< Ts... >> &r, I &input)
 
- Public Member Functions inherited from Inference< ImportanceSampling, 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< std::is_same_v< typename has_proposal< G >::type, No >, V > operator() (I &input)
 Runs the specified inference algorithm with the specified queryer. More...
 
std::enable_if_t< std::is_same_v< typename has_proposal< G >::type, Endog >, V > operator() (I &input, endog_proposal_t< Ts... > &proposal)
 Runs the specified inference algorithm with the specified queryer using the specified proposal distribution. More...
 
std::enable_if_t< std::is_same_v< typename has_proposal< G >::type, Exog >, V > operator() (I &input, exog_proposal_t< I, Ts... > &proposal)
 Runs the specified inference algorithm with the specified queryer using the specified proposal distribution. More...
 
void step (record_t< DTypes< Ts... >> &r, I &input)
 

Additional Inherited Members

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

Detailed Description

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

Importance sampling using an arbitrary user-defined proposal distribution.

Suppose the probabilistic program factors as \(p(x, z) = p(x|z)p(z)\), while the proposal distribution is given by \(q(z|x)\). This method proposes values \(z \sim q(z|x)\) and computes weights as \( \log w = \log p(x,z) - \log q(z|x)\).

Template Parameters
IThe input type of the probabilistic program
OThe output type of the probabilistic program
VThe type of the address(es) to be queried
QThe class template of the queryer
TsThe distribution types in the probabilistic program

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