-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
summary for standalone GQ, VI, etc. #667
Comments
Laplace approximation has not yet landed in a released version of CmdStan, see #649 Note that the .summary method on CmdStanMCMC is just a small wrapper around the |
|
Currently |
I'm not sure what "raw contents of the CSV files" means. Isn't that a string? Is there a way to summarize the draws after extracting with Am I supposed to just load |
CmdStanPy contains essentially no analysis code. We really just do ~3 things:
The current In particular, the things that fall under the second bullet point (.draws, .draws_pd, .draws_xr, etc) are all designed to make it easier to use the output with analysis code, but we don’t provide any such analysis. Probably using Arviz is the most common choice, you can construct Arviz objects from cmdstanpy objects directly using helper functions in Arviz: see https://python.arviz.org/en/stable/api/generated/arviz.from_cmdstanpy.html |
Thanks. Last time I tried this it ended in 2 hours of misery with the Arviz docs trying to define unit tests for Bayes Kit and I eventually gave up. Edit. So, I tried again. I don't see how |
Seems like a reasonable feature request for arviz. In the mean time I suspect you could either use |
I'll just drop standalone GQs from my tutorial. I would rather not have to introduce a dependency on arviz. Eventually, I think the right answer for CmdStanPy is to use CmdStan's |
It appears that For example, for ADVI, it computes the statistics including the first row of the output, which is not a sample. So, we would probably need to put a pretty big warning label on using it for anything which isn't exclusively rows of draws |
I think arviz.summary can take the output from fit_gq.draws_xr() |
Summary
Any object returned by sampling should allow
.summary()
to be called on it to report mean, sd, MCMC SE, quantiles, and R-hat. This includes objects returned byCmdStanMCMC
: MCMC samplingCmndStanGQ
: generated quantitiesCmdStanVB
: variational inferenceIs Laplace approximation not supported yet in CmdStanPy? It will also return a sample of multiple draws and should also include a
.summary()
method.Description
One way to do this would be to have each of these wrapper objects allow the actual draws to be extracted. Right now, there is a high-level "helper" function, where if
mcmc_fit
is aCmdStanMCMC
object, I just callmcmc_fit.summary()
directly. I would rather have this work bymcmc_fit.draws()
pulling out a simple draws object on which thesummary()
operates. Then the other object would also support a.draws()
extraction and thensummary()
would be a standalone function that applies to adraws
object rather than to the whole output of a run (I don't know what else is in theCmdStanMCMC
object---I only ever use the draws).Current Version
1.1.0
The text was updated successfully, but these errors were encountered: