Closed nutterb closed 8 years ago
On top of this, it may be helpful to have a wrapper for HydePosterior() %>% bindPosterior()
since those two functions are frequently run consecutively
How would you feel about skipping the wrapper and just placing bindPosterior
in HydePosterior
. The impetus behind having separate functions was to allow us the option of using rjags
' plotting methods to look at diagnostics. If we have the chain and observation indices, we can use ggplot to produce the same plots. (we may have to write a plotting method, but that's fairly trivial)
I think this would be fine. Some people who are used to modeling in JAGS (yet still interested in using HydeNet - which is kind of like drivers of manual-transmission cars wanting to go to automatic transmission) may wish to retain the list structure of the posterior samples. A little dlply()
helper function that translates the combined data frame you describe above to a list object more like the default rjags
output would keep those folks happy.
In that case, I'll rewrite bindPosterior
to add the indices, and then add an option to HydePosterior
with bind = TRUE
to bind the results right there. Users who want the traditional output can set bind = FALSE
When multiple chains are runs and bound together with
bindPosterior
, we lose the chain number. This makes it impossible to generate plots similar to the default plot methods inrjags
. It would be nice to doFor that matter,
bindPosterior
could also retain an observation number index within each chain so it didn't have to be calculated manually.