The function LIN() defines the Lindley distribution with only one parameter for a gamlss.family object to be used in GAMLSS fitting using the function gamlss().
LIN(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 LIN distribution in the gamlss() function.
Details
The Lindley with parameter mu has density given by
f(x)=μ+1μ2(1+x)exp(−μx),
for x > 0 and μ>0.
Examples
# Example 1# Generating some random values with# known mu, sigma and nuy <- rLIN(n=200, mu=2)# Fitting the modelrequire(gamlss)mod <- gamlss(y ~1, family="LIN")# Extracting the fitted values for mu# using the inverse link functionexp(coef(mod, what='mu'))# Example 2# Generating random values under some modeln <-100x1 <- runif(n=n)x2 <- runif(n=n)eta <-1+3* x1 -2* x2
mu <- exp(eta)y <- rLIN(n=n, mu=mu)mod <- gamlss(y ~ x1 + x2, family=LIN)coef(mod, what='mu')