lnccbrown / lnccbrown/HSSM

[Migration] Stop pymc's forward sampler rejecting the aDDM p_outlier TensorConstant

Open
#1,329 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
124
Forks
24
Avg merge
19h 32m
Merged PRs (30d)
60

Description

Part of #1305. Parent: #1306.

⚠️ **Not in [bambi#1002](https://github.com/bambinos/bambi/pull/1002)'s notes** — found by re-triage after #1310 unmasked the aDDM predictive paths.

aDDM posterior predictive sampling fails inside bambi's new in-sample `predict`:

```
TypeError: ('Constants not allowed in param list', TensorConstant(TensorType(float64, shape=()), data=array(0.05)))
bambi/backend/pymc/model.py:477: in _predict_in_sample
pymc/sampling/forward.py:387: in compile_forward_sampling_function
```

bambi 0.20 compiles the forward sampler over the model's inputs (`pm.sample_posterior_predictive` on a cloned model), and the aDDM graph carries `p_outlier` as a `TensorConstant` where pymc expects a shared variable or input. aDDM only — the SSM predictive path is fine.

### Tasks
- [ ] Find where the aDDM distribution bakes `p_outlier` in as a constant instead of a model input (compare with the SSM path, which passes)
- [ ] Route it through the same mechanism as the other fixed parameters, or wrap it so pymc treats it as an input
- [ ] Remove the R12 xfail marks

### Impact
3 test ids across 3 files: `tests/addm/test_addm_ppc.py`, `tests/addm/test_addm_continuation.py`, `tests/addm/test_addm_cartoon.py` (1 each).

Details: `design/bambi-dev-upgrade-test-failures.md` (R12), `design/bambi-migration-fix-plan.md` (F11).

Contributor guide

Open the contributing guide

Research direction

Start by comparing the aDDM distribution's handling of p_outlier with the passing SSM path, using bambi/backend/pymc/model.py:477 and the migration notes in design/bambi-dev-upgrade-test-failures.md (R12) and design/bambi-migration-fix-plan.md (F11). Run the three affected tests: tests/addm/test_addm_ppc.py, tests/addm/test_addm_continuation.py, and tests/addm/test_addm_cartoon.py; done means the forward sampler no longer raises the TensorConstant error and the R12 xfails are removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.