Structured diagnostic flags from a fit result

Description

Returns a named list of diagnostic data frames covering IWRES autocorrelation and parameter shrinkage. Designed to be inspected programmatically or used as the basis for custom plots.

Usage

check_diagnostics(fit)

Arguments

  • fit: A ferx_fit object returned by [ferx_fit](ferx_fit.qmd).

Seealso

Other diagnostics: [ferx_cor_matrix](ferx_cor_matrix.qmd)(), [ferx_cov_screen](ferx_cov_screen.qmd)(), [ferx_estimates](ferx_estimates.qmd)(), [ferx_eta_cov](ferx_eta_cov.qmd)(), [ferx_plot_trace](ferx_plot_trace.qmd)(), [ferx_runlog_iters](ferx_runlog_iters.qmd)(), [ferx_trace](ferx_trace.qmd)(), [ferx_warnings](ferx_warnings.qmd)(), [summary.ferx_fit](summary.ferx_fit.qmd)()

Concept

diagnostics

Value

A named list with elements:

  • autocorrelation: 1-row data frame: dw_statistic, lag1_r, flag (character interpretation of the DW value). NULL when no IWRES autocorrelation data is available.
  • shrinkage: Data frame with columns param, type ("eta" or "eps"), shrinkage (proportion 0-1), shrinkage_pct (percentage). NULL when no shrinkage data is available.

Examples

ex  <- ferx_example("warfarin")
fit <- ferx_fit(ex$model, ex$data)
diag <- check_diagnostics(fit)
diag$autocorrelation
diag$shrinkage