get.intervals: Get intervals (confidence/credible intervals) for the...

get.intervalsR Documentation

Get intervals (confidence/credible intervals) for the variables in a distribution

Description

Get intervals (confidence/credible intervals) for the variables in a distribution

Usage

get.intervals(
  dist,
  type = c("equal-tailed", "highest-density")[1],
  coverage = 0.95,
  n.sim = 1000
)

Arguments

dist

An object of class Distribution or a subclass

type

Either 'equal-tailed' or 'highest-density' depending on the type of interval desired (equal-tailed is generally easier to compute)

coverage

A vector of probabilities (from 0 to 1) which the intervals should cover

n.sim

If the values are to be calculated by random sample generation, how many random samples to generate

Details

Note to developers: this function should not be overridden. Override do.get.equal.tailed.intervals and do.get.highest.density.intervals instead

Value

If length(coverage)==1, and the distribution has one variable, returns a numeric vector with two values: the lower and upper bound of the interval. If length(coverage)==1 and the distribution has more than one variable, returns a matrix with one row for the lower bound and one row for the upper, and one column for each variable. If length(coverage)>1 and the distribution has one variable, returns a matrix with one row for the lower bound and one row for the upper bound, and one column for each value in coverage. If length(coverage)>1, and the distribution has more than one variable returns a 3-dimensional array; the first dimension has values 'lower' and 'upper'. The second dimension has one value for each variable. The third dimension has one value for each value of coverage.

See Also

get.equal.tailed.intervals, get.highest.density.intervals


tfojo1/distributions documentation built on July 27, 2024, 3:29 p.m.