Skip to content

kfold, reloo, and non-gaussian group-level effects #1779

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

Open
avehtari opened this issue May 18, 2025 · 3 comments
Open

kfold, reloo, and non-gaussian group-level effects #1779

avehtari opened this issue May 18, 2025 · 3 comments

Comments

@avehtari
Copy link
Contributor

avehtari commented May 18, 2025

This worked in January 2024

fit_hiert <- brm(y | trials(n) ~ 1 + (1 | gr(id, dist='student')), family = binomial(),
                 data = dat, refresh=0)

kcv_hiert <- kfold(fit_hiert, K=48, save_fits=TRUE)

but now it gives an error

Error: Option sample_new_levels = 'gaussian' is not available for non-gaussian group-level effects.

Preferably, kfold would be fixed to work non-Gaussian group-level effects.

If non-Gaussian group-level effects are not supported, then it would be nice to clarify that kfold() does not support non-Gaussian group-level effects. Now the error message refers to argument sample_new_levels which is not mentioned in the kfold() documentation and it's not clear where to find possible instructions to go forward.

The same for reloo

fit_hiert <- add_criterion(fit_hiert, criterion='loo', reloo=TRUE, overwrite=TRUE)
@avehtari avehtari changed the title kfold and non-gaussian group-level effects kfold, reloo, and non-gaussian group-level effects May 18, 2025
@paul-buerkner
Copy link
Owner

What happens if you pass sample_new_levels = "uncertainty" to kfold? Does that work?

@avehtari
Copy link
Contributor Author

What happens if you pass sample_new_levels = "uncertainty" to kfold? Does that work?

Sorry for not mentioning that it seems to work. My issue was that it is not mentioned in kfold() and add_criterion() documentation, and naturally even better would be to switch to sample_new_levels = "uncertainty" automatically if the group-level effects are non-Gaussian.

@paul-buerkner
Copy link
Owner

Yeah, especially the documentation would make sense to add. Will do it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants