update.jmdem: Update and Re-fit a JMDEM Call

Description Usage Arguments Author(s) References See Also Examples

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

1
2
## S3 method for class 'jmdem'
update(object, mformula, dformula, ...)

Arguments

object

An existing fit from a jmdem model function

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 name = NULL to remove the argument name.

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

update.formula

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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")

jmdem documentation built on March 13, 2020, 2:20 a.m.

Related to update.jmdem in jmdem...