Skip to contents

Get the last state from a likelihood.

Usage

dust_likelihood_last_state(
  obj,
  index_group = NULL,
  select_random_particle = FALSE
)

Arguments

obj

A dust_filter object, created by dust_filter_create or a dust_unfilter object created by dust_unfilter_create

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 obj is initialised (this argument must be NULL on the first call).

select_random_particle

Logical, indicating if we should return a history for one randomly selected particle (rather than the entire history). If this is TRUE, the particle will be selected independently for each group, if the object is grouped. This option is intended to help select a representative trajectory during an MCMC. When TRUE, we drop the particle dimension of the return value.

Value

An array. If ungrouped this will have dimensions state x particle, and if grouped then state x particle x group. If select_random_particle = TRUE, the second (particle) dimension will be dropped. This is the same as the state returned by dust_likelihood_last_history without the time dimension but also without any state index applied (i.e., we always return all state).