-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
[Bug/Inconsistency] Please Convert Warning 'Messages' to Warnings #1039
Comments
Hi @emstruong thanks for the suggestions. Can you say a bit more about what makes this "messy" in Monte Carlo simulations? In the past we've had complaints about too many warnings, which is one reason this is a message. |
Ah, I see... Well, at least in terms of monitoring simulations from Regarding the complaints, couldn't its verbosity be controlled via an argument? Or perhaps whether it's a message or a warning be controlled, as in |
I see, I didn't know that (never used SimDesign before). For the moment one thing you can do is set # I haven't tested this but something like this should work
fit_model <- function(model, ...) {
fit <- model$sample(..., diagnostics = NULL) # suppress diagnostic messages
divergences <- sum(fit$diagnostic_summary(quiet=TRUE)$num_divergent)
if (divergences > 0) {
warning("There were ", divergences, " divergences")
}
return(fit)
}
Yeah, I think something like this would be reasonable. I'd prefer to give the user an option to make it a warning rather than forcing it by changing (and hardcoding) all the messages to warnings, since at this point people are used to the current situation. But I agree an option would be good. |
Ah... Well I think what I was meaning was that when a lot of different models are repeatedly fitted within a single session, as may be the case in multiverse analyses, large production cases, or Monte Carlo Simulation designs, I think the small things like message, warning and error handling can become quite important. As there's not much of any other way to automate interacting with the model... Which I sense is largely the opposite of the way Bayesian analysis should be--meaningful priors and thoughtful investigation of posteriors.
I think this could work--although it may or may not work with brms. I'll have to check
I agree. |
Yeah I'm not sure if brms gives you access to the CmdStanR fitted model object. If not, you could use |
Describe the bug
Some of the 'warnings' from
cmdstanr
are actually 'messages' and not warnings. This can be messy in Monte Carlo simulations.cmdstanr/R/utils.R
Lines 287 to 310 in bceb482
Expected behavior
I expected the warning messages to actually be warnings and I would really appreciate if they were warnings
Operating system
Ubuntu 22.04
CmdStanR version number
0.8.1
The text was updated successfully, but these errors were encountered: