The quantities a trace plot is read for, computed rather than drawn.
For each chain and each iteration \(t\) the cumulative statistics of
the draws so far are reported: the running mean
\(m_t = t^{-1}\sum_{s \le t} x_s\), and the running sample quantiles
of \(x_1, \ldots, x_t\) at probs. A chain that has converged
shows these settling to horizontal lines; a chain that has not shows
them still drifting. Comparing the lines across chains is the visual
form of the between-chain comparison Gelman–Rubin makes numerically.
Usage
Baytrace(chains, probs = c(0.025, 0.5, 0.975))Value
Named list with running_mean (one numeric vector per
chain), bands (per chain, a list of one numeric vector per
probability), probs, n_chains, n_iter,
final_mean, method.
Details
The running quantiles are the cumulative quantiles
coda::cumuplot draws, computed with the type-7 definition that
is the default of quantile, so that both arms and coda agree.
The statistics are cumulative and unsmoothed: nothing is thinned, no burn-in is discarded, and the first few iterations are reported as they are even though a quantile of one or two draws is nearly meaningless.
Mirrors morie.fn.baytrace on the Python side.
