Skip to contents

Create a particle filter object

Usage

dust_filter_create(
  generator,
  time_start,
  data,
  n_particles,
  n_groups = NULL,
  dt = NULL,
  ode_control = NULL,
  shared_data = FALSE,
  n_threads = 1,
  preserve_group_dimension = FALSE,
  seed = NULL
)

Arguments

generator

A system generator object, with class dust_system_generator. The system must support compare_data to be used with this function.

time_start

The start time for the simulation - this is typically before the first data point. Must be an integer-like value.

data

The data to fit to. This can be a data.frame, in which case it will be passed into dust_filter_data for validation, or it can be a dust_filter_data-augmented data.frame. The times for comparison will be taken from this, and time_start must be no later than than the earliest time.

n_particles

The number of particles to run. Larger numbers will give lower variance in the likelihood estimate but run more slowly.

n_groups

The number of parameter groups. If NULL, this will be taken from data. If given, then the number of groups in data will be checked against this number.

dt

The time step for discrete time systems, defaults to 1 if not given. It is an error to provide a non-NULL argument with continuous-time systems.

ode_control

The ODE integration control for continuous time systems. Defaults to the default return of dust_ode_control. It is an error to provide this with discrete-time systems.

shared_data

Logical, indicating if data is shared among all groups.

n_threads

Integer, the number of threads to use in parallelisable calculations. See Details.

preserve_group_dimension

Logical, indicating if state and output from the system should preserve the group dimension in the case where a single group is run. In the case where more than one group is run, this argument has no effect as the dimension is always preserved.

seed

Optionally, a seed. Otherwise we respond to R's RNG seed on initialisation.

Value

A dust_likelihood object, which can be used with dust_likelihood_run