Skip to contents

Choices of sensealg for solve_gradient(), adjoint_sensitivities() and ODEForwardSensitivityProblem(), named as in SciMLSensitivity.jl.

Usage

ForwardSensitivity(autojacvec = NULL)

ForwardDiffSensitivity(autojacvec = NULL, convert_tspan = NULL)

InterpolatingAdjoint(
  autojacvec = NULL,
  checkpointing = FALSE,
  noisemixing = FALSE
)

BacksolveAdjoint(autojacvec = NULL, checkpointing = TRUE, noisemixing = FALSE)

QuadratureAdjoint(autojacvec = NULL, abstol = 1e-06, reltol = 0.001)

GaussAdjoint(autojacvec = NULL, checkpointing = FALSE)

GaussKronrodAdjoint(autojacvec = NULL, checkpointing = FALSE)

SteadyStateAdjoint(autojacvec = NULL)

ForwardDiffOverAdjoint(adjalg = InterpolatingAdjoint())

Arguments

autojacvec

NULL or TRUE use the symbolic derivatives of the System the problem was built from; FALSE uses finite differences. Problems built from R functions always use finite differences (or their jac_fn). The automatic differentiation backends of Julia (ZygoteVJP(), EnzymeVJP(), ReverseDiffVJP(), ...) have no R counterpart.

convert_tspan

Unused; kept for the Julia signature.

checkpointing

For InterpolatingAdjoint(), GaussAdjoint() and GaussKronrodAdjoint(): re-solve the forward problem between saved points instead of reading a dense forward solution. For BacksolveAdjoint(): reset the backward state to the saved forward values.

noisemixing

For the adjoints of SDEs with diagonal noise: use the full Jacobian of the noise (each noise term may depend on all states) instead of its diagonal; see SDEAdjointProblem(). The full Jacobian is also used without it when the noise Jacobian at u0 has entries off its diagonal.

abstol, reltol

Tolerances of the quadrature of QuadratureAdjoint().

adjalg

The first order adjoint method used inside.

Value

A sensitivity algorithm object.

Details

Forward methods integrate the sensitivity equations dS/dt = J S + f_p together with the state. ForwardSensitivity() differentiates with respect to the parameters; ForwardDiffSensitivity() (Julia's dual number method) differentiates with respect to the initial values and the parameters and is the forward method that supports events.

Adjoint methods solve the adjoint equation backward in time. InterpolatingAdjoint() integrates the adjoint state and the parameter gradient together, reading the forward state from the dense forward solution, or with checkpointing = TRUE from short re-solves between the saved points. BacksolveAdjoint() integrates the state backward along with the adjoint (with checkpointing = TRUE the state is reset to the saved forward values). QuadratureAdjoint() solves the adjoint state alone and integrates the parameter gradient afterwards by adaptive Gauss-Kronrod quadrature; GaussAdjoint() and GaussKronrodAdjoint() integrate it step by step with a Gauss-Legendre or Gauss-Kronrod rule on each step of the adjoint solve. SteadyStateAdjoint() differentiates steady states and roots of nonlinear problems by the implicit function theorem.

ForwardLSS(), AdjointLSS(), NILSS() and NILSAS() are the shadowing methods for long time averages of chaotic systems (see ForwardLSSProblem()). ForwardDiffOverAdjoint() names the second order method of second_order_sensitivities().

Examples

InterpolatingAdjoint(checkpointing = TRUE)
#> InterpolatingAdjoint(checkpointing = TRUE, noisemixing = FALSE)
GaussAdjoint()
#> GaussAdjoint(checkpointing = FALSE)
ForwardDiffSensitivity()
#> ForwardDiffSensitivity()