
Build the symbolic part of an adjoint objective gradient (compile once)
Source:R/adjoint.R
dot-rxAdjointGradBuild.RdPerforms 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.
Arguments
- object
model definition accepted by
rxode2()(text,rxode2object, 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
NULLfor least squares, or a list with character entriesaddand/orpropnaming the additive / proportional residual-error parameters, selecting the FOCEi -2LL objectivev = add^2 + (prop*f)^2.
Value
an opaque list consumed by .rxAdjointGradEval().