Skip to contents

Performs all symbolic work (symengine differentiation, rxFromSE, model compilation) up front and returns a reusable object for .rxAdjointGradEval(), so an optimiser evaluates the gradient at many parameter values without re-running symbolic code. Build before any rxSolve to avoid a load_all-only symengine dispatch fragility.

Usage

.rxAdjointGradBuild(object, calcSens, pred, events, errModel = NULL)

Arguments

object

model definition accepted by rxode2() (text, rxode2 object, or function/ui).

calcSens

character vector of parameter names to differentiate with respect to.

pred

character prediction expression f (function of states and parameters), e.g. "center/v".

events

event table / data used to define dosing.

errModel

NULL for least squares, or a list with character entries add and/or prop naming the additive / proportional residual-error parameters, selecting the FOCEi -2LL objective v = add^2 + (prop*f)^2.

Value

an opaque list consumed by .rxAdjointGradEval().

Author

Matthew L. Fidler