Learn R Programming

plpoisson (version 0.3.1)

hyperbootstrap: Bootstrap Methods to Estimate Hyperparameters for a Gamma Prior

Description

The function provides three bootstrap implementations to estimate the hyperparameters of a gamma prior distribution. The method of moments, maximum likelihood and chi-square approximation are implemented for studying the uncertainties associated with the choice of the hyperparameters \(a\) (shape) and \(b\) (rate).

Usage

hyperbootstrap(xvec, B = 1000L, 
               method = c("moments", "likelihood", "chisq"))

Value

A list containing the following components:

a

A matrix of values for the shape hyperparameter of the gamma distribution. The results of each method are organized by column.

b

A matrix of values for the rate hyperparameter of the gamma distribution. The results of each method are organized by column.

Arguments

xvec

a numeric vector of data with the observed occurrencies (assumed to be Poisson distributed).

B

a numeric value representing the total number of bootstrap iterations.

method

a character string (or strings) with the name/s of the method/s chosen to obtain hyperparameter estiamtes.

Author

Valbona Bejleri, Luca Sartore and Balgobin Nandram

Details

The function performs a choosen number of iterations using either the method of momemnts (method = "moments"), the maximum likelihood (method = "likelihood"), or the chi-square approximation (method = "chisq").

References

Bejleri, V., Sartore, L. & Nandram, B. (2021). Asymptotic equivalence between frequentist and Bayesian prediction limits for the Poisson distribution. Journal of the Korean Statistical Society tools:::Rd_expr_doi("10.1007/s42952-021-00157-x")

Bejleri, V. (2005). Bayesian Prediction Intervals for the hyperbootstrapon Model, Noninformative Priors, Ph.D. Dissertation, American University, Washington, DC.

See Also

poisBayes, poisJEFF, poisUNIF

Examples

Run this code
# Loading the package
library(plpoisson)
set.seed(2021L)

# Number of observed time windows
n <- 555L

# Simulating a dataset
data <- cbind.data.frame(
    occ_obs = rpois(n, rgamma(n, 5.5, .5)),
    win_siz = rgamma(n, 1.44, .777)
) 

## Compute bootstrap estimates using all methods
hyperbootstrap(data$occ_obs, 10L) # only 10 iterations

Run the code above in your browser using DataLab