Particle Filter
cuthbert.smc.particle_filter
Implements the generic particle filter.
See Algorithm 10.1, Chopin and Papaspiliopoulos, 2020.
build_filter(init_sample, propagate_sample, log_potential, n_filter_particles, resampling_fn, ess_threshold)
Builds a particle filter object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
init_sample
|
InitSample
|
Function to sample from the initial distribution \(M_0(x_0)\). |
required |
propagate_sample
|
PropagateSample
|
Function to sample from the Markov kernel \(M_t(x_t \mid x_{t-1})\). |
required |
log_potential
|
LogPotential
|
Function to compute the log potential \(\log G_t(x_{t-1}, x_t)\). |
required |
n_filter_particles
|
int
|
Number of particles for the filter. |
required |
resampling_fn
|
Resampling
|
Resampling algorithm to use (e.g., systematic, multinomial). |
required |
ess_threshold
|
float
|
Fraction of particle count specifying when to resample. Resampling is triggered when the effective sample size (ESS) < ess_threshold * n_filter_particles. |
required |
Returns:
| Type | Description |
|---|---|
Filter
|
Filter object for the particle filter. |