The function DIKUM() defines the discrete Inverted Kumaraswamy distribution, a two parameter distribution, for a gamlss.family object to be used in GAMLSS fitting using the function gamlss().
DIKUM(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 discrete Inverted Kumaraswamy distribution in the gamlss() function.
Details
The discrete Inverted Kumaraswamy distribution with parameters μ and σ
has a support 0, 1, 2, ... and density given by
f(x∣μ,σ)=(1−(2+x)−μ)σ−(1−(1+x)−μ)σ
with μ>0 and σ>0.
Note: in this implementation we changed the original parameters α and β
for μ and σ respectively, we did it to implement this distribution within gamlss framework.
Examples
# Example 1# Generating some random values with# known mu and sigmaset.seed(150)y <- rDIKUM(1000, mu=1, sigma=5)# Fitting the modellibrary(gamlss)mod1 <- gamlss(y ~1, sigma.fo =~1, family=DIKUM, control = gamlss.control(n.cyc=500, trace=FALSE))# Extracting the fitted values for mu and sigma# using the inverse link functionexp(coef(mod1, what='mu'))exp(coef(mod1, what='sigma'))# Example 2# Generating random values under some modellibrary(gamlss)# A function to simulate a data set with Y ~ DIKUMgendat <-function(n){ x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(1.21-3* x1)# 0.75 approximately sigma <- exp(1.26-2* x2)# 1.30 approximately y <- rDIKUM(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2)}dat <- gendat(n=150)# Fitting the modelmod2 <- gamlss(y ~ x1, sigma.fo =~x2, family ="DIKUM", data=dat, control=gamlss.control(n.cyc=500, trace=FALSE))summary(mod2)