Open Fumeng-Yang opened 1 year ago
FYI: It seems that brms
's posterior_epred
returns row names for an ordinal model. Not sure whether this is used in tidybayes
.
A minimal reproducible example
set.seed(1234)
c <- brm(x ~ 1,
data = tibble(x = sample(1:3, 100, replace = TRUE)), # need some data
backend = 'cmdstanr',
refresh = 2000, # don't want lots of messages
family = cumulative('logit')
)
df <- brms::posterior_epred(c,
newdata = tibble(x = 1),
draw_ids = 100:105 # a subset of draws
# but don't want to be confused with the categories
)
dimnames(df)
The output is
[[1]]
[1] "1" "2" "3" "4" "5" "6"
[[2]]
NULL
[[3]]
[1] "1" "2" "3"
where we see the first dimension has row numbers as row names.
BTW: these two features should be simple to add. I can probably figure out something after I understand the structure of tidybayes
....
When
draw_ids
are specified to get a subset of the draws,[add_]epred_draws
still returns1, 2, ..., row number
in.draw
. It would be useful to havedraw_ids
in.draw
. Because we may want to split the draws and later combine them.A minimal reproducible example
The output is
Notice that
.draw
is still1,2,3
while we specified 100:102.