HDIofGrid: Title

Description Usage Arguments Value Examples

Description

Title

Usage

1
HDIofGrid(probMassVec, credMass = 0.95)

Arguments

probMassVec

a vector of probability masses at each grid point.

credMass

the desired mass of the HDI region.

Value

A list with components: indices is a vector of indices that are in the HDI: mass is the total mass of the included indices :height is the smallest component probability mass in the HDI

Examples

1
2
3
4
5
#For determining HDI of a beta(30,12) distribution approximated on a grid:
 probDensityVec = dbeta( seq(0,1,length=201) , 30 , 12 )
 probMassVec = probDensityVec / sum( probDensityVec )
 HDIinfo = HDIofGrid( probMassVec )
 show( HDIinfo )

kyusque/DBDA2E-utilities documentation built on May 5, 2019, 1:37 p.m.