Models
The BasicParticleFilter
requires two pieces of information about the system that is being filtered:
- A generative dynamics model, which determines how the state will change (possibly stochastically) over time, and
- An explicit model of the observation distribution.
The ParticleFilterModel
provides a standard structure for these two elements. The first parameter of the type, S
, specifies the state type. The constructor arguments are two functions. The first, f
, is the dynamics function, which produces the next state given the current state, control, and a random number generator as arguments. The second function, g
is describes the weight that should be given to the particle given the original state, control, final state, and observation as arguments. See the docstring below and the feedback control and filtering tutorials for more info.
ParticleFilters.jl
requires the rng
argument in the system dynamics functions for the sake of reproducibility independent of the simulation or control system.
The dynamics and reweighting models may also be specified separately using PredictModel
and ReweightModel
.
Note that a POMDP
with POMDPs.gen
and POMDPTools.ModelTools.obs_weight
implemented may also serve as a model.
Docstrings
ParticleFilters.ParticleFilterModel
— TypeParticleFilterModel{S}(f, g)
Create a system model suitable for use in a particle filter. This is a combination prediction/dynamics model and reweighting model.
Parameters
S
is the state type, e.g.Float64
,Vector{Float64}
Arguments
f
is the dynamics function.xₜ₊₁ = f(xₜ, uₜ, rng)
wherex
is the state,u
is the control input, andrng
is a random number generator.g
is the observation weight function.g(xₜ, uₜ, xₜ₊₁, yₜ₊₁)
returns the likelihood weight of measurement yₜ₊₁ given that the state transitioned fromxₜ
toxₜ₊₁
when control uₜ was applied. These weights need not be normalized (and, for performance, usually should not be).
ParticleFilters.PredictModel
— TypePredictModel{S}(f::Function)
Create a prediction model for use in a BasicParticleFilter
See ParticleFilterModel
for descriptions of S
and f
.
ParticleFilters.ReweightModel
— TypeReweightModel(g::Function)
Create a reweighting model for us in a BasicParticleFilter
.
See ParticleFilterModel
for a description of g
.