bayesplot
bayesplot copied to clipboard
Request: Extend extractors to work with mcmc.list objects
Would it be possible to extend extractor methods, such as rhat
and neff_ratio
, to work with mcmc.list
objects, of the type you get back from working with rjags
/coda.samples
?
Currently, bayesplot-extractors.R says
Currently methods are only provided for stanfit (\pkg{rstan}) and stanreg (\pkg{rstanarm}) objects, but adding new methods should be relatively straightforward.
I'm working with rjags
and new to bayesplot
. I find the mcmc_*
methods helpful for visualising mcmc draws, and would love to use bayesplot
for diagnostic checks, etc. Thanks for all the work on bayesplot!
Glad you’re finding bayesplot useful! And yeah, the special extractor functions could definitely be extended. You should still be able to use bayesplot for diagnostic plots now if you can create an object of the same structure as the ones returned by the bayesplot extractors. Using the extractors isn’t a requirement, it just makes it easier. But since it does make it quite a bit simpler to have the extractors, I’m open to adding more to the package. We may end up moving the extractors into our other packages (the ones for stanfit objects into rstan, stanreg objects into rstanarm, generic methods in rstantools, etc) because it makes for sense for them to provide the methods for their own objects, but if that happens we can either keep the one for jags in bayesplot if it needs a home or ask Martyn to consider putting it in rjags.
posterior
package can convert mcmc.list
objects to posterior objects, posterior
has the best implementations for rhat's and ess's, and bayesplot works with posterior objects. Closing this one.
Good call, thanks @avehtari