as.data.frame(extract(fit_cp80, permuted=TRUE))
gives me a nice dataframe as.data.frame(extract(fit_cp80, permuted=FALSE))
gives me unpermuted draws
How do I get a nice dataframe with non-permuted draws with different chains stacked together?
And how do I get divergent info for those as extra column?
Mike’s case study is using only one chain, and I still have difficulties understanding how to manipulate R datatypes…
You can just do as.data.frame(fit_cp80) if you want a data.frame of unpermuted post-warmup draws for all (saved) unknowns in the Stan program. That does not include the stuff about divergences. To get the latter, you currently have to do
@avehtari The quickest way might be to use the convenience function nuts_params in bayesplot, which formats the hmc/nuts sampler parameters as a data frame.
I assume you’re referring to rstan::extract? If so then yeah I think the returning a list sometimes and array other times is not something to keep in the future.
This gives an iterations, chains, parameters, and value column, which then works well (kind of elegantly) with anything in dyplr, tidyr, and specifically ggplot2…