xfim / ggmcmc

Graphical tools for analyzing Markov Chain Monte Carlo simulations from Bayesian inference
111 stars 31 forks source link

separate the Rhat code from ggs_rhat #67

Closed GustafRydevik closed 4 years ago

GustafRydevik commented 4 years ago

Hi,

Thanks for your package, which I'm making very heavy use of! I wonder if you'd be open to separating out the rhat calculation from ggs_rhat into a separate function? Happy to push some code doing that if it makes it easier.

A big chunk of what I use it for is simply the ggs() conversion of mcmc to a data frame, which I then conduct lots of post processing of. As part of that post-processing, I often find myself wanting to calculate the Rhat, and while ggs_rhat() does that for me, it's a bit round-about to try and pull the values from the ggplot object. I've ended up simply cutting the relevant rhat calculation code out of the code body, and using that as a stand-alone function instead.

xfim commented 4 years ago

Thank you for your input, @GustafRydevik .

I have an idea about this. Certainly, it shouldn't be too hard to move the calculations of ggs_Rhat(), ggs_geweke() and ggs_effective() to a newer function (for instance, ggs_measures()) and then use its input for the respective functions. Let me work on it.

xfim commented 4 years ago

Solved in 20ec3b651a73b36317595de243ec65661075d854 and fadba23bc1f8b55b71684369739472c180d0a1e9.

Returning a single dataframe is done with ggs_diagnostics().

Thank you for your suggestion, @GustafRydevik .