cmdstanr icon indicating copy to clipboard operation
cmdstanr copied to clipboard

document how to get a custom summary from CmdStanMCMC sample via print function.

Open mitzimorris opened this issue 4 years ago • 1 comments

question came up on Discourse: https://discourse.mc-stan.org/t/how-to-change-default-quantiles-for-summary-statistics-of-cmdstan-as-cmdstan-fit/26046/4

The CmdStanR docs should document use of quantiles, also "mean", "median" and other basic stats. The implementation is kinda wierd, because you end up with print statements like this:

fit_hier$print('z', "mean", "median", ~quantile(.x, probs = c(0.1, 0.9)), max_rows=18)

where it's hard to tell what are the model variables and what are the formatting directives.

mitzimorris avatar Jan 24 '22 23:01 mitzimorris

Yeah I'll add some more examples. I'll also look into improving the doc in posterior since it would be best to have most of the doc there so we don't have to duplicate.

jgabry avatar Apr 07 '22 21:04 jgabry

Can I help resolve this? I already wrote some examples in #719 Would you like this to be documented in the print docs, in the Getting Started vignette or in a new vignette?

gravesti avatar Mar 28 '23 10:03 gravesti

I think the print docs and a short example in the getting started vignette would be perfect. Thank you!

rok-cesnovar avatar Mar 28 '23 14:03 rok-cesnovar

The original question is a bit tricky because stats::sd doesn't have a ... argument. This might be improved with a generic sd() in posterior which could capture the unused arguments.

gravesti avatar Mar 31 '23 09:03 gravesti