The ParticleFilter Module

ParticleFilterModule
ParticleFilter.jl

This is the bones for a discrete-time particle filter that I built to infer the infection numbers based on wastewater surveillance data

source

Module Index

Detailed API

ParticleFilter.FilterType
Filter(T::Real,particles::Vector{Particle},Measurements::DataFrame,MeasurementModel::Function,DynamicModel::Function)
  • T - Time
  • particles - Vector of particles
  • Measurements - DataFrame of measurements
  • MeasurementModel - A function that takes a DataFrameRow and a particle and outputs a real number
  • DynamicModel - An inplace function that mutates a particle
source
ParticleFilter.iterated_filtering!Method
iterated_filtering(p::Filter,)

Implements an iterated particle filter, which varies the parameters along with the state variables to try to converge to parameters that give the maximum log likelihood.

Returns parameters

source
ParticleFilter.multinomial_sampling!Method
multinomial_sampling!(p::Filter)

Resamples particles using a multinomial sampling procedure. If n is the number of particles, then this draws n samples from a multinomial distribution defined using the weights of the particles

source
ParticleFilter.percentile_sampling!Method
percentile_sampling(particle_filter,measurement;q::Float64)

resamples the particles based on the current measurement. Particles with a weight in the lowest q-th percentile are dropped and replaced by particles with the highest percentile.

source
ParticleFilter.quantMethod
quant(particle_filter,q::Float64)

Determines the weight that separates the particles into two groups

source
ParticleFilter.run_filter!Method
run_filter!(p::Filter)

updates the filter so that T is equal to the number of rows in the measurements dataframe. Returns a FilterHistory

source
ParticleFilter.update!Method
update!(p::Filter)

Move the particle filter forward one time-step. The particles are propogated using the dynamic model, and their weights updated using the measurement model. The particle weights are normalized so that they sum to 1, and then particles are resampled from a multinomial distribution.

source