Explore fitted process deviations and joint-sample residuals
Source:R/plot-process.R
plot_process_deviations.RdThese plots consume a single tidy_tam() result. They never
refit a model or draw another sample. Recruitment uses signed line plots;
N/F/M use selectable matrices or diagnostic bubbles.
Arguments
- out
A result from
tidy_tam().- component
Either
"NFM"for selectable N/F/M matrices or bubbles, or"Recruitment"for a recruitment line plot.
Details
Fitted deviations retain their original log scale: departures from
cohort/mean predictions for IID/AR1 and annual increments for RW/cor_rw.
Recruitment retains the residual definition in tidy_recruitment(). Available
recruitment intervals describe fitted deviations, not diagnostic draws.
Joint-sample residuals are standardized innovations, evaluated at the fitted mode and perturbed using the AD Jacobian and one draw from the joint Gaussian parameter uncertainty. This is a local Gaussian diagnostic approximation, not a posterior simulation or an independent draw for each process. Zero and +/-2 lines aid interpretation; no confidence ribbons are attached to diagnostic draws. Missing/invalid joint uncertainty is reported explicitly.
Each call returns one plot; the dashboard supplies its dropdown containers. N/F/M buttons retain the selected model. Signed matrices share symmetric colour ranges across models within a component and have no logarithmic scale. Blocked F and M use unique, ordered state blocks. Bubble areas use absolute residuals with one scale across all components/models; orange is negative and navy is positive.
Examples
if (FALSE) { # \dontrun{
out <- tidy_tam(scaa, sam, ncam, process_seed = 123456L)
plot_process_deviations(out)
plot_process_residuals(out)
plot_process_deviations(out, component = "Recruitment")
plot_process_residuals(out, component = "Recruitment")
out$process_residuals$status
} # }