DGEII function

The DGEII distribution

The DGEII distribution

The function DGEII() defines the Discrete generalized exponential distribution, Second type, a two parameter distribution, for a gamlss.family object to be used in GAMLSS fitting using the function gamlss().

DGEII(mu.link = "logit", sigma.link = "log")

Arguments

  • mu.link: defines the mu.link, with "logit" link as the default for the mu parameter. Other links are "probit" and "cloglog"'(complementary log-log).
  • 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 DGEII distribution in the gamlss() function.

Details

The DGEII distribution with parameters μ\mu and σ\sigma

has a support 0, 1, 2, ... and mass function given by

f(xμ,σ)=(1μx+1)σ(1μx)σf(x | \mu, \sigma) = (1-\mu^{x+1})^{\sigma}-(1-\mu^x)^{\sigma}

with 0<μ<10 < \mu < 1 and σ>0\sigma > 0. If σ=1\sigma=1, the DGEII distribution reduces to the geometric distribution with success probability 1μ1-\mu.

Note: in this implementation we changed the original parameters pp to μ\mu and α\alpha to σ\sigma, we did it to implement this distribution within gamlss framework.

Examples

# Example 1 # Generating some random values with # known mu and sigma set.seed(189) y <- rDGEII(n=100, mu=0.75, sigma=0.5) # Fitting the model library(gamlss) mod1 <- gamlss(y~1, family=DGEII, control=gamlss.control(n.cyc=500, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function inv_logit <- function(x) 1/(1 + exp(-x)) inv_logit(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 ~ GGEO gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- inv_logit(1.7 - 2.8*x1) sigma <- exp(0.73 + 1*x2) y <- rDGEII(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) datos <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=DGEII, data=datos, control=gamlss.control(n.cyc=500, trace=FALSE)) summary(mod2) # Example 3 # Number of accidents to 647 women working on H. E. Shells # for 5 weeks. Taken from # Nekoukhou V, Alamatsaz MH, Bidram H (2013) page 886. y <- rep(x=0:5, times=c(447, 132, 42, 21, 3, 2)) mod3 <- gamlss(y~1, family=DGEII, control=gamlss.control(n.cyc=500, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function inv_logit <- function(x) 1/(1 + exp(-x)) inv_logit(coef(mod3, what="mu")) exp(coef(mod3, what="sigma"))

References

\insertRef nekoukhou2013DiscreteDists

See Also

dDGEII .

Author(s)

Valentina Hurtado Sepúlveda, vhurtados@unal.edu.co

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