# Poisson-Gamma Distribution with GLM

### Description

The function fits a mixed Poisson distribution, in which the random parameter follows Gamma distribution. As the method of estimation Expectation-maximization algorithm is used. In M-step the GLM is applied.

### Usage

 1 pg.dist.glm(variable, lambda.start, gamma.par.start, epsylon, n) 

### Arguments

 variable The count dependent variable in the regression. lambda.start The starting value of lambda parameter of Poisson distribution. Default to 1. gamma.par.start The starting value of delta parameter of Gamma distribution. Default to 1. epsylon Default to epsylon = 10^(-8) n The integer value for the Laguerre quadrature. Default to 100.

### Details

This function provides estimated parameters of the model N|θ \sim Poisson(λ θ) where θ is a latent variable comes from Gamma distribution with one parameter γ. The pdf of Gamma is of the form f_θ(θ)=\frac{γ^γ}{Γ(γ)}θ^{γ-1}\exp(-γθ) . The parameter λ is determined by the intercept through log-link λ=\exp(β_0).

### Value

 lambda fixed effect in mixed Poisson distribution gamma.par the parameter of mixing Gamma distribution n.iter n likelihood.values values of log-likelihood

### References

Karlis, D. (2005). EM algorithm for mixed Poisson and other discrete distributions. Astin bulletin, 35(01), 3-24.

### Examples

 1 2 3 4 library(MASS) var = quine$Days[quine$Days<11] pGamma = pg.dist.glm(variable=var) print(pGamma) 

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.