-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Add a way to extract observations from pymc3 trace #219
Conversation
arviz/utils/xarray_utils.py
Outdated
@@ -277,6 +336,7 @@ def to_inference_data(self): | |||
'sample_stats': self.sample_stats_to_xarray(), | |||
'posterior_predictive': self.posterior_predictive_to_xarray(), | |||
'prior': self.prior_to_xarray(), | |||
'data': self.data_to_xarray(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing that concerns me about this change is that we use the variable name data
throughout the library to refer to posterior.
Would you alright if I opened an issue and/or made a pull request to rename this in the various plots? For example traceplot
https://github.com/arviz-devs/arviz/blob/master/arviz/plots/traceplot.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like it either. data
is really arbitrary thing.
Could it be observed
, observed_data
or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think calling it data
was a nod to stan's data section :)
I updated it to 'observed_data', and also updated schema.md
. @canyon289 let me know if that's ok with you, too.
Also, should we have We can deal with prior later? |
Merging this, but will create an issue for how/whether to store other data associated with a model. |
Note also that I refactored the
numpy_to_xarray
function so that consistent names would be generated. Now theposterior_predictive
anddata
variables will have the same default dimension names.This change will make it easier to add and test the
ppc_plot
.