Bayesian Filtering Library Generated from SVN r
Filter< StateVar, MeasVar > Class Template Referenceabstract

Abstract class representing an interface for Bayesian Filters. More...

#include <filter.h>

Inheritance diagram for Filter< StateVar, MeasVar >:
MixtureParticleFilter< StateVar, MeasVar > ParticleFilter< StateVar, MeasVar > MixtureBootstrapFilter< StateVar, MeasVar > ASIRFilter< StateVar, MeasVar > BootstrapFilter< StateVar, MeasVar > Optimalimportancefilter< StateVar, MeasVar >

Public Member Functions

 Filter (Pdf< StateVar > *prior)
 Constructor.
 
 Filter (const Filter< StateVar, MeasVar > &filt)
 copy constructor
 
virtual ~Filter ()
 destructor
 
virtual void Reset (Pdf< StateVar > *prior)
 Reset Filter.
 
virtual bool Update (SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
 Full Update (system with inputs/sensing params)
 
virtual bool Update (SystemModel< StateVar > *const sysmodel, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
 Full Update (system without inputs, with sensing params)
 
virtual bool Update (SystemModel< StateVar > *const sysmodel, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z)
 Full Update (system without inputs/sensing params)
 
virtual bool Update (SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z)
 Full Update (system with inputs, without sensing params)
 
virtual bool Update (SystemModel< StateVar > *const sysmodel, const StateVar &u)
 System Update (system with inputs)
 
virtual bool Update (SystemModel< StateVar > *const sysmodel)
 System Update (system without inputs)
 
virtual bool Update (MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)
 Measurement Update (system with "sensing params")
 
virtual bool Update (MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z)
 Measurement Update (system without "sensing params")
 
virtual Pdf< StateVar > * PostGet ()
 Get Posterior density.
 
int TimeStepGet () const
 Get current time.
 

Protected Member Functions

virtual bool UpdateInternal (SystemModel< StateVar > *const sysmodel, const StateVar &u, MeasurementModel< MeasVar, StateVar > *const measmodel, const MeasVar &z, const StateVar &s)=0
 Actual implementation of Update, varies along filters.
 

Protected Attributes

Pdf< StateVar > * _prior
 prior Pdf
 
Pdf< StateVar > * _post
 Pointer to the Posterior Pdf.
 
int _timestep
 Represents the current timestep of the filter.
 

Detailed Description

template<typename StateVar, typename MeasVar>
class BFL::Filter< StateVar, MeasVar >

Abstract class representing an interface for Bayesian Filters.

This is the Abstract interface class that defines the interface of Bayesian filters. These filters are all related to i) a System Model, ii) a Measurement Model and iii) a Prior density reflecting the subjective belief of the person applying the filter BEFORE getting sensor or any other form of information about the modeled system.

This class is the base class for particle filters, kalman filters, ...

This class is a template class with 2 templates. In this way it allows filtering for "semi-discrete" models, eg. models with a fixed number of states (discrete states) but with continuous observations, as needed in Automatic Speech Recognition.

See also
Pdf SystemModel MeasurementModel ConditionalPdf
Bug
For now, due to a "bug" (= non-existence of a feature :-) in the ConditionalPdf class, STATES AND INPUTS MUST BE OF THE SAME TYPE (both discrete, or both continuous! This means that you can use this class for the following model types:
  • States, inputs and measurements continuous (most frequently used?)
  • States and inputs continous, Measurements discrete
  • States and inputs discrete, Measurements continous
  • States, inputs and measurements discrete

StateVar represents the nature of the states and inputs MeasVar represents the nature of the measurements

BEWARE: The order of the template arguments is reversed with respect to the notation used in "measurementmodel.h"

Definition at line 77 of file filter.h.

Constructor & Destructor Documentation

◆ Filter() [1/2]

template<typename StateVar , typename MeasVar >
Filter ( Pdf< StateVar > * prior)

Constructor.

Precondition
you created the prior
Parameters
priorpointer to the prior Pdf

◆ Filter() [2/2]

template<typename StateVar , typename MeasVar >
Filter ( const Filter< StateVar, MeasVar > & filt)

copy constructor

Bug
we should make a copy of the prior

◆ ~Filter()

template<typename SVar , typename MVar >
~Filter ( )
virtual

destructor

Definition at line 33 of file filter.h.

Member Function Documentation

◆ PostGet()

template<typename SVar , typename MVar >
Pdf< SVar > * PostGet ( )
virtual

Get Posterior density.

Get the current Posterior density

Returns
a pointer to the current posterior

Reimplemented in HistogramFilter< MeasVar >, KalmanFilter, MixtureParticleFilter< StateVar, MeasVar >, ParticleFilter< StateVar, MeasVar >, and ParticleFilter< ColumnVector, ColumnVector >.

Definition at line 127 of file filter.h.

◆ Reset()

template<typename StateVar , typename MeasVar >
void Reset ( Pdf< StateVar > * prior)
virtual

Reset Filter.

Definition at line 42 of file filter.h.

◆ TimeStepGet()

template<typename SVar , typename MVar >
int TimeStepGet ( ) const

Get current time.

Get the current time of the filter

Returns
the current timestep

Definition at line 50 of file filter.h.

◆ Update() [1/8]

template<typename StateVar , typename MeasVar >
virtual bool Update ( MeasurementModel< MeasVar, StateVar > *const measmodel,
const MeasVar & z )
virtual

Measurement Update (system without "sensing params")

Parameters
measmodelpointer to the measurement model to use for update
zmeasurement

Reimplemented in Optimalimportancefilter< StateVar, MeasVar >.

◆ Update() [2/8]

template<typename StateVar , typename MeasVar >
virtual bool Update ( MeasurementModel< MeasVar, StateVar > *const measmodel,
const MeasVar & z,
const StateVar & s )
virtual

Measurement Update (system with "sensing params")

Parameters
measmodelpointer to the measurement model to use for update
zmeasurement
s"sensing parameter"

Reimplemented in Optimalimportancefilter< StateVar, MeasVar >.

◆ Update() [3/8]

template<typename StateVar , typename MeasVar >
virtual bool Update ( SystemModel< StateVar > *const sysmodel)
virtual

System Update (system without inputs)

Parameters
sysmodelpointer to the system model to use for update

Reimplemented in Optimalimportancefilter< StateVar, MeasVar >.

◆ Update() [4/8]

template<typename StateVar , typename MeasVar >
virtual bool Update ( SystemModel< StateVar > *const sysmodel,
const StateVar & u )
virtual

System Update (system with inputs)

Parameters
sysmodelpointer to the system model to use for update
uinput to the system

Reimplemented in Optimalimportancefilter< StateVar, MeasVar >.

◆ Update() [5/8]

template<typename StateVar , typename MeasVar >
virtual bool Update ( SystemModel< StateVar > *const sysmodel,
const StateVar & u,
MeasurementModel< MeasVar, StateVar > *const measmodel,
const MeasVar & z )
virtual

Full Update (system with inputs, without sensing params)

Parameters
sysmodelpointer to the system model to use for update
uinput to the system
measmodelpointer to the measurement model to use for update
zmeasurement

Reimplemented in Optimalimportancefilter< StateVar, MeasVar >.

◆ Update() [6/8]

template<typename StateVar , typename MeasVar >
virtual bool Update ( SystemModel< StateVar > *const sysmodel,
const StateVar & u,
MeasurementModel< MeasVar, StateVar > *const measmodel,
const MeasVar & z,
const StateVar & s )
virtual

Full Update (system with inputs/sensing params)

Parameters
sysmodelpointer to the system model to use for update
uinput to the system
measmodelpointer to the measurement model to use for update
zmeasurement
s"sensing parameter"

Reimplemented in Optimalimportancefilter< StateVar, MeasVar >.

◆ Update() [7/8]

template<typename StateVar , typename MeasVar >
virtual bool Update ( SystemModel< StateVar > *const sysmodel,
MeasurementModel< MeasVar, StateVar > *const measmodel,
const MeasVar & z )
virtual

Full Update (system without inputs/sensing params)

Parameters
sysmodelpointer to the system model to use for update
measmodelpointer to the measurement model to use for update
zmeasurement

Reimplemented in Optimalimportancefilter< StateVar, MeasVar >.

◆ Update() [8/8]

template<typename StateVar , typename MeasVar >
virtual bool Update ( SystemModel< StateVar > *const sysmodel,
MeasurementModel< MeasVar, StateVar > *const measmodel,
const MeasVar & z,
const StateVar & s )
virtual

Full Update (system without inputs, with sensing params)

Parameters
sysmodelpointer to the system model to use for update
measmodelpointer to the measurement model to use for update
zmeasurement
s"sensing parameter"

Reimplemented in Optimalimportancefilter< StateVar, MeasVar >.

◆ UpdateInternal()

template<typename StateVar , typename MeasVar >
virtual bool UpdateInternal ( SystemModel< StateVar > *const sysmodel,
const StateVar & u,
MeasurementModel< MeasVar, StateVar > *const measmodel,
const MeasVar & z,
const StateVar & s )
protectedpure virtual

Actual implementation of Update, varies along filters.

Parameters
sysmodelpointer to the used system model
uinput param for proposal density
measmodelpointer to the used measurementmodel
zmeasurement param for proposal density
ssensor param for proposal density

Implemented in ASIRFilter< StateVar, MeasVar >, BootstrapFilter< StateVar, MeasVar >, EKParticleFilter, HistogramFilter< MeasVar >, KalmanFilter, MixtureBootstrapFilter< StateVar, MeasVar >, MixtureParticleFilter< StateVar, MeasVar >, ParticleFilter< StateVar, MeasVar >, and ParticleFilter< ColumnVector, ColumnVector >.

Member Data Documentation

◆ _post

template<typename StateVar , typename MeasVar >
Pdf<StateVar>* _post
protected

Pointer to the Posterior Pdf.

The Posterior Pdf represents the subjective belief of the person applying the filter AFTER processing inputs and measurements. A filter does not maintain the beliefs at all timesteps t, since this leads to non-constant (or ever growing if you prefer) memory requirements. However, it is possible, to copy the Posterior density at all timesteps in your application by means of the PostGet() member function

See also
PostGet()

Definition at line 95 of file filter.h.

◆ _prior

template<typename StateVar , typename MeasVar >
Pdf<StateVar>* _prior
protected

prior Pdf

Definition at line 82 of file filter.h.

◆ _timestep

template<typename StateVar , typename MeasVar >
int _timestep
protected

Represents the current timestep of the filter.

Todo
Check wether this really belongs here

Definition at line 100 of file filter.h.


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