The posterior_interval generic is re-exported
from rstantools and an S3 method is provided that dispatches on
hbmfit objects. This lets users call
posterior_interval(fit) on the return value of
hbm just as they would on a brmsfit.
Arguments
- object
An
hbmfitobject.- prob
Coverage probability in \((0, 1)\) (default
0.95; note thatrstantools::posterior_interval's own default is0.9).- params
Optional character vector of parameter names to keep.
- ...
Additional arguments forwarded to
posterior_draws.
Examples
# \donttest{
library(hbsaems)
library(brms)
data("data_fhnorm")
model <- hbm(brms::bf(y ~ x1), data = data_fhnorm,
re = ~ (1 | regency), # area-level random effect
chains = 4, iter = 2000, warmup = 1000,
cores = 1, seed = 1, refresh = 0)
#> Compiling Stan program...
#> Error in .fun(model_code = .x1): Boost not found; call install.packages('BH')
posterior_interval(model, prob = 0.90)
#> Error: object 'model' not found
# }