do.get.highest.density.intervals: Internal function for subclasses to get equal-tailed...

do.get.highest.density.intervalsR Documentation

Internal function for subclasses to get equal-tailed intervals (confidence/credible intervals) for the variables in a distribution

Description

This function is provided to be overriden by developers. End users should instead call get.intervals or get.highest.density.intervals

Usage

do.get.highest.density.intervals(dist, coverage = 0.95, n.sim = 1000)

Arguments

dist

An object of class Distribution or a subclass

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

The default implementation takes random samples and calculates an empiric highest-density interval. The wrapper get.highest.density.intervals takes care of formatting the return value and generating warnings for any improper variables

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.