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.
ess:Real Effective sample size.
lsum:Real Logarithm of sum of weights.
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.
raccept:Real Accept rate of moves.
nsteps:Integer? Number of steps. If this has no value, the model will be required to suggest an appropriate value.
nforecasts:Integer Number of additional forecast steps per step.
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
size Size.
particle Create a particle of the type required for this filter.
initialize Initialize filter.
filter Filter first step.
filter Filter one step.
propagate Start particles.
propagate Step particles.
forecast Forecast particles.
reduce Compute reductions, such as effective sample size and normalizing constant estimate.
resample Resample particles.
write Write only the current state to a buffer.

Member Function Details

filter

function filter()

Filter first step.

function filter(t:Integer)

Filter one step.

  • t: The step number, beginning at 1.

forecast

function forecast(t:Integer)

Forecast particles.

initialize

function initialize(archetype:Model)

Initialize filter.

  • archetype: Archetype. This is an instance of the appropriate model class that may have one more random variables fixed to known values, representing the inference problem (or target distribution).

particle

function particle(archetype:Model) -> Particle

Create a particle of the type required for this filter.

propagate

function propagate()

Start particles.

function propagate(t:Integer)

Step particles.

reduce

function reduce()

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

resample

function resample(t:Integer)

Resample particles.

size

function size() -> Integer

Size. This is the number of steps of filter(Model, Integer) to be performed after the initial call to filter(Model). Note that initialize() must be called before size().

write

function write(buffer:Buffer, t:Integer)

Write only the current state to a buffer.