Skip to content

Statistics Reference

Per-chain — SequenceStats

Returned by data.sequenceStats(variable, chain).

FieldTypeDescription
meannumberArithmetic mean
stdevnumberStandard deviation
countnumberNumber of draws
essnumberESS via FFT-based Geyer monotone estimator (single chain)
essPerDrawnumberess / count
mcsenumberMCSE = stdev / √ess
skewnessnumberStandardized third central moment
excessKurtosisnumberStandardized fourth central moment minus 3
autocorrelationnumber[]Autocorrelation values at lags 0, 1, 2, … (from FFT)

Note on standard deviation: The current implementation divides by n (population SD), not n-1 (sample SD). For typical MCMC chains (n ≥ 500) the difference is negligible. Skewness and kurtosis inherit this.

Per-variable — VariableStats

Returned by data.variableStats(variable). Aggregates across all chains.

FieldTypeDescription
meannumberGrand mean across all chains
stdevnumberSD of all draws pooled
countnumberTotal draws across all chains
essnumberSum of single-chain ESS values
essPerDrawnumberess / count
mcsenumberMulti-chain MCSE via bulk ESS
bulkEssnumberRank-normalized bulk ESS (Vehtari 2021)
tailEssnumberTail ESS for extremes (Vehtari 2021)
rhatnumber | undefinedRank-normalized R-hat = max(bulk, tail). undefined if < 2 chains
splitRhatnumber | undefinedSimple split R-hat
geweke{ z, pValue }Geweke convergence test on pooled draws
skewnessnumberSkewness of all draws pooled
excessKurtosisnumberExcess kurtosis of all draws pooled
quantiles{ q5, q25, q50, q75, q95 }Posterior quantiles
hdi90[number, number]90% Highest Density Interval
hdi90WidthnumberWidth of the 90% HDI

summary()

Returns VariableSummary[] — one row per variable, each row is { variable: string } & VariableStats.

typescript
const rows = data.summary();
// rows[0] = { variable: 'mu', mean: 1.23, rhat: 1.001, bulkEss: 4523, ... }

This is the data source for summaryTable() and the mcmc summary CLI command.

Released under the MIT License.