Skip to content

ParticleFilter


class ParticleFilter

Particle filter.

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

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.
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?
autodiff:Boolean Should automatic differentiation be used?

Member Functions

Name Description
particle Create a particle of the type required for this filter.
filter Start filter.
filter Step 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.
move Move 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: Input buffer.

function filter(t:Integer, input:Buffer)

Step filter.

  • t: Step number, beginning at 1.
  • input: Input buffer.

function filter(t:Integer, input:Buffer, κ:Kernel)

Step filter.

  • t: Step number, beginning at 1.
  • input: Input buffer.
  • κ: Markov kernel.

move

function move(t:Integer, κ:Kernel)

Move particles during resampling.

  • t: Step number.
  • κ: Markov kernel.

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(t:Integer)

Resample particles.

  • t: The step number.

simulate

function simulate(input:Buffer)

Start particles.

function simulate(t:Integer, input:Buffer)

Step particles.