Skip to contents

Create an "unfilter" object, which can be used to compute a deterministic likelihood following the same algorithm as the particle filter, but limited to a single particle. The name for this method will change in future.

Usage

dust_unfilter_create(
  generator,
  time_start,
  data,
  n_particles = 1,
  n_groups = NULL,
  dt = 1,
  n_threads = 1,
  index_state = NULL,
  preserve_particle_dimension = FALSE,
  preserve_group_dimension = FALSE
)

Arguments

generator

A system generator object, with class dust_system_generator

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. Typically this is 1, but you can run with more than 1 if you want - currently they produce the same likelihood but if you provide different initial conditions then you would see different likelihoods.

n_groups

Optionally, the number of parameter groups

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.

n_threads

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

index_state

An optional index of states to extract. If given, then we subset the system state on return. You can use this to return fewer system states than the system ran with, to reorder states, or to name them on exit (names present on the index will be copied into the rownames of the returned array).

preserve_particle_dimension

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

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.

Value

A dust_likelihood object, which can be used with dust_likelihood_run