
Set up an nlm-family objective for repeated hook-firing evaluation
Source:R/nlm.R
nlmObjectiveSetup.RdPreprocesses the data and LOADS the nlm population (predOnly) problem into the
C++ engine, so that repeated nlmSolveR(theta) calls evaluate the
population objective – firing any registered likelihood-contribution hook
(e.g. a plugin's per-observation cotangent capture) – WITHOUT re-running the
optimizer. One compiled setup is reused across evaluations. Intended for
extension packages (e.g. nlmixr2nn) that optimize an out-of-band parameter
block (network weights injected via a par-loader) and need the exact
error-model cotangent from the nlm C++ solve at each iterate. Free the loaded
problem with .nlmFreeEnv() when done.
Usage
nlmObjectiveSetup(
ui,
data,
control = NULL,
gradient = FALSE,
scale = c("control", "natural"),
likPenalty = NULL
)Arguments
- ui
rxode2/nlmixr2 model. Uses
ui$controlwhen present.- data
event data.
- control
optional nlm-family control; defaults to
nlmControl()(orui$controlif that is an nlm-family control).- likPenalty
optional list of [nlmixr2LikPenaltySpec()] objects added to those attached to the model; active until
.nlmFreeEnv().