betanbinom_HM {bayespm} | R Documentation |
The Highest Mass (HM) interval of Beta-Negative Binomial distribution.
Description
betanbinom_HM is used to derive the narrowest interval of a predetermined coverage from a Beta-Negative Binomial distribution, containing the Highest Mass (HM) values.
Usage
betanbinom_HM( cover = NULL, r = NULL, a = NULL, b = NULL, plot = FALSE,
xlab = "x", ylab = "Probability" )
Arguments
cover |
scalar (between 0 and 1); The coverage (probability) of the Highest Mass (HM). |
r |
scalar (integer); It is the number of failures of the Negative Binomial distribution and needs to be a number. |
a |
scalar (positive); It is the shape1 parameter of the Beta distribution and needs to be a number. |
b |
scalar (positive); It is the shape2 parameter of the Beta distribution and needs to be a number. |
plot |
logical; if TRUE, the plot of the HM region is displayed. It is FALSE by default. |
xlab , ylab |
The titles of the x-axis and y-axis for the HM plot. The default values are "x" and "Probability". |
Details
betanbinom_HM provides the Highest Mass (HM) of a Beta-Negative Binomial distribution. HM is the narrowest region, with the minimum absolute difference from a pretermined coverage. The values included in HM have probability larger than every point outside the region.
Value
Returns a data frame with the upper and the lower limits of the Highest Predictive Denisty or Mass (HPrD/M) region, the lower and the achieved coverage. If plot=T, then the HPrD/M is visualized.
Examples
betanbinom_HM(0.95, 5, 20, 80, plot = TRUE)