Skip to content

ParticleFilter

class ParticleFilter < Object

Particle filter.

Member Variables

Name Description
f0:Model! Canonical particle from which others are initialized. Ensures that input is only consumed once.
f:Model![_] Particles.
w:Real[_] Log-weights.
e:Real[_] For each checkpoint, the effective sample size (ESS).
r:Boolean[_] For each checkpoint, was resampling performed?
Z:Real[_] For each checkpoint, the normalizing constant estimate up to that checkpoint.
T:Integer Number of checkpoints.
N:Integer Number of particles.
trigger:Real Relative ESS below which resampling should be triggered.

Member Functions

Name Description
sample Run the filter.
initialize Initialize the method.
start Start the filter.
step Step to the next checkpoint.
finish Finish the filter.
output Write output.
diagnose Write diagnostics.

Member Function Details

diagnose

function diagnose(writer:Writer?)

Write diagnostics.

  • diagnosticWriter: Writer for diagnostics.

finish

function finish()

Finish the filter.

initialize

function initialize(model:String, inputReader:Reader?, T:Integer, N:Integer, trigger:Real)

Initialize the method.

  • T: Number of checkpoints.
  • N: Number of particles.
  • trigger: Relative ESS below which resampling should be triggered.

output

function output(writer:Writer?)

Write output.

  • outputWriter: Writer for output.

sample

function sample(model:String, inputReader:Reader?, outputWriter:Writer?, diagnosticWriter:Writer?, M:Integer, T:Integer, N:Integer, trigger:Real, verbose:Boolean)

Run the filter.

  • model: Name of the model class.
  • inputReader: Reader for input.
  • outputWriter: Writer for output.
  • diagnosticWriter: Writer for diagnostics.
  • M: Number of samples.
  • T: Number of checkpoints.
  • N: Number of particles.
  • trigger: Relative ESS below which resampling should be triggered.

start

function start()

Start the filter.

  • model: Name of the model class.
  • inputReader: Reader for input.

step

function step(t:Integer)

Step to the next checkpoint.

  • t: Checkpoint number.