Add unconstrained/transformed variables to InferenceData
See original GitHub issue@ahartikainen suggested adding unconstrained variables to the schema somewhere. It seems like they could go
- Make new
unconstrained_posterior
group Good:- Explicit is better than implicit: it is clear what this group is for Bad:
- Should there also be
unconstrained_prior
?
- Add them to the existing
posterior
group Good:- Can reuse existing coords/dims
- Can add to prior in the same way Bad:
- Would need a naming convention, which we’ve managed to avoid so far
- PyMC3 currently does this, and it is kind of a pain to have a flag everywhere to include or exclude these variables.
- Don’t include them at all
Good:
- No work 😃 Bad:
- Bounds and domain information are not captured anywhere currently
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Built-in constrain vs user transformation - The Stan Forums
Hi all, I have a very basic question for constrained parameter/transform parameters (e.g. lower>0) Should there be any different in terms of ...
Read more >Creating InferenceData — ArviZ dev documentation
InferenceData is the central data format for ArviZ. InferenceData itself is just a container that maintains references to one or more xarray.Dataset s....
Read more >Getting started with PyMC3 - Learn PyMC & Bayesian modeling
PyMC3 random variables and data can be arbitrarily added, subtracted, divided, ... are also transformed to be unconstrained but with a log odds...
Read more >API Reference - sbi - mackelab
_data_round_index.append(0) prior_masks = mask_sims_from_prior(0, ... Whether to transform parameters to unconstrained space during MAP optimization.
Read more >Sparse logistic regression - Bean Machine
It also introduces the @bm.functional decorator, which can be used to deterministically transform random variables which can be convenient for ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would also like to see a way to get the transformed variables in the trace. The fact that this isn’t possible right now is pretty much the only reason I still use the original trace object of pymc3 quite a bit. I think I might even prefer if one of option 1 or 2 was the default behavior. The most common use cases I can see would be
This is a lot more work if if we do not have the pymc3 trace, because we first have to manually map the values to the transformed space.
hey dan! I think I’m generally on team option 3 still, but also on team “lets help out science”. So I’m totally on board with you adding a little backdoor option to allow this on pymc3, and if you do, maybe I can open a second issue requesting help to add it to various other backends (or even rethinking the design)?