Generates up to four diagnostic panels:
Arguments
- x
An
admFitobject returned bynlmixr2()withest = "admc"orest = "adirmc".- which
Character vector selecting which panel types to produce. Any subset of
c("mean", "cov", "nll", "par"). Defaults to all four.- n_sim
Number of MC samples for the final prediction. Defaults to the value used during fitting. Only used when
"mean"or"cov"is inwhich.- seed
Random seed for reproducibility.
- ...
Unused.
Details
"mean"– Observed vs predicted mean per study (2x2 grid). Upper row: observed and predicted mean lines with +/-1 SD ribbon on a shared y scale (black throughout). Lower row: raw residual lollipop with +/-2 SE band and standardised residual z-scores with +/-1.96 reference lines."cov"– Observed vs predicted (co)variance heatmaps per study (2x2 grid). Upper row shares a common colour scale (blue-white-red). Lower row uses distinct diverging scales: residual (red-white-green) and standardised residual (gold-white-purple). Significance stars overlaid on the standardised residual panel."nll"– NLL trace per restart over optimizer evaluations. Restarts coloured with the Okabe-Ito palette."par"– Parameter trace per restart on the natural scale (struct thetas back-transformed, sigma as SD, omega diagonal as variance labelledV(eta.x)). Facets ordered as in the modelini()block. Restarts coloured with the Okabe-Ito palette.
Examples
if (FALSE) { # \dontrun{
fit <- nlmixr2(model, admData(), est = "admc", control = admControl(...))
# All panels (default)
plots <- plot(fit)
# Only mean and covariance diagnostics
plot(fit, which = c("mean", "cov"))
# Only traces (no MC simulation needed -- fast)
plot(fit, which = c("nll", "par"))
# Access a specific panel from the returned list
plots$mean_study1 # mean diagnostics for the study named "study1"
plots$cov_study1 # covariance heatmap for "study1"
plots$nll_trace # NLL trace
plots$par_trace # parameter trace
} # }