Goal
Establish systematic reference-value testing for deterministic MCMC diagnostic functions (ar(), ac(), ess(), statistics(), gelmanRubin()) to verify their numerical accuracy against canonical implementations and document their truncation conventions.
Scope
- Fixed synthetic chains as test inputs — AR(1) sequences with known theoretical autocorrelation, plus iid and strongly-correlated sequences. Synthetic chains allow reference values derived from theory rather than just comparing against another implementation.
- Reference values from R (
coda::effectiveSize, coda::gelman.diag) and/or Stan's posterior package, recorded with package versions and exact calls.
- Document the truncation convention ranjs uses for
ac()/ess() and state explicitly whether it matches coda, Stan, both, or neither.
- Cover
ar() (acceptance rate), ac() (autocorrelation), ess() (effective sample size), statistics() (summary statistics), and gelmanRubin() (R-hat convergence diagnostic).
Acceptance Criteria
Out of Scope
- Sampler kernel correctness or joint-distribution validation.
- Changing the ESS truncation rule — measure and document first; any rule change is a separate issue.
run-chains and parallel-tempering orchestration behaviour.
Notes
Complements #1224 (single hand-computed gelmanRubin reference) by making the coverage systematic. A disagreement with coda or Stan on ess() is not automatically a bug — the conventions genuinely differ — but the deliverable is knowing which convention is implemented and documenting it.
Goal
Establish systematic reference-value testing for deterministic MCMC diagnostic functions (
ar(),ac(),ess(),statistics(),gelmanRubin()) to verify their numerical accuracy against canonical implementations and document their truncation conventions.Scope
coda::effectiveSize,coda::gelman.diag) and/or Stan'sposteriorpackage, recorded with package versions and exact calls.ac()/ess()and state explicitly whether it matches coda, Stan, both, or neither.ar()(acceptance rate),ac()(autocorrelation),ess()(effective sample size),statistics()(summary statistics), andgelmanRubin()(R-hat convergence diagnostic).Acceptance Criteria
ar,ac,ess,statistics,gelmanRubin) against fixed synthetic chains with documented sources.ac/esstruncation convention is identified and documented in the test file, with explicit statement of whether it matches coda, Stan, both, or neither.npm run standardandnpm testpass with coverage thresholds met.Out of Scope
run-chainsandparallel-temperingorchestration behaviour.Notes
Complements #1224 (single hand-computed
gelmanRubinreference) by making the coverage systematic. A disagreement with coda or Stan oness()is not automatically a bug — the conventions genuinely differ — but the deliverable is knowing which convention is implemented and documenting it.