trace_plot: Trace plots with automatic poor-mixing highlighting

View source: R/plot_methods.R

trace_plotR Documentation

Trace plots with automatic poor-mixing highlighting

Description

Produces per-parameter trace plots from a smoothbp_fit object. Parameters with \hat{R} > 1.05 are flagged with a light-red background and their panel labels include the \hat{R} value and a warning symbol. Parameters with low bulk-ESS (< 100) are further annotated.

Usage

trace_plot(
  fit,
  pars = NULL,
  type = "trace",
  rhat_thresh = 1.05,
  ess_thresh = 100
)

Arguments

fit

A smoothbp_fit object.

pars

Character vector of parameter names to include. Defaults to all non-random-effect parameters.

type

One of "trace" (default), "density", or "both".

rhat_thresh

Rhat threshold above which a parameter is flagged as poorly mixing. Default 1.05.

ess_thresh

Bulk-ESS threshold below which a parameter is flagged. Default 100.

Value

A ggplot object (or a named list of two when type = "both").


smoothbp documentation built on June 14, 2026, 9:06 a.m.