The function DLD() defines the Discrete Lindley distribution, one-parameter discrete distribution, for a gamlss.family object to be used in GAMLSS fitting using the function gamlss().
DLD(mu.link ="log")
Arguments
mu.link: defines the mu.link, with "log" link as the default for the mu parameter.
Returns
Returns a gamlss.family object which can be used to fit a Discrete Lindley distribution in the gamlss() function.
Details
The Discrete Lindley distribution with parameters μ>0 has a support 0, 1, 2, ... and density given by
f(x∣μ)=1+μe−μx(μ(1−2e−μ)+(1−e−μ)(1+μx))
The parameter μ can be interpreted as a strict upper bound on the failure rate function
The conventional discrete distributions (such as geometric, Poisson, etc.) are not suitable for various scenarios like reliability, failure times, and counts. Consequently, alternative discrete distributions have been created by adapting well-known continuous models for reliability and failure times. Among these, the discrete Weibull distribution stands out as the most widely used. But models like these require two parameters and not many of the known discrete distributions can provide accurate models for both times and counts, which the Discrete Lindley distribution does.
Note: in this implementation we changed the original parameters θ for μ, we did it to implement this distribution within gamlss framework.
Examples
# Example 1# Generating some random values with# known muy <- rDLD(n=100, mu=0.3)# Fitting the modellibrary(gamlss)mod1 <- gamlss(y~1, family=DLD, control=gamlss.control(n.cyc=500, trace=FALSE))# Extracting the fitted values for mu# using the inverse link functionexp(coef(mod1, what='mu'))# Example 2# Generating random values under some model# A function to simulate a data set with Y ~ DLDgendat <-function(n){ x1 <- runif(n) mu <- exp(2-4* x1) y <- rDLD(n=n, mu=mu) data.frame(y=y, x1=x1)}set.seed(1235)datos <- gendat(n=150)mod2 <-NULLmod2 <- gamlss(y~x1, sigma.fo=~x2, family=DLD, data=datos, control=gamlss.control(n.cyc=500, trace=FALSE))summary(mod2)