Skip to content

ParticleFilter


class ParticleFilter

Particle filter.

classDiagram ParticleFilter <|-- AliveParticleFilter ParticleFilter <|-- MoveParticleFilter ParticleFilter <|-- ConditionalParticleFilter link ParticleFilter "../ParticleFilter/" link AliveParticleFilter "../AliveParticleFilter/" link MoveParticleFilter "../MoveParticleFilter/" link ConditionalParticleFilter "../ConditionalParticleFilter/"

Member Variables

Name Description
x:Particle[_] Particles.
w:Real[_] Log weights.
a:Integer[_] Ancestor indices.
b:Integer Chosen particle index. This is used for drawing a single particle from the filter in e.g. ParticleSampler, and for the reference particle in e.g. ConditionalParticleFilter.
lsum:Real Logarithm of sum of weights.
ess:Real Effective sample size.
lnormalize:Real Log normalizing constant.
npropagations:Integer Number of propagations. This is not the same as the number of particles; the number of propagations performed may, according to the filter type, differ from the number of particles, such as for alive and rejection control particle filters.
raccepts:Real Accept rate of moves.
nparticles:Integer Number of particles.
trigger:Real Threshold for resampling. Resampling is performed whenever the effective sample size, as a proportion of N, drops below this threshold.
delayed:Boolean Should delayed sampling be used?

Member Functions

Name Description
particle Create a particle of the type required for this filter.
filter Start filter.
filter Step filter.
simulate Start particles.
simulate Step particles.
reduce Compute reductions, such as effective sample size and normalizing constant estimate.
resample Resample particles.
copy Copy particles during resampling.

Member Function Details

copy

function copy()

Copy particles during resampling.

filter

function filter(model:Model, input:Buffer)

Start filter.

  • model: Model.
  • input: Optional input buffer.

function filter(t:Integer, input:Buffer)

Step filter.

  • t: The step number, beginning at 1.
  • input: Optional input buffer.

particle

function particle(model:Model) -> Particle

Create a particle of the type required for this filter.

reduce

function reduce()

Compute reductions, such as effective sample size and normalizing constant estimate.

resample

function resample()

Resample particles.

simulate

function simulate(input:Buffer)

Start particles.

function simulate(t:Integer, input:Buffer)

Step particles.