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

Compute effective number of parameters for K-fold CV #462

Merged
merged 3 commits into from
Nov 30, 2020
Merged

Conversation

jgabry
Copy link
Member

@jgabry jgabry commented Aug 10, 2020

closes #460

Computes p_kfold and se_p_kfold, which were previously NA.

fit <- stan_glm(mpg ~ wt + am, data = mtcars)
kfold(fit, K = 10)

Based on 10-fold cross-validation

           Estimate  SE
elpd_kfold    -84.6 4.2
p_kfold         4.2 1.2
kfoldic       169.3 8.4

@jgabry jgabry requested review from bgoodri and avehtari August 10, 2020 17:52
Copy link
Contributor

@avehtari avehtari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that the computed p_kfold matches p_loo (up to one digit), and lpds's are equal.
Thanks Jonah!

@jgabry
Copy link
Member Author

jgabry commented Aug 10, 2020

Thanks for checking Aki!

@jgabry
Copy link
Member Author

jgabry commented Nov 30, 2020

This has been open for a while. Will merge since Aki approved it.

@jgabry jgabry merged commit c2a6f73 into master Nov 30, 2020
@jgabry jgabry deleted the compute-p_kfold branch November 30, 2020 19:39
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 this pull request may close these issues.

Effective Number of Parameters in kfold
2 participants