xfim / ggmcmc

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

keep_original_order does not work for stan fit objects #74

Open Videodr0me opened 3 years ago

Videodr0me commented 3 years ago

Bug/Inconsistent Behaviour: the keep_original_order option does not work for stan fit objects.

Please fix, as this is very awkward if you want to group certain parameters together in a specific order for example in two column plots. Even better would be if the family order (sequence in which the variables are named in the family string) can optionally be preserved. This would allow to choose between ordering alphabetically, keeping the fit objects ordering or imposing the family string order. The latter wouold give a lot of flexibility without rerunning the monte carlo sim.

Videodr0me commented 3 years ago

I think the absolute simplest solution would be to allow two alternative parameters: current behaviour with a regexp string as parameter, and altenatively a list of parameter names where order is preserved. This should be pretty straightforward as these are different data-types so whenever a list is passed to ggmcmc its assumed that the list items are supposed to be exact matches where order of that list is preserved.

Even better would be if the list items could be regexp themselves, that would be the best of both worlds, then you could manually order parameters and still use regexp to include a bunch of similar or indexed parameters.