-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Added output for pointwise predictive accuracy in waic. #1677
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
Conversation
LGTM. BTW I think we should also have a |
Perhaps we should return a dictionary or NamedTuple instead containing all the variables? @aloctavodia what would that compare function do? |
or maybe a Pandas' DataFrame, is like a dict but the output looks nicer. Or this will be too much? |
@twiecki the McElreath computes the weights in his book, although the people from the Stan team do not compute them anymore because they think the weights are not very reliable given that their computation ignores the uncertainty. I think we could compute them but adding a warning. |
So who's willing to implement it? |
@gladomat probably that should be a separated PR. If you want to do it and have the time you can do it. If not I offer myself, just let me know. |
I won't have any time this week. I think I'll pass on this one. It shouldn't be too hard, especially with the stan code available. |
@aloctavodia doesn't seem like a high-prize item then. |
Probably pandas Series would be the right thing. I think that makes sense. Should we do the same for the other metrics? |
@twiecki not really, it's more of a convenience: give it two models and let it tell me which one seems best. |
Loo and Waic should return the same output (as aSeries). The rest of the metrics (dic and bic) returns just one value, as implemented now (and should probably remain that way). |
@aloctavodia Sounds good, want to add that? |
@twiecki sure. I will merge this PR and then I will continue from here ASAP. |
Thanks @gladomat! |
In order to estimate the difference in the predictive accuracy of two models using waic you need the pointwise predictive accuracy. These values can also be used to compute the standard error of the difference. I only changed what is to be returned.
For more on how to do this check out the pymc3 implementation of Chapter 7.5 from McElreath 2016.
Edit: Or better yet, check out the compare.R function from the stan-dev repository.