A base class for the bootstrap particle filter.
More...
#include <bootstrap_filter.h>
|
using | ssv = Eigen::Matrix< float_t, dimx, 1 > |
|
using | osv = Eigen::Matrix< float_t, dimy, 1 > |
|
using | Mat = Eigen::Matrix< float_t, Eigen::Dynamic, Eigen::Dynamic > |
|
using | arrayStates = std::array< ssv, nparts > |
|
using | arrayFloat = std::array< float_t, nparts > |
|
using | float_type = float_t |
|
using | osv = Eigen::Matrix< float_t, dimobs, 1 > |
|
using | ssv = Eigen::Matrix< float_t, dimstate, 1 > |
|
using | Mat = Eigen::Matrix< float_t, Eigen::Dynamic, Eigen::Dynamic > |
|
using | func = std::function< const Mat(const ssv &)> |
|
using | funcs = std::vector< func > |
|
|
| BSFilter (const unsigned int &rs=1) |
| The constructor. More...
|
|
virtual | ~BSFilter () |
| The (virtual) destructor.
|
|
float_t | getLogCondLike () const |
| Returns the most recent (log-) conditiona likelihood. More...
|
|
void | filter (const osv &data, const std::vector< std::function< const Mat(const ssv &)> > &fs=std::vector< std::function< const Mat(const ssv &)> >()) |
| updates filtering distribution on a new datapoint. Optionally stores expectations of functionals. More...
|
|
auto | getExpectations () const -> std::vector< Mat > |
| return all stored expectations (taken with respect to $p(x_t|y_{1:t})$ More...
|
|
virtual float_t | logMuEv (const ssv &x1)=0 |
| Calculate muEv or logmuEv. More...
|
|
virtual ssv | q1Samp (const osv &y1)=0 |
| Samples from time 1 proposal. More...
|
|
virtual float_t | logQ1Ev (const ssv &x1, const osv &y1)=0 |
| Calculate q1Ev or log q1Ev. More...
|
|
virtual float_t | logGEv (const osv &yt, const ssv &xt)=0 |
| Calculate gEv or logGEv. More...
|
|
virtual ssv | fSamp (const ssv &xtm1)=0 |
| Sample from the state transition distribution. More...
|
|
virtual void | filter (const osv &data, const funcs &fs=funcs())=0 |
| the filtering function that must be defined
|
|
|
static constexpr unsigned int | num_particles = nparts |
|
static constexpr unsigned int | dim_obs |
|
static constexpr unsigned int | dim_state |
|
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t, typename float_t, bool debug = false>
class BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >
A base class for the bootstrap particle filter.
- Author
- taylor
◆ arrayFloat
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
using BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::arrayFloat = std::array<float_t, nparts> |
type alias for array of floating points
◆ arrayStates
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
type alias for linear algebra stuff
◆ Mat
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
using BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::Mat = Eigen::Matrix<float_t, Eigen::Dynamic, Eigen::Dynamic> |
type alias for dynamically sized matrix
◆ osv
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
using BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::osv = Eigen::Matrix<float_t, dimy, 1> |
"obs size vector" type alias for linear algebra stuff
◆ ssv
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
using BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::ssv = Eigen::Matrix<float_t, dimx, 1> |
"state size vector" type alias for linear algebra stuff
◆ BSFilter()
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug>
BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::BSFilter |
( |
const unsigned int & |
rs = 1 | ) |
|
The constructor.
- Parameters
-
rs | the resampling schedule (e.g. every rs time point) |
◆ filter()
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug>
void BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::filter |
( |
const osv & |
data, |
|
|
const std::vector< std::function< const Mat(const ssv &)> > & |
fs = std::vector<std::function<const Mat(const ssv&)> >() |
|
) |
| |
updates filtering distribution on a new datapoint. Optionally stores expectations of functionals.
- Parameters
-
data | the most recent data point |
fs | a vector of functions if you want to calculate expectations. |
◆ fSamp()
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
virtual ssv BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::fSamp |
( |
const ssv & |
xtm1 | ) |
|
|
pure virtual |
Sample from the state transition distribution.
- Parameters
-
xtm1 | is a const Vec& describing the time t-1 state |
- Returns
- the sample as a Vec
◆ getExpectations()
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug>
auto BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::getExpectations |
( |
| ) |
const -> std::vector<Mat> |
return all stored expectations (taken with respect to $p(x_t|y_{1:t})$
- Returns
- return a std::vector<Mat> of expectations. How many depends on how many callbacks you gave to
◆ getLogCondLike()
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug>
float_t BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::getLogCondLike |
( |
| ) |
const |
|
virtual |
◆ logGEv()
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
virtual float_t BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::logGEv |
( |
const osv & |
yt, |
|
|
const ssv & |
xt |
|
) |
| |
|
pure virtual |
Calculate gEv or logGEv.
- Parameters
-
yt | is a const Vec& describing the time t datum |
xt | is a const Vec& describing the time t state |
- Returns
- the density or log-density evaluation
◆ logMuEv()
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
virtual float_t BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::logMuEv |
( |
const ssv & |
x1 | ) |
|
|
pure virtual |
Calculate muEv or logmuEv.
- Parameters
-
x1 | is a const Vec& describing the state sample |
- Returns
- the density or log-density evaluation
◆ logQ1Ev()
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
virtual float_t BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::logQ1Ev |
( |
const ssv & |
x1, |
|
|
const osv & |
y1 |
|
) |
| |
|
pure virtual |
Calculate q1Ev or log q1Ev.
- Parameters
-
x1 | is a const Vec& describing the time 1 state sample |
y1 | is a const Vec& describing the time 1 datum |
- Returns
- the density or log-density evaluation
◆ q1Samp()
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
virtual ssv BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::q1Samp |
( |
const osv & |
y1 | ) |
|
|
pure virtual |
Samples from time 1 proposal.
- Parameters
-
y1 | is a const Vec& representing the first observed datum |
- Returns
- the sample as a Vec
◆ num_particles
template<size_t nparts, size_t dimx, size_t dimy, typename resamp_t , typename float_t , bool debug = false>
constexpr unsigned int BSFilter< nparts, dimx, dimy, resamp_t, float_t, debug >::num_particles = nparts |
|
static |
The documentation for this class was generated from the following file: