Compute a log likelihood based on a dynamical model, either from particle filter (created with dust_filter_create) or a deterministic model (created with dust_unfilter_create).
Usage
dust_likelihood_run(
obj,
pars,
initial = NULL,
save_trajectories = FALSE,
save_snapshots = NULL,
adjoint = NULL,
index_state = NULL,
index_group = NULL
)Arguments
- obj
A
dust_filterobject, created by dust_filter_create or adust_unfilterobject created by dust_unfilter_create- pars
Optional parameters to compute the likelihood with. If not provided, parameters are not updated
- initial
Optional initial conditions, as a matrix (state x particle) or 3d array (state x particle x group). If not provided, the system initial conditions are used.
- save_trajectories
Logical, indicating if the trajectories from the simulation history should be saved while the simulation runs; this has a small overhead in runtime and in memory. Particle trajectories will be saved at each time for which you have data. If
index_stateis non-NULL, the trajectories are limited to these states.- save_snapshots
Optional vector of times at which we should record snapshots of the entire state of the system.
- adjoint
Optional logical, indicating if we should enable adjoint history saving. This is enabled by default if your model has an adjoint, but can be disabled or enabled even when your model does not support adjoints! But if you don't actually have an adjoint you will not be able to compute gradients. This has no effect for stochastic models.
- index_state
An optional vector of state indices to save where
save_trajectoriesisTRUE. If omitted all state is saved and ifsave_trajectories = FALSEthis has no effect.- index_group
An optional vector of group indices to run the calculation for. You can use this to run a subset of possible groups, once
objis initialised (this argument must beNULLon the first call).
