lppl  v0.14.4
Filter< A, TransKernel, I, O, Ts > Struct Template Reference

A generic filtering inference algorithm. More...

#include "filter.hpp"

Inheritance diagram for Filter< A, TransKernel, I, O, Ts >:
Inference< A, I, O, FilterValueType< O, Ts... >, WeightedRecord, Ts... >

Public Member Functions

 Filter (pp_t< I, O, Ts... > f, FilterQueryerType< O, Ts... > &queryer, transition< TransKernel, O, Ts... > &trans, inf_options_t opts, size_t seed=2022)
 Construct a new Filter object. More...
 
template<template< typename, typename, typename, template< class, class, class... > class, typename... > class G = A>
std::enable_if_t< has_proposal< G >::value==kernel::none, FilterValueType< O, Ts... > > step (I &input)
 Executes one filtering step. More...
 
template<class P , template< typename, typename, typename, template< class, class, class... > class, typename... > class G = A>
std::enable_if_t< has_proposal< G >::value==kernel::full, FilterValueType< O, Ts... > > step (I &input, P &proposal)
 Executes one filtering step. More...
 
void update_internal_state (FilterValueType< O, Ts... > &posterior)
 

Public Attributes

bool has_been_called
 
std::minstd_rand rng
 
transition< TransKernel, O, Ts... > & trans
 

Additional Inherited Members

- Protected Member Functions inherited from Inference< A, I, O, FilterValueType< O, Ts... >, WeightedRecord, Ts... >
 Inference (pp_t< I, O, Ts... > f, WeightedRecord< FilterValueType< O, Ts... >, O, Ts... > &queryer, inf_options_t opts)
 
std::enable_if_t< has_proposal< G >::value==kernel::none, FilterValueType< O, Ts... > > operator() (I &input)
 Runs the specified inference algorithm with the specified queryer. More...
 
std::enable_if_t< has_proposal< G >::value==kernel::full, FilterValueType< O, Ts... > > 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, FilterValueType< O, Ts... > > 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...
 
- Protected Attributes inherited from Inference< A, I, O, FilterValueType< O, Ts... >, WeightedRecord, Ts... >
pp_t< I, O, Ts... > f
 
inf_options_t opts
 
WeightedRecord< FilterValueType< O, Ts... >, O, Ts... > & queryer
 

Detailed Description

template<template< typename, typename, typename, template< class, class, class... > class, typename... > class A, class TransKernel, typename I, typename O, typename... Ts>
struct Filter< A, TransKernel, I, O, Ts >

A generic filtering inference algorithm.

Given a probabilistic program \(p(x,z) = p(x|z)p(z)\) and a user-supplied transition kernel, the model is converted into a dynamic filtering model \( p(x,z) = p(x_1 | z_1) p(z_1) \prod_{t\geq 2} p(x_t | z_t)p(z_t|x_{t-1}, z_{t-1})\) using filter_effect. At each timestep, inference is performed using the user-specified inference algorithm to recover an approximate posterior \(p(z_t | x_t)\). That approximate posterior is consumed by the transition callable to generate the new transition dynamics \(p(z_{t+1}|x_t, z_t)\) used in the next filtering step.

Template Parameters
AThe class template of the inference algorithm to use in constructing the approximate posterior
IThe input type of the probabilistic program
OThe output type of the probabilistic program
TsThe types of the distributions in the probabilistic program

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