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 generate_s and obs_weight implemented may also serve as a model.
Docstrings
ParticleFilterModel{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
Sis the state type, e.g.Float64,Vector{Float64}
Arguments
fis the dynamics function.xₜ₊₁ = f(xₜ, uₜ, rng)wherexis the state,uis the control input, andrngis a random number generator.gis 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 — Type.PredictModel{S}(f::Function)Create a prediction model for use in a BasicParticleFilter
See ParticleFilterModel for descriptions of S and f.
ParticleFilters.ReweightModel — Type.ReweightModel(g::Function)Create a reweighting model for us in a BasicParticleFilter.
See ParticleFilterModel for a description of g.