Skip to content

Refactor EmpiricalGroup to take InferenceData inputs #5884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Tracked by #7053
michaelosthege opened this issue Jun 12, 2022 · 0 comments
Open
Tracked by #7053

Refactor EmpiricalGroup to take InferenceData inputs #5884

michaelosthege opened this issue Jun 12, 2022 · 0 comments
Labels
help wanted trace-backend Traces and ArviZ stuff VI Variational Inference

Comments

@michaelosthege
Copy link
Member

To decrease our dependence on MultiTrace, and to improve support for workflows were InferenceData objects are saved to disk, the EmpiricalGroup approximation should be refactored.

Currently it takes only MultiTrace inputs, but that's just because it needs access to transformed posterior draws.
Since the approximation is created inside a modelcontext, it should be no problem to get the transforms from the Model and apply them to untransformed posterior draws.

Steps

  1. Write a function to transform posterior draws given a pm.Model instance and an xarray.Dataset (e.g. idata.posterior) containing untransformed draws.
  2. Refactor EmpiricalGroup to work with that xarray variable instead of a MultiTrace
  3. Maintain backwards-compatibility (with a deprecation warning) by automatically converting MultiTrace inhputs to InferenceData internally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted trace-backend Traces and ArviZ stuff VI Variational Inference
Projects
None yet
Development

No branches or pull requests

1 participant