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

Add support functions for Mixture IS LOO #270

Open
avehtari opened this issue Jun 25, 2024 · 0 comments
Open

Add support functions for Mixture IS LOO #270

avehtari opened this issue Jun 25, 2024 · 0 comments

Comments

@avehtari
Copy link
Collaborator

We have the Mix-IS-LOO vignette https://mc-stan.org/loo/articles/loo2-mixis.html, but it would be useful to add support for creating a loo object from mixture posterior log_lik. Assuming the Stan model code implements the mixture distribution and generates log_lik variable, Mix-IS-LOO elpd_loo estimate is given by

log_lik_mix <- extract(fit_mix)$log_lik
l_common_mix <- rowLogSumExps(-log_lik_mix)
log_weights <- -log_lik_mix - l_common_mix
elpd_mixis <- logSumExp(-l_common_mix) - rowLogSumExps(t(log_weights))

We can also compute Pareto-k's for each pointwise elpd, but there is a difference that the mixture posterior elpd itself is already different from the regular posterior, so the error of Mix-IS-LOO tend to be smaller than regular PSIS-LOO.

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

No branches or pull requests

1 participant