| UHLG | R Documentation |
The Unit Half Logistic-Geometry family
UHLG(mu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
The Unit Half Logistic-Geometry distribution with parameter mu,
has density given by
f(x| \mu) = \frac{2 \mu}{(\mu+(2-\mu)x)^2}
for 0 < x < 1 and \mu > 0.
Returns a gamlss.family object which can be used to fit a
UHLG distribution in the gamlss() function.
Juan Diego Suarez Hernandez, jsuarezhe@unal.edu.co
Ramadan, A. T., Tolba, A. H., & El-Desouky, B. S. (2022). A unit half-logistic geometric distribution and its application in insurance. Axioms, 11(12), 676.
dUHLG
# Example 1
# Generating some random values with
# known mu
y <- rUHLG(n=500, mu=7)
# Fitting the model
library(gamlss)
mod1 <- gamlss(y~1, family=UHLG,
control=gamlss.control(n.cyc=500, trace=FALSE))
# Extracting the fitted values for mu, sigma and nu
# using the inverse link function
exp(coef(mod1, what="mu"))
# Example 2
# Generating random values under some model
# A function to simulate a data set with Y ~ UHLG
gendat <- function(n) {
x1 <- runif(n, min=0.4, max=0.6)
x2 <- runif(n, min=0.4, max=0.6)
mu <- exp(-0.5 + 3*x1 - 2.5*x2)
y <- rUHLG(n=n, mu=mu)
data.frame(y=y, x1=x1, x2=x2)
}
datos <- gendat(n=5000)
mod2 <- gamlss(y~x1+x2,
family=UHLG, data=datos,
control=gamlss.control(n.cyc=500, trace=TRUE))
summary(mod2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.