Skip to contents

Fetch the last gradient created by running an likelihood. This errors if the last call to dust_likelihood_run did not use adjoint = TRUE. The first time you call this (after a particular set of parameters) it will trigger running the reverse model.

Usage

dust_likelihood_last_gradient(obj, index_group = NULL)

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).

Value

A vector (if ungrouped) or a matrix (if grouped).