lppl
v2.0.0
|
Likelihood weighting importance sampling, using the prior as the proposal. More...
#include "likelihood.hpp"
Public Member Functions | |
V | operator() (I &input) |
void | step (record_t< DTypes< Ts... >> &r, I &input) |
Public Member Functions inherited from Inference< LikelihoodWeighting, 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< LikelihoodWeighting, I, O, V, Q, Ts... > | |
pp_t< I, O, Ts... > | f |
inf_options_t | opts |
Q< V, O, Ts... > & | queryer |
inference_state< LikelihoodWeighting, I, O, Ts... > | state |
Likelihood weighting importance sampling, using the prior as the proposal.
Suppose the probabilistic program factors as \(p(x,z) = p(x|z)p(z)\). This method samples values \(z \sim p(z)\). The weight of each sample is given by \(\log w = \log p(x|z)\).
I | The input type of the probabilistic program |
O | The output type of the probabilistic program |
V | The type of the address(es) to be queried |
Q | The class template of the queryer |
Ts | The distribution types in the probabilistic program |