This function computes the highest density region (HDR) with support on the integers. The distribution can be any discrete
distribution concentrated on the integers --- it does not have to have any shape properties for the function to work. The user
must give the density function ```f``` for the distribution. To improve the search properties of the algorithm, the user can
also give lower and upper bounds for the support of the distribution if these are available. (Warning: If the user specifies
incorrect bounds on the support, that do not contain the full support of the distribution, then the algorithm may continue to
search without end, in which case the function will not terminate. Similarly, if the user specifies a sequence function E that
is not a proper bijection to the integers then the algorithm may continue to search without end, in which case the function will
not terminate.) The output of the function is a 'hdr'
object containing the HDR for the discrete distribution.
HDR.discrete(
cover.prob,
f,
supp.min = -Inf,
supp.max = Inf,
E = NULL,
...,
distribution = "an unspecified input distribution"
)
The minimum coverage probability for the region
The density (mass) function for the distribution
A minimum bound for the support of the distribution
A maximum bound for the support of the distribution
A bijective function mapping the natural numbers (1,2,3,...) to a set covering the support of the distribution (optional); if included, the algorithm will search the support of the distribution in the order specified by this function; if not included, the algorithm will search the integers in a default order.
additional parameters of f
a label
If all inputs are correctly specified (i.e., arguments and parameters are in allowable range) then the output will be a list of class ```hdr``` containing the HDR and related information.