GenUniGpois: Generates Univariate Generalized Poisson Variates

Description Usage Arguments Details Value References Examples

View source: R/GenUniGpois.R

Description

GenUniGpois generates univariate random variables from the generalized Poisson distribution using one of the five methods including Inversion, Branching, Normal-Approximation, Build-Up, and Chop-Down.

Usage

1
GenUniGpois(theta, lambda, n, details = TRUE, method)

Arguments

theta

the rate parameter in the generalized Poisson distribution. It has to be a positive number.

lambda

the dispersion parameter in the generalized Poisson distribution. It has to be less than 1. For lambda < 0, lambda must be greater than or equal to -theta/4.

n

number of data points that is to be generated.

details

index to indicate whether to print out the estimates of parameters. Default is set to TRUE.

method

index to specify one of the five methods for generating univariate GPD variable: "Inversion", "Branching", "Normal-Approximation", "Build-Up" or "Chop-Down".

Details

All five methods come from Demirtas (2017). When lambda equals to 0, it is the ordinary Poisson distribution, so there is no need to specify the method. "Branching" only works when lambda is positive. When theta is less than 10, the "Normal-Approximation" may not be reliable.

Value

A list that includes generated data, specified and empirical values of theta and lambda, and the specified method.

References

Demirtas, H. (2017). On accurate and precise generation of generalized Poisson variates. Communications in Statistics - Simulation and Computation, 46(1), 489-499.

Examples

1
2
3
4
5
GenUniGpois(5, -0.4, 100, method = "Inversion")
GenUniGpois(2, 0.9, 100, method = "Branching")
GenUniGpois(12, 0.5, 100, method = "Normal-Approximation")
data <- GenUniGpois(3, 0.9, 10000, method = "Build-Up", details = FALSE)
data <- GenUniGpois(10, 0.4, 10, method = "Chop-Down", details = FALSE)

RNGforGPD documentation built on Nov. 18, 2020, 5:08 p.m.