You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that ppc_stat always assumes that the test statistic defined by stat is continuous, and thus draws a histogram, which is fine but sometimes looks quite ugly, for example:
set.seed(0)
y<- rbinom(20, 1, 0.2)
yrep<-matrix(rbinom(2000, 1, prob=0.4), 1000, 20, byrow=TRUE)
bayesplot::ppc_stat(y, yrep, function(x) sum(abs(diff(x))))
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Yeah you're right that it would look nicer as a bar plot when the test statistic is discrete. There's not a way to tell ppc_stat to do that right now, but I think it's a good idea. If you or anyone else is interested in adding it I would be happy to review a pull request. Otherwise I can certainly do it myself when I have time, but I'm not sure when that will be at the moment.
It seems that
ppc_stat
always assumes that the test statistic defined bystat
is continuous, and thus draws a histogram, which is fine but sometimes looks quite ugly, for example:Created on 2024-10-14 with reprex v2.1.1
Is there an option (or another function) to specify that the test statistic is discrete, so that
ppc_stat
would produce a barplot instead?The text was updated successfully, but these errors were encountered: