update.jmdem {jmdem} | R Documentation |
Update and Re-fit a JMDEM Call
Description
update
will update and (by default) re-fit a model. It does this by extracting the call stored in the object, updating the call and (by default) evaluating that call. Sometimes it is useful to call update with only one argument, for example if the data frame has been corrected.
Usage
## S3 method for class 'jmdem'
update(object, mformula, dformula, ...)
Arguments
object |
An existing fit from a |
mformula |
Changes to the formula of the mean submodel - see update.formula for details. |
dformula |
Changes to the formula of the dispersion submodel - see update.formula for details. |
... |
Additional arguments to the call, or arguments with changed values. Use |
Author(s)
Karl Wu Ka Yui (karlwuky@suss.edu.sg)
References
Chambers, J. M. (1992). Linear models. Chapter 4 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole.
See Also
Examples
## Example in jmdem(...): Update the dispersion fitting based on Pearson
## residuals and change from Nelder-Mead to BFGS as optimisation method.
MyData <- simdata.jmdem.sim(mformula = y ~ x, dformula = ~ z,
mfamily = poisson(),
dfamily = Gamma(link = "log"),
beta.true = c(0.5, 4),
lambda.true = c(2.5, 3), n = 100)
fit <- jmdem(mformula = y ~ x, dformula = ~ z, data = MyData,
mfamily = poisson, dfamily = Gamma(link = "log"),
dev.type = "deviance", method = "CG")
update(fit, dev.type = "pearson", method = "BFGS")