Skip to content

dse_research_utils: consolidate cross-project Bayesian report reporting helpers #46

Description

@frankbuckley

Note

Drafted by a LLM-based AI tool (Claude Code/Opus 4.8).

Proposal to move a small set of report-side reporting helpers into dse_research_utils so the two DSE Bayesian technical reports — language-reading-predictors (a randomised-trial report) and vocabulary-growth (a developmental-trajectory report) — share one implementation rather than drifting copies. Arising from a structural comparison of the two reports and a shared "DSE report house-style" note.

Already shared (working well)

dse_research_utils already hosts the infrastructure both projects build on:

  • statistics/models/reporting.ReportingConfiguration — the <id>-<config> output layout both reports read from.
  • statistics/models/sampling — the dev/test/reporting sampling presets.
  • statistics/intervals, plot/diagnostics_mcmc, plot/predictive, console/* formatting.

Candidates to move (currently duplicated / project-local)

  1. Evidence-strength + ROPE reporting helpers — a round-odds evidence ladder (qualifying the evidence, not the effect size), an odds_string, and a ROPE-anchored summary (pd, P(benefit ≥ δ), in-ROPE coverage, items-scale average marginal effect). Currently lives in language_reading_predictors/statistical_models/reporting.py; vocabulary-growth has its own reporting code. This is the house-style reporting convention — it belongs next to ReportingConfiguration.
  2. The _report_data data-access patternload_summary / show_or_pending graceful degradation so report chapters read fitted output identically (and degrade to a visible "pending fit" before a model is fitted). Could be a small dse_research_utils.report helper.
  3. A convergence-banner generator — a one-table R̂ / ESS / divergences summary across reported models, for the diagnostics gate.

Design constraints (please read before implementing)

  • Parameterise; do not one-size. The two reports use different interval conventions: the trial report uses equal-tailed intervals + a ROPE/δ decision; the trajectory report uses a 94% HDI with a typical-child-vs-individual predictive split and no ROPE. Shared helpers must take the interval kind (ETI/HDI) and whether a ROPE applies as parameters.
  • Fix a naming wart in the move: ReportingConfiguration.hdi actually stores the coverage probability and is used for both equal-tailed and HDI summaries — rename/clarify (e.g. ci_prob with an explicit interval_kind) when consolidating.
  • Keep project-local: model factories, the DAGs / estimands, per-model specs, the data schemas.

Consumers / coordination

This touches three repos: research (the move), and language-reading-predictors + vocabulary-growth (adopt the shared helpers, drop their copies). Suggest landing the research change first behind the existing module, then a follow-up PR in each report repo. Companion suggestion already filed: dseinternational/vocabulary-growth#82.

Happy to open the PRs.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions