Skip to content
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

Merged
merged 3 commits into from
Sep 9, 2018

Conversation

ColCarroll
Copy link
Member

Note also that I refactored the numpy_to_xarray function so that consistent names would be generated. Now the posterior_predictive and data variables will have the same default dimension names.

This change will make it easier to add and test the ppc_plot.

@@ -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(),
Copy link
Member

@canyon289 canyon289 Sep 8, 2018

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

Copy link
Contributor

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?

Copy link
Member Author

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.

@ahartikainen
Copy link
Contributor

ahartikainen commented Sep 8, 2018

Also, should we have observed_data group or could we assume that posterior_predictive only contains data generated from posterior and data used in sampling (prior_data/sampling_data/observed_data)?

We can deal with prior later?

@ColCarroll
Copy link
Member Author

Merging this, but will create an issue for how/whether to store other data associated with a model.

@ColCarroll ColCarroll merged commit f4f7dd7 into arviz-devs:master Sep 9, 2018
@ColCarroll ColCarroll deleted the pymc3-data branch January 30, 2021 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants