Control stream of derivatives for the linearization of a base model
Source:R/nm_optimize_base.R
nm_derivatives_ctl.RdWrites a copy of a base control stream that evaluates the model once at the
final estimates (MAXEVAL=0, all parameters FIX) and tabulates, for every
record, the individual prediction and the derivatives of Y with respect to
the ETAs (G_ETAk), the EPSs (H_EPSj) and the cross derivatives
(D_EPSj_ETAk, interaction). The derivatives are read through verbatim code
(G(k,1), HH(j,1), HH(j,k+1) in $ERROR; G and H in $PRED)
placed at the end of the block ("LAST), as in the PsN linearize tool.
The table is the input of level 2 of nm_optimize_base().
Arguments
- run
Run directory of the base model (e.g.
"run1.reg") or path prefix ("dir/run1") whose.ctland.extfiles are used.- output_dir
Directory of the new control stream (formerly
out_dir, still accepted with a warning). Default: the analysis directory (parent of a.reg/.nm7run directory), so that the$DATApath keeps the convention ofnm_run().- name
Name of the new run. Default
"<run>_deriv".- extra
Additional data items to tabulate (e.g. an occasion column
"OCC"for inter-occasion variability). Items absent from$INPUTare dropped with a warning.- ...
Former argument name, accepted with a warning until version 1.0:
out_dir(nowoutput_dir).
Details
Not testable without NONMEM: the verbatim code follows the
NONMEM help (ERROR: G(i,1) is the partial derivative of F with respect
to ETA(i); HH(j,1) with respect to EPS(j); HH(j,i+1) the second
derivative with respect to EPS(j) and ETA(i)). Models with F_FLAG
(M3 likelihood) or simulation-only records are not supported.