Repository navigation
fix(likelihoods): align racing_diffusion_3 parameter order with ssm-simulators - #1371
Conversation
…cbrown#1370) rdm3_params and the logp_rdm3 signature declared A, b, v0, v1, v2, t, while ssm-simulators registers racing_diffusion_3 as v0, v1, v2, A, b, t. HSSM passes parameters by position to both the likelihood and the simulator random variable, so fitting was unaffected but prior and posterior predictive draws used permuted parameters. Reorder both, update the models-and-likelihoods table, and add tests that compare list_params and choices with the ssm-simulators registry for every supported model, check that named Python likelihoods follow list_params, and compare RDM3 draws with simulate_data. Closes lnccbrown#1370 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to This change aligns racing_diffusion_3 parameter order with the simulator registry so predictive draws use the intended named parameters. Positional calls to logp_rdm3 or configurations pinning the old order will break, which the PR acknowledges. No merge-blocking risk was identified. Pre-merge checks |
|
|
Thanks for the contribution @AxelNoun. |
Perfect! Let me know if you need me (for that or for other things!) Thank you! |
Closes #1370
racing_diffusion_3declaredlist_paramsasA, b, v0, v1, v2, t, while ssm-simulators readsthetaasv0, v1, v2, A, b, t. Fitting was unaffected, but every prior and posterior predictive draw was simulated from permuted parameters, without any error (details in racing_diffusion_3: prior and posterior predictive draws use permuted parameters #1370).rdm3_paramsand thelogp_rdm3signature now follow the registry order. They change together because the likelihood is called asloglik(data, *dist_params);rdm3_boundsis keyed by name and unchanged.racing_diffusion_3row ofdocs/reference/models-and-likelihoods.mdis updated, astest_builtin_model_matrix_matches_defaultsrequires.tests/unit/modelconfig/test_param_order_matches_simulator.pychecks thatlist_paramsandchoicesequal the ssm-simulators registry for the 21 (model, likelihood kind) pairs that have a simulator, that the 7 named Python likelihoods declare their arguments inlist_paramsorder, and that RDM3 draws from the distribution's RV matchhssm.simulate_dataat the same named parameters (tolerances of at least four Monte Carlo standard errors). Two of the three tests fail on main; reordering onlyrdm3_paramsmakes the signature test fail.save_modelon main reloads with the same log density.sample_prior_predictive(10,000 samples,Normal(theta, 1e-3)priors) now gives P(choice) = [0.7119, 0.1473, 0.1408], against [0.7069, 0.1465, 0.1465] from the integrated likelihood and [0.2644, 0.3495, 0.3861] on main. Its RT quantiles 0.1 to 0.9 lie 4.9 to 15.3 ms above the likelihood's, mostly the simulator's Euler bias atdelta_t = 0.001(4.5 to 8.5 ms when the simulator is called directly); the rest is within two Monte Carlo standard errors.logp_rdm3(not exported fromhssm.likelihoods) and a usermodel_configthat pins the oldlist_params. Predictive checks of RDM3 models run with 0.3.0 or later are worth repeating.I used an AI assistant (Claude Code) to investigate the bug, run the reproductions and measurements, write the fix and its tests, and draft this description.
Summary by CodeRabbit
Bug Fixes
Tests