Arviz: plot_ppc doesn't work with missing data

Created on 30 Dec 2019  路  9Comments  路  Source: arviz-devs/arviz

Hi there, per one of the exercises in Osvaldo's book, I went back and played around with the Coal Mining disaster problem referenced here: https://docs.pymc.io/notebooks/getting_started.html#Case-study-2:-Coal-mining-disasters.

Everything went fine, except when I tried to sample the posterior predictive distribution and plot the results using plot_ppc. I kept getting the error:

ValueError: x and y must have same first dimension, but have shapes (1,) and (0,)

Until I tried removing the two missing values from disaster_data, then it worked as expected.

Bug Usability

Most helpful comment

I would like to work on this issue!

All 9 comments

I would like to work on this issue!

@nathanbraun May I please have a look at your code? It would help me reproduce the error and analyse it better.

@OriolAbril I am not able to introduce the posterior_predictive group to the InferenceData object required for plot_ppc. Could you please give me some suggestions?

The cookbook example will probably help you. Note that to obtain posterior predictive samples, pm.sample_posterior_predictive must be called.

@OriolAbril I was able to reproduce the error with the help of the resource you linked me to. Thank you!
I will try to analyse the error.

@OriolAbril Would imputing the missing data in some way minimally affect the data and solve the problem or would it greatly affect the data and worsen the problem?

Sorry, I don't understand the question

@OriolAbril I meant to ask if imputing the data would be of any help. @ahartikainen Could you please tell me what "model is vectorised" means in the link you posted? I am also confused about how creating two different distribution variables for existing values and missing values helps here.

Was this page helpful?
0 / 5 - 0 ratings