Learn R Programming

spaMM (version 1.8.0)

COMPoisson: Conway-Maxwell-Poisson (COM-Poisson) GLM family

Description

The COM-Poisson family is a generalization of the Poisson family which can describe over-dispersed as well as under-dispersed count data. It is indexed by a parameter $\nu_CMP$ that quantifies such dispersion. The COM-Poisson family with given $\nu_CMP$ is here implemented as a family object, so that it can be fitted by glm, and further used to model conditional responses in mixed models fitted by this package's functions (see Examples). $\nu_CMP$ is distinct from the dispersion parameter $\nu=1/\phi$ considered elsewhere in this package and in the GLM literature, as $\nu$ affects in a distinct way the functional form of the log-likelihood. The canonical link $\theta(\mu)$ between the canonical GLM parameter $\theta$ and the expectation $\mu$ of the response do not have a known expression in terms of elementary functions. The link inverse is $\mu(\theta)=\sum_(i=0)^\infty \lambda^i / (i!)^\nu$ for $\lambda=e^\theta$ (hence the link is here nicknamed "loglambda").

Usage

COMPoisson(nu = stop("'nu' must be specified"), link = "loglambda")

Arguments

link
GLM link function. Cannot be modified.
nu
Under-dispersion parameter $\nu_CMP$. COMPoisson(nu=1) is the Poisson family. For $\nu>1$, the distribution is under-dispersed. The limit as $\nu -> 0$ is the Bernoulli distribution with expectation $\lambda/(1+\lambda)$. COMPoisson(nu=

Value

  • A family object. The 'simulate' function is not yet implemented.

Details

Fitting will be very slow when $\nu_CMP$ approaches zero, i.e. for strong overdispersion of (conditional) response. The link inverse, as shown in Description, involves an infinite summation. This can be easily approximated for large $\nu_CMP$ but not when $\nu_CMP$ approaches zero. By default, spaMM truncates the sum at spaMM.getOption(COMP_maxn)= 10000 terms, which should be more than enough for underdispersed response.

References

G. Shmueli, T. P. Minka, J. B. Kadane, S. Borle and P. Boatwright (2005) A useful distribution for fitting discrete data: revival of the Conway-Maxwell-Poisson distribution. Appl. Statist. 54: 127-142. Sellers KF, Shmueli G (2010) A Flexible Regression Model for Count Data. Ann. Appl. Stat. 4: 943–961

Examples

Run this code
data(freight)
  # Equivalence of poisson() and COMPoisson(nu=1):
  COMPglm <- glm(broken ~ transfers, data=freight, family = poisson())
  coef(COMPglm)
  logLik(COMPglm)
  COMPglm <- glm(broken ~ transfers, data=freight, family = COMPoisson(nu=1))
  coef(COMPglm)
  logLik(COMPglm)
  HLfit(broken ~ transfers, data=freight, family = COMPoisson(nu=1))
  # Greedy estimation of nu (solution nu=5.78..., cf Sellers & Shmueli 2010):
  objfn <- function(nu) {  
    fit <- HLfit(broken ~ transfers, data=freight, family = COMPoisson(nu=nu))
    logLik(fit)
  }
  optim(1,objfn,lower=0.05,upper=10,,method="L-BFGS-B",control=list(fnscale=-1))
  # GLMM with under-dispersed conditional response
  HLfit(broken ~ transfers+(1|id), data=freight, family = COMPoisson(nu=10),HLmethod="ML")

Run the code above in your browser using DataLab