Last data update: 2014.03.03

R: The Generalized Poisson Distribution
dgenpoisR Documentation

The Generalized Poisson Distribution

Description

Density, distribution function and random generation function for the generalized Poisson distribution.

Usage

dgenpois(x, lambda1, lambda2)
pgenpois(q, lambda1, lambda2)
rgenpois(n, lambda1, lambda2)

Arguments

x

a vector object of (non-negative integer) quantiles.

q

a numeric value.

n

number of random values to return.

lambda1

a single numeric value for parameter lambda1 with lambda1 > 0.

lambda2

a single numeric value for parameter lambda2 with 0 ≤ lamdba2 < 1. When lambda2=0, the generalized Poisson distribution reduces to the Poisson distribution.

Details

The generalized Poisson distribution has the density

p(x) = lambda1 (lambda1 + lambda2 x)^(x-1) exp(-lambda1-lambda2 x) )/x!

for x = 0,1,2,…,b

with E(x)=lambda1/(1-lambda2) and variance var(x)=lambda1/(1-lambda2)^3.

Value

dgenpois gives the density, pgenpois gives the distribution function and rgenpois generates random deviates.

Author(s)

Based on Joe and Zhu (2005). Implementation by Vitali Witowski (2013).

References

Joe, H., Zhu, R. (2005). Generalized poisson distribution: the property of mixture of poisson and comparison with negative binomial distribution. Biometrical Journal 47(2):219–229.

See Also

Distributions for other standard distributions, including dpois for the Poisson distribution.

Examples

dgenpois(x = seq(0,20), lambda1 = 10, lambda2 = 0.5) 

pgenpois(q = 5, lambda1 = 10, lambda2 = 0.5) 

hist(rgenpois(n = 1000, lambda1 = 10, lambda2 = 0.5) )

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HMMpa)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HMMpa/dgenpois.Rd_%03d_medium.png", width=480, height=480)
> ### Name: dgenpois
> ### Title: The Generalized Poisson Distribution
> ### Aliases: dgenpois pgenpois rgenpois
> ### Keywords: distribution
> 
> ### ** Examples
> 
> dgenpois(x = seq(0,20), lambda1 = 10, lambda2 = 0.5) 
 [1] 4.539993e-05 2.753645e-04 9.185935e-04 2.232841e-03 4.423833e-03
 [6] 7.581895e-03 1.165617e-02 1.646632e-02 2.173967e-02 2.715883e-02
[11] 3.240717e-02 3.720461e-02 4.133055e-02 4.463423e-02 4.703503e-02
[16] 4.851540e-02 4.910970e-02 4.889126e-02 4.795954e-02 4.642864e-02
[21] 4.441766e-02
> 
> pgenpois(q = 5, lambda1 = 10, lambda2 = 0.5) 
[1] 0.01547793
> 
> hist(rgenpois(n = 1000, lambda1 = 10, lambda2 = 0.5) )
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>