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

Improve loo functionality #496

Closed
ahartikainen opened this issue Jan 5, 2019 · 7 comments · Fixed by #678
Closed

Improve loo functionality #496

ahartikainen opened this issue Jan 5, 2019 · 7 comments · Fixed by #678

Comments

@ahartikainen
Copy link
Contributor

loo functionality should be more verbose and return more informative data. (see Model Selection lecture in StanCon Helsinki by @avehtari)

Also docstrings needs extensive examples for loo-usage.

@avehtari
Copy link
Contributor

avehtari commented Jan 7, 2019

I'm in progress of adding more explanations to loo package about interpreting loo output: approx SE of elpd_diff, p_loo, k stan-dev/loo#81. I'll comment here when ready with those.

@avehtari
Copy link
Contributor

Because of some confusing questions in discourse.mc-stan.org I found out that loo() help says

Calculates leave-one-out (LOO) cross-validation for out of sample predictive model fit, following Vehtari et al. (2015).

The year should be 2017 (http://link.springer.com/article/10.1007/s11222-016-9696-4), but more importantly in that paper log score is used. However the code computes

loo_lppd_i = -2 * _logsumexp(log_weights, axis=0)

that is, log score multiplied by -2.

As the lppd has a specific definition in Vehtari et al (2017) which doesn't include -2, I recommend to remove that -2. If you want to print out a value multiplied by .2, call it something else and make it clear that it's lppd multiplied by -2. This will make it much easier to answer questions whether one model is better than the other.

@avehtari
Copy link
Contributor

I also noticed that waic() help refers to DIC paper by Spiegelhalter et al, and should refer to one of the Watanabe's papers. The code has again -2, but Watanabe didn't multiply by -2, so again if you want to keep -2, you have to be explicit that the function is returning something different than what is in the paper.

@ahartikainen
Copy link
Contributor Author

ahartikainen commented Jan 20, 2019

@ahartikainen
Copy link
Contributor Author

ahartikainen commented Jan 20, 2019

So it is the deviance scale. I think we could let user to decide the scale or return all scales (deviance, log, neglog?)

@avehtari
Copy link
Contributor

R loo package stores and shows elpd_loo and looic. elpd_loo is clear as it has the specific definition in Vehtari et al (2017). I'm not happy with looic as it's still not indicate whether it's -1 or -2, but it's been there for a while. (DIC is the only information criterion indicating the deviance in the name. Unfortunately the original definition of deviance makes really sense only in case of point estimates, and thus deviance scale is also a bit misleading name for -2 times the log score)

@avehtari
Copy link
Contributor

There is additional documentation now in loo package. See the pull request stan-dev/loo#98 (review). The glossary will appear in loo web pages also after the next release in spring.

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 a pull request may close this issue.

2 participants