update.gamlss {gamlss} | R Documentation |
Update and Re-fit a GAMLSS Model
Description
update.gamlss
is the GAMLSS specific method for the generic function update
which updates and (by default) refits a GAMLSS model.
Usage
## S3 method for class 'gamlss'
update(object, formula., ...,
what = c("mu", "sigma", "nu", "tau", "All"),
parameter= NULL, evaluate = TRUE)
Arguments
object |
a GAMLSS fitted model |
formula. |
the formula to update |
... |
for updating argument in |
what |
the parameter in which the formula needs updating for example "mu", "sigma", "nu" "tau" or "All". If "All" all the formulae are updated. Note that the |
parameter |
equivalent to |
evaluate |
whether to evaluate the call or not |
Value
Returns a GAMLSS call or fitted object.
Author(s)
Mikis Stasinopoulos, Bob Rigby
References
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.
Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC. An older version can be found in 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.
(see also https://www.gamlss.com/).
See Also
print.gamlss
, summary.gamlss
, fitted.gamlss
, coef.gamlss
,
residuals.gamlss
, plot.gamlss
, deviance.gamlss
, formula.gamlss
Examples
data(aids)
# fit a poisson model
h.po <-gamlss(y~pb(x)+qrt, family=PO, data=aids)
# update with a negative binomial
h.nb <-update(h.po, family=NBI)
# update the smoothing
h.nb1 <-update(h.nb,~cs(x,8)+qrt)
# remove qrt
h.nb2 <-update(h.nb1,~.-qrt)
# put back qrt take log of y and fit a normal distribution
h.nb3 <-update(h.nb1,log(.)~.+qrt, family=NO)
# verify that it is the same
h.no<-gamlss(log(y)~cs(x,8)+qrt,data=aids )