The posterior_interval function computes Bayesian posterior uncertainty intervals. These intervals are often referred to as credible intervals. This documentation is largely inspired and adapted from the same function documentation from rstanarm.

# S3 method for stapDP
posterior_interval(object, prob = 0.95, pars = NULL, ...)

Arguments

object

stapDP object

prob

A number \(p \in (0,1)\) indicating the desired probability mass to include in the intervals. The default is to report \(95\)% intervals (prob=0.95).

pars

vector of parameter names

...

ignored

Value

A matrix with two columns and as many rows as model parameters (or the subset of parameters specified by 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.95 is specified (a \(95\)% interval), then the column names will be "2.5%" and "97.5%", respectively.

Details

Interpretation

Unlike for a frenquentist confidence interval, it is valid to say that, conditional on the data and model, we believe that with probability \(p\) the value of a parameter is in its \(100p\)% posterior interval. This intuitive interpretation of Bayesian intervals is often erroneously applied to frequentist confidence intervals. See Morey et al. (2015) for more details on this issue and the advantages of using Bayesian posterior uncertainty intervals (also known as credible intervals).

References

Gelman, A. and Carlin, J. (2014). Beyond power calculations: assessing Type S (sign) and Type M (magnitude) errors. Perspectives on Psychological Science. 9(6), 641--51.

Morey, R. D., Hoekstra, R., Rouder, J., Lee, M. D., and Wagenmakers, E. (2016). The fallacy of placing confidence in confidence intervals. Psychonomic Bulletin & Review. 23(1), 103--123.