LG defines the logarithmic distribution, a one parameter distribution, for a gamlss.family object to be
used in GAMLSS fitting using the function gamlss(). The functions dLG, pLG, qLG and rLG define the
density, distribution function, quantile function
and random generation for the logarithmic , LG(), distribution.
The function ZALG defines the zero adjusted logarithmic distribution, a two parameter distribution, for a gamlss.family object to be
used in GAMLSS fitting using the function gamlss(). The functions dZALG, pZALG, qZALG and rZALG define the
density, distribution function, quantile function
and random generation for the inflated logarithmic , ZALG(), distribution.LG(mu.link = "logit")
dLG(x, mu = 0.5, log = FALSE)
pLG(q, mu = 0.5, lower.tail = TRUE, log.p = FALSE)
qLG(p, mu = 0.5, lower.tail = TRUE, log.p = FALSE, max.value = 10000)
rLG(n, mu = 0.5)
ZALG(mu.link = "logit", sigma.link = "logit")
dZALG(x, mu = 0.5, sigma = 0.1, log = FALSE)
pZALG(q, mu = 0.5, sigma = 0.1, lower.tail = TRUE, log.p = FALSE)
qZALG(p, mu = 0.5, sigma = 0.1, lower.tail = TRUE, log.p = FALSE)
rZALG(n, mu = 0.5, sigma = 0.1)mu.link, with logit link as the default for the mu parametersigma.link, with logit link as the default for the sigma parameter which in this case
is the probability at zero.LG and ZALG return a gamlss.family object which can be used to fit a
logarithmic and a zero inflated logarithmic distributions respectively in the gamlss() function.gamlss.family, PO, ZAPLG()
ZAP()
# creating data and plotting them
dat <- rLG(1000, mu=.3)
r <- barplot(table(dat), col='lightblue')
dat1 <- rZALG(1000, mu=.3, sigma=.1)
r1 <- barplot(table(dat1), col='lightblue')Run the code above in your browser using DataLab