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 tests for adding posterior_predictive without trace #823
Conversation
I think this may still have issues. I tried using it and then converting a prior trace, and I get an error where arviz tries to have the dimensions of a prior trace be I have looked and the problem seems to arise in the call to The variable in question is a predictor (a function of an input variable), so is not replicated through the trace. Here is the line of code that defines the variable whose dimensions cause the error:
The variable
... so you can see that it does not vary over the course of the trace. I suppose I could suppress this variable, and just make it a I'm not certain why these variables did not cause me problems when they appeared in the posterior trace. |
@rpgoldman I fear I do not know pymc3 well enough to follow you. Am I right to assume that the issue is that either |
@OriolAbril I'm not sure if this is a problem with Arviz, or PyMC3. The issue is that my prior trace contains within it some sampled values, with shape The prior trace also contains some un-sampled predictor variables, with shape I don't know whether this is a bug in PyMC3, or in the way I am using PyMC3, but it causes |
I think we should somehow "ignore" errors due to edgecases and maybe throw a warning? |
@ahartikainen @OriolAbril I just posted something on the pymc3 slack channel about this, because I'm not sure what is going wrong, and if it is my fault. Having a deterministic function of a predictor variable in a pymc3 model seems uncertain in its effect. Hoping someone there can shed some light on the subject. |
Actually, this suggests a question about the general use of Arviz -- if predictors must be kept out of the trace objects, doesn't this hamper plotting with predictors and predictions? |
Could this be related to pymc-devs/pymc#3588? |
Yes, that is exactly what is happening. |
Yes: the deterministic that is being included in the trace is not a pymc-devs/pymc#3588 suggests that it's not sufficient to omit |
That sounds like a good solution. |
It also sounds to me like I should have been using Does that make sense? It also suggests that there should be a |
Is this related to #313 ? It seems like |
See https://github.com/arviz-devs/arviz/blob/master/arviz/data/inference_data.py We need to add it to the docs |
@ahartikainen Have a look at #825 ? |
Ready to merge |
LGTM |
Fixes #822and adds a test to check behaviour offrom_pymc3
when trace isNone
.EDIT: Only adds the test as a follow-up to #833.