-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
"thin" argument affects diagnostics #1185
Comments
Yeah if you run |
I think the problem here is that the diagnostics like divergences are written to csv like the draws and then summarized afterwards, but thinning affects how many iterations are written to csv. So CmdStan would need some way to count and save the divergences that doesn't require writing every iteration to CSV. |
The average tree depth should have the right expectation, so I wouldn't worry about that. EBFMI is like R-hat and ESS in that it will fundamentally depend on the draws. I would not want to see this change to the underlying draws---these are features of the saved post-warmup draws. That leaves divergences. I'd instead recommend estimating number of divergences as thinning rate * reported divergences, which I think should be correct in expectation. And perhaps number of total log density evals, which we lose other than in expectation once we thin. |
Describe the bug
If I use the same seed (to ensure reproducibility) and do two model$fit() runs with identical arguments except that one has thin=4, I get fewer divergent transitions, fewer max_treedepth transitions, and worse EBFMI reported for the run that has thinning. (Probably an underlying Stan issue, not just cmdstanr)
To Reproduce
Expected behavior
Thinning should only affect the number of draws saved, not the diagnostics. A divergent transition is an indication of a possible problem whether or not you save it.
Operating system
Your operating system (e.g. mac os x 10.15, windows 10, etc.)
CmdStanR version number
Your CmdStanR version number (e.g. from
packageVersion("cmdstanr")
).Additional context
cmdstanr version 0.6.0.9000
R version 4.2.2
macOS 13.4 (Ventura)
The text was updated successfully, but these errors were encountered: