Skip to contents

Produce histogram plots (via ggplot2) for a single metric such as Effective Sample Size (ESS), Computational Efficiency (CE = ESS/s), Algorithmic Efficiency (AE = ESS per draw), or the Gelman-Rubin statistic Rhat (often shifted as Rhat - 1 for visual clarity).

Usage

plot_mcmc_histograms(
  samples,
  runtime_s,
  rhat_thresh = 1.01,
  bins = 30,
  log_x = TRUE
)

Arguments

samples

A coda::mcmc.list or compatible object.

runtime_s

Numeric runtime in seconds (used to compute CE metrics).

rhat_thresh

Numeric threshold used to flag Rhat deviations.

bins

Integer number of histogram bins (default typically 30).

log_x

Logical; if TRUE, x-axis is log-transformed.

Value

A list of ggplot histograms.

A ggplot histogram object.

Details

The function expects a data frame containing at least one numeric column whose name is supplied via metric. A histogram is then generated using a harmonised style consistent with other diagnostic plots in the package.