Consider accepting observed in sample_posterior_prodective `freeze_vars`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9.8k
- Forks
- 2.3k
- Avg merge
- 21h 39m
- Merged PRs (30d)
- 5
Description
Description
This would mean that observed RVs in sampled graphs should be replaced by their observed data.
If you try that now you get something like ValueError - freeze_vars ['obs'] are not present in the trace. Cannot freeze variables without stored values.
This showed up when implementing model.conditional in pymc-extras, as we want the conditional variables to depend on the observed values, to get the proper conditional posterior distribution. The natural way was to make them depend on the observed RV and then freeze the RVs during posterior_predictive, but this is exactly what's not supported.
I'm not sure though, specially with the behavior when not set, do we issue warnings on dependents? Probably not.
I'd leave this as a discussion issue until demand is more clear.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at sample_posterior_predictive handling of freeze_vars and reproduce the ValueError when an observed RV is passed. Compare the behavior needed by model.conditional: observed RVs should be replaced by their observed data, while the behavior when freeze_vars is unset remains to be decided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100