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

Make ess_rhat return NaN instead of erroring #117

Closed
sethaxen opened this issue Feb 1, 2024 · 1 comment · Fixed by #119
Closed

Make ess_rhat return NaN instead of erroring #117

sethaxen opened this issue Feb 1, 2024 · 1 comment · Fixed by #119

Comments

@sethaxen
Copy link
Member

sethaxen commented Feb 1, 2024

Currently MCMCChains automatically displays our diagnostics for Chains. But for chains with less than 10 draws, each diagnostic that calls ess_rhat will error at the following line due to splitting:

throw(ArgumentError("number of draws after splitting must >4 but is $niter."))

This erroring is a nuisance to handle in either PosteriorStats or MCMCChains. I suggest we instead return NaNs in such cases and raise an informative warning about why ess_rhat failed. This would probably resolve TuringLang/MCMCChains.jl#447 and TuringLang/MCMCChains.jl#410

@devmotion
Copy link
Member

We changed it to an error in #64 but I agree that probably NaN (+ @warn?) would be easier to handle for downstream packages.

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