algorithm="sampling"
) or one of the
variational approximations ("meanfield"
or "fullrank"
), the
posterior_interval
function computes Bayesian posterior uncertainty
intervals. These intervals are often referred to as credible
intervals, but we use the term uncertainty intervals to highlight the
fact that wider intervals correspond to greater uncertainty.posterior_interval(object, prob = 0.9, type = "central", pars = NULL,
regex_pars = NULL, ...)
stanreg-objects
.prob=0.9
) rather than the traditionally
used $95$% (see Details)."central"
(see Details). A central $100p$%
interval is defined by the $\alpha/2$ and $1 - \alpha/2$ quantiles,
where $\alpha = 1 - p$.regex_pars
can be used
in place of pars
or in addition to pars
. Currently, alpars
and/or
regex_pars
). For a given value of prob
, $p$, the columns
correspond to the lower and upper $100p$% interval limits and have the
names $100\alpha/2$% and $100(1 - \alpha/2)$%, where $\alpha
= 1-p$. For example, if prob=0.9
is specified (a $90$%
interval), then the column names will be "5%"
and "95%"
,
respectively.prob=0.95
.
}
posterior_interval
only computes central intervals because
other types of intervals are rarely useful for the models that Morey, R. D., Hoekstra, R., Rouder, J., Lee, M. D., and Wagenmakers, E. (2015). The fallacy of placing confidence in confidence intervals. Psychonomic Bulletin & Review. 1--21.
confint.stanreg
, which, for models fit using
optimization, can be used to compute traditional confidence intervals.posterior_interval(example_model)
posterior_interval(example_model, regex_pars = "herd")
posterior_interval(example_model, pars = "period2", prob = 0.5)
Run the code above in your browser using DataLab