Open psmits opened 4 years ago
Hmm this looks related to https://github.com/mjskay/tidybayes/issues/132? You might find the workaround there helpful in the short term.
Long term I plan to look at this bug in detail and fix it, though given my current constraints this may not happen until this summer.
thanks for pointing out that work around. I was able to use the .repair_names
function jburos wrote as a workaround.
Ben Goodrich replied to my post on the Stan forums about how there might be changes to rstan::As.mcmc.list down the line to address this incompatibility. I replied with a link to #132.
I've already posted this on the stan discourse, but I figured this repo would be a better place to take this.
I'm working with the posterior samples from a model fit using RStan. I started my normal routine of using
tidybayes
to extract posterior samples from thestanfit
object and start plotting. However, I ran into an issue with the variable names that come out oftidy_draws()
where instead of the expected bracket notation e.g. x[1], I get the results in an unexpected dot notation form e.g. x.1. This mangling of the names does happen when i usedimnames()
on thestanfit
object.I hunted for a long time to find the source of the problem, reading the github repo for
tidybayes
andrstan
and I think I found the source of the problem.rstan::As.mcmc.list
appears to be the source of the unexpected renaming.You can compare the outputs from the following
I'm not sure how to resolve this issue, because it appears to break a lot functionality with
tidybayes
. For example, this now longer works because the intermediatemcmc.list
created byrstan::As.mcmc.list
doesn't have the expected variable names.