Function gamlssZadj()
allows to fit zero adjusted gamlss models when the response variable distribution is defined on the positive real line.
The gamlssZadj
model for adjusted positive variables is a gamlss
model provides one extra parameters for the mass point at zero. This is equivalent to fit two separate models, a gamlss model for the (0,Inf) part, and a logit model for zero part versus the non-zero part. The function works similarly but provides one fitted object.
gamlssZadj(y = NULL, mu.formula = ~1, sigma.formula = ~1,
nu.formula = ~1, tau.formula = ~1,
xi0.formula = ~1, data = NULL,
family = GA,
weights = rep(1, length(Y_)), trace = FALSE, ...)
.
Returns a gamlssZadj
object which has its own methods
the response variable
a model formula for mu
a model formula for sigma
a model formula for nu
a model formula for tau
a model formula for xi0
a data frame containing the variables occurring in the formula.
any gamlss
distribution family defined on the rael line
a vector of weights as in gamlss
logical, if TRUE information on model estimation will be printed during the fitting
for extra arguments to pass to gamlss
Mikis Stasinopoulos, Robert Rigby and Marco Enea
The default family is a gamma distribution (GA), but other distributions on the positive rael line can be used, e.g. those generated from existing continuous gamlss.family
distributions using say gen.Family()
with "log"
or gen.trun()
from package gamlss.tr
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.
Stasinopoulos D. M., Rigby R.A. and Akantziliotou C. (2006) Instructions on how to use the GAMLSS package in R. Accompanying documentation in the current GAMLSS help files, (see also https://www.gamlss.com/).
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, https://www.jstatsoft.org/v23/i07.
Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC. https://www.routledge.com/Flexible-Regression-and-Smoothing-Using-GAMLSS-in-R/Stasinopoulos-Rigby-Heller-Voudouris-Bastiani/p/book/9781138197909.
gamlss.family
, ZAGA
, ZAIG
y0 <- rZAGA(1000, mu=.3, sigma=.4, nu=.15)# p0=0.13
g0 <- gamlss(y0~1, family=ZAGA)
t0 <- gamlssZadj(y=y0, mu.formula=~1, family=GA, trace=TRUE)
AIC(g0,t0, k=0)
Run the code above in your browser using DataLab