post_int: Posterior intervals

Description Usage Arguments Value Examples

Description

Returns cutoff points from a posterior distribution

Usage

1
2
post_int(x, mid = c("median", "mean", "mode"), int = c("hdi", "ci"),
  widths = c(0.5, 0.95), adj = 1.5, rope = NULL, warn = FALSE)

Arguments

x

Vector of numeric values. Typically a posterior sample.

mid

Central tendency estimator. Defaults to "median". Other options include "mean" and "mode".

int

interval type, either "hdi" or "ci"

widths

interval widths

adj

Bandwidth adjustment used only with the "mode" estimator. See dmode.

rope

Region of practical equivalence. Check how much of the distribution is within rope value.

warn

Turn off warning for flat intervals found (multiple possible values)

Value

data.table

Examples

1
2
3
4
5
6
7
8
9
x <- rpois(5000, 15)
ints <- post_int(x, warn = FALSE)
hist(x, br=50)
abline(v=ints$c, col="cyan")
abline(v=ints[, c("l.wide", "r.wide")], col="magenta")

post_int(x, "median", warn = FALSE)
post_int(x, "mean", warn = FALSE)
post_int(x, "mode", adj=2, rope = c(14, 16), warn = FALSE)

ggdistribute documentation built on May 2, 2019, 10:25 a.m.