HDIofGrid: Kruschke, J. (2014). Doing Bayesian data analysis: A tutorial...

Description Usage Arguments Value Examples

Description

Kruschke, J. (2014). Doing Bayesian data analysis: A tutorial introduction with R, 2nd Ed. Academic Press.

Usage

1
HDIofGrid(probMassVec, credMass = 0.95)

Arguments

probMassVec

is a vector of probability masses at each grid point.

credMass

is the desired mass of the HDI region.

Value

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
6
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 )

konkam/RTTanalyse documentation built on May 20, 2019, 12:55 p.m.