## Loading the package
library(plpoisson)
## Setting quantities of interest
xobs <- rpois(1, 50) # Number of the observed occurrencies
n <- 1 # Total number of the time windows of
# of size 's' observed in the past
s <- rgamma(1, 4, .567) # Fixed size of observed time windows
t <- rgamma(1, 3, .33) # Future time window
a <- 5 # Shape hyperparameter of a gamma prior
b <- 1.558 # Rate hyperparameter of a gamma prior
## Frequentist prediction limits
poiss(xobs, n, s, t)
## Bayesian prediction limits (with uniform prior)
poisUNIF(xobs, n, s, t)
## Bayesian prediction limits (with Jeffreys prior)
poisJEFF(xobs, n, s, t)
## Bayesian prediction limits (with gamma prior)
poisBayes(xobs, n, s, t, a, b)
Run the code above in your browser using DataLab