particle_filter: Run a particle filter

View source: R/particle.R

particle_filterR Documentation

Run a particle filter

Description

Run a particle filter

Usage

particle_filter(
  data,
  model,
  compare,
  n_particles,
  forecast_days = 0,
  save_particles = FALSE,
  full_output = FALSE,
  save_sample_state = FALSE,
  save_end_states = FALSE
)

Arguments

data

Data to fit to. This must be constructed with particle_filter_data

model

An odin model, used to generate stochastic samples

compare

A function to generate log-weights

n_particles

Number of particles

forecast_days

Number of days to forecast forward from end states. Requires that save_particles is TRUE.

save_particles

Logical, indicating if we save full particle histories (this is slower).

full_output

Logical, indicating whether the full model output, including the state and the declared outputs are returned. Deafult = FALSE

save_sample_state

Logical, indicating whether we should save a single particle, chosen at random, at the final time point for which we have data

save_end_states

Logical, indicating whether we should save all particles at the final time point for which we have data


mrc-ide/squire documentation built on Sept. 10, 2022, 1:11 a.m.