Repository navigation
Release 0.6.0: repeated-measures toolkit, reproduction model, forest/PPC plots, lapse-regression fix - #8
Merged
Conversation
…s, forest plots, lapse-regression fix - ReproductionModel / ReproductionRegressionModel: log-space Bayesian observer for reproduction tasks (e.g. interval timing). Response SD is the SD of the posterior MEAN across trials (w*nu), not the within-trial posterior SD. Optional fit_prior_sd (identified from slope + spread), fit_motor_noise, lapse mixture, ppc(). - RegressionModel.conditionwise_draws: natural-scale draws per condition in long format (group or per subject). - RegressionModel: refuse rank-deficient designs (e.g. baseline always in session 1 with C(session)). - Fix: *LapseRegressionModel built p_lapse as an untransformed Normal(0, .5) since the Beta lapse prior became the default (8345d8a); regression models now use the logit-normal group prior with a wide between-subject SD. - PsychophysicalRegressionModel accepts fixed_regressors/random_regressors. - bauer.utils: summarize_posterior, contrast_draws, posterior_draws, ppc_summary, ppc_observed, ppc_coverage, convergence_report, set_house_style, plot_forest, plot_sorted_forest, plot_ppc_panels, plot_ppc_overlay, plot_subject_ppc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ent bias; document constant CV and skew Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t wrong output - contrast_draws: explicit keys, raises on unknown reference, varying extra columns, duplicate rows; preserves level order - summarize_posterior: raises on NaN draws / NaN keys; warns on pooled rows and < 100 draws - ppc_coverage: raises on unmatched or duplicated cells - posterior_draws: refuses regression parameters (use conditionwise_draws) - conditionwise_draws: checks parameter names and duplicate conditions - convergence_report: includes *_sd, NaN r-hat fails, names the worst variable, handles missing *_mu / sample_stats, verdict in attrs['ok'] - RegressionModel warns when random effects are not identified within any subject (e.g. condition + session trend, one condition per session) - plots: one vocabulary (by / order / palette / level_labels / xlabel[s]), input validation, lines sorted by x, plot_subject_ppc returns a Figure and labels panels by subject id correctly Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…0 on psychometric curves) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…into the default group-level check Subject-level parameters can end in '_sd' or '_mu' themselves (n1_evidence_sd, prior_sd, prior_mu), so the name-suffix filter pulled every subject's value into the default check. On lesson 1's MagnitudeComparisonModel this reported 'worst: n2_evidence_sd[13]' and a min ESS of a subject-level parameter. Now also require no 'subject' dimension; regression test added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…olled code - Lesson 1: conditionwise_draws + summarize_posterior for nu(n1); a convergence_report cell; nu1/nu2 via posterior_draws + summarize_posterior, group forest (plot_forest) and subject sorted forest (plot_sorted_forest) instead of get_subject_posterior_df + FacetGrid; scatter uses the same summary (95% HDI instead of equal-tailed 3-97%). PPC rewritten with ppc_summary / ppc_observed / ppc_coverage + plot_ppc_panels, plot_ppc_overlay and a new subject-level plot_subject_ppc; this also fixes the generator, whose PPC cell still used the removed ppc(var_names=...) API. Notes the 61% group coverage (misfit at small n1). - Lesson 2: format effect via conditionwise_draws, contrast_draws and plot_forest instead of get_conditionwise_parameters + KDEs. - Lesson 8: convergence_report for the diagnostics; ISI effect via conditionwise_draws / summarize_posterior / contrast_draws / plot_forest (was mean/median + equal-tailed percentiles labelled HDI, and KDEs). - Lesson 9: convergence_report for the DDM and RDM diagnostics. All four notebooks regenerated with make_notebooks.py and executed (lessons 8/9 from the cached fits in ~/.bauer_tutorial_cache). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, 0.6.0 history - docs/usage.rst: the long-draws convention, convergence_report, group forest + contrasts, subject sorted forest, group/subject PPC + coverage, figure style - docs/api_reference.rst: ReproductionModel / ReproductionRegressionModel, conditionwise_draws, summaries, diagnostics and the new plot functions (plus the existing summarize_ppc_group) - docs/concepts.rst: typical workflow uses convergence_report and summarize_posterior, links to the new section - HISTORY.rst: 0.6.0 (unreleased) entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-measures-helpers
…ences=) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…HalfNormal group SD is the default Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tools for within-subject repeated-measures designs (e.g. baseline / placebo / doses over sessions): a Bayesian observer for reproduction tasks, tidy posterior and posterior-predictive summaries, house-style forest and PPC plots, and a fix for lapse rates in regression models.
Added
bauer.models.ReproductionModel/ReproductionRegressionModel: log-space Bayesian observer for reproduction tasks (e.g. interval timing). Measurement m ~ N(log x, ν²), Gaussian prior N(μ_p, σ_p²), response = posterior mean, uniform lapse. The response SD is the SD of the posterior mean across trials, w·ν (not the within-trial posterior SD √w·ν). Fitsnu,prior_mu(default) and optionallyprior_sd(fit_prior_sd=True, identified from slope + spread),bias(instead ofprior_mu) andsigma_motor. Ownppc()returningsimulated_response.RegressionModel.conditionwise_draws(idata, conditions, parameters, group=True): natural-scale parameter draws per condition (group or every subject), long format.bauer.utilssummaries:summarize_posterior(posterior mean, 95% HDI, P(> 0)),contrast_draws(per-draw differences from a reference level),posterior_draws,ppc_summary/ppc_observed/ppc_coverage(two-step group or subject-level PPC summaries and coverage),convergence_report.bauer.utilsplots:set_house_style,plot_forest(group forest plot),plot_sorted_forest(subject-level sorted forest plot per condition),plot_ppc_panels,plot_ppc_overlay,plot_subject_ppc. Shared argumentsby/order/palette/level_labels; dotted reference lines viaref/xref.PsychophysicalRegressionModelacceptsfixed_regressors/random_regressors.Fixed
*LapseRegressionModel(Psychophysical, MagnitudeComparison, Risk): since the Beta lapse group prior became the default (8345d8a, 2026-06-09), the regression path builtp_lapseas an untransformedNormal(0, 0.5)that could leave (0, 1). Regression models now use the logit-normal lapse prior with a wide between-subject SD. Re-fit lapse-regression fits made since 2026-06-09.Changed
RegressionModelraises on rank-deficient designs (e.g. baseline always in session 1 withC(session)), and warns when random effects are not identified within any subject (e.g. a session trend with one condition per session).convergence_reportchecks group-level variables only (not subject-level*_sd/*_mu), treats NaN r̂ as a failure, and takesmax_divergences=.make_notebooks.py) reproduces lessons 3 and 4 again.ValueErrordescribing the problem instead of returning empty or silently averaged results.🤖 Generated with Claude Code