HYPERPO function

The hyper Poisson family

The hyper Poisson family

The function HYPERPO() defines the hyper Poisson distribution, a two parameter distribution, for a gamlss.family object to be used in GAMLSS fitting using the function gamlss().

HYPERPO(mu.link = "log", sigma.link = "log")

Arguments

  • mu.link: defines the mu.link, with "log" link as the default for the mu parameter.
  • sigma.link: defines the sigma.link, with "log" link as the default for the sigma.

Returns

Returns a gamlss.family object which can be used to fit a hyper-Poisson distribution in the gamlss() function.

Details

The hyper-Poisson distribution with parameters μ\mu and σ\sigma

has a support 0, 1, 2, ... and density given by

f(xμ,σ)=μx1F1(1;μ;σ)Γ(σ)Γ(x+σ)f(x | \mu, \sigma) = \frac{\mu^x}{_1F_1(1;\mu;\sigma)}\frac{\Gamma(\sigma)}{\Gamma(x+\sigma)}

where the function 1F1(a;c;z)_1F_1(a;c;z) is defined as

1F1(a;c;z)=r=0(a)r(c)rzrr!_1F_1(a;c;z) = \sum_{r=0}^{\infty}\frac{(a)_r}{(c)_r}\frac{z^r}{r!}

and (a)r=γ(a+r)γ(a)(a)_r = \frac{\gamma(a+r)}{\gamma(a)} for a>0a>0 and rr positive integer.

Note: in this implementation we changed the original parameters λ\lambda and γ\gamma

for μ\mu and σ\sigma respectively, we did it to implement this distribution within gamlss framework.

Examples

# Example 1 # Generating some random values with # known mu and sigma set.seed(1234) y <- rHYPERPO(n=200, mu=10, sigma=1.5) # Fitting the model library(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=HYPERPO, control=gamlss.control(n.cyc=500, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values under some model # A function to simulate a data set with Y ~ HYPERPO gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.21 - 3 * x1) # 0.75 approximately sigma <- exp(1.26 - 2 * x2) # 1.30 approximately y <- rHYPERPO(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(1235) datos <- gendat(n=150) mod2 <- NULL mod2 <- gamlss(y~x1, sigma.fo=~x2, family=HYPERPO, data=datos, control=gamlss.control(n.cyc=500, trace=FALSE)) summary(mod2)

References

\insertRef saez2013hyperpoDiscreteDists

See Also

dHYPERPO .

Author(s)

Freddy Hernandez, fhernanb@unal.edu.co

  • Maintainer: Freddy Hernandez-Barajas
  • License: MIT + file LICENSE
  • Last published: 2024-09-13