-
-
Notifications
You must be signed in to change notification settings - Fork 269
Incorrect computation in Posterior Predictive Checking section of BYM Notebook #675
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
Comments
Sounds good |
Tagging @daniel-saunders-phil |
Ah that makes sense! Thanks for noticing that. |
@jessegrabowski just to help me understand the behavior of |
I am quite sure adding "rho" or not to |
No, it shouldn't, because after you do There's a really long (and very good) explanation of how |
by logged output do you mean the Otherwise, whether it shows up in the resulting inference data depends on if you include it as a var_name. When you include it, you just get a list of 1s. |
Yes and yes.
|
Notebook title: The Besag-York-Mollie Model for Spatial Data
Notebook url:https://www.pymc.io/projects/examples/en/latest/spatial/nyc_bym.html
Issue description
I believe this computation is invalid:
Expected output
This code computes f(E[x]), when the mean prediction conditioned on rho = 1. The correct quantity to compute, however, is E[f(x)]. That is, the expectation should be taken last, only after computing the exp of the samples. The result is biased downward (since Jensen's inequality says E[f(x)] < f(E[x]) )
Proposed solution
This is actually a really great place to use
pm.do
. I propose:This would require wrapping
mixture
andmu
inpm.Deterministic
in the model code as well.The text was updated successfully, but these errors were encountered: