@param ICDFname is R's name for the inverse cumulative density function of the distribution.

intervalWidth(lowTailPr, ICDFname, credMass, ...)

Arguments

credMass

is the desired mass of the HDI region.

tol

is passed to R's optimize function, the lower the tolerance,the longer the optimisation, but the higher the accuracy. tol=1e-4 gives values of the same accurary as our max resolution Return value: Highest density iterval (HDI) limits in a vector. Example of use: For determining HDI of a beta(30,12) distribution, type HDIofICDF( qbeta , shape1 = 30+1 , shape2 = 12+1 ) Notice that the parameters of the ICDFname must be explicitly named; e.g., HDIofICDF( qbeta , 30+1 , 12+1 ) does not work. Adapted and corrected from Greg Snow's TeachingDemos package.