fit.models {robust} | R Documentation |
Combines comparable models into single object. Generic methods produce side-by-side comparisons of the estimated model parameters and disagnostic plots.
fit.models(model.list, formula = NULL, ...)
model.list |
either a list of calls or a list of function names. This argument is not required when combining one or more fitted models into a fit.models object. |
formula |
when model.list is a list of function names the second argument is often a formula. This saves you the trouble of having to name it explicitly when calling fit.models. |
... |
additional arguments to be passed to the functions in model.list . |
If model.list
is a list of calls then fit.models
replaces each element by its evaluated call and sets the appripriate class.
If model.list
is a list of function names then fit.models
creates a call to each of the functions in model.list
by combining the respective function name with the remaining arguments passed to fit.models
. The list of calls is then evalued as described above.
If model.list
is a fitted model object then fit.models
assumes that each of its argument is a fitted model object. The arguments are put into a list, the appropriate class is set, and the list is returned.
To be comparable the specified models must all belong to one of the supported classes in fit.models. The supported classes of models in this release of the Robust Library are (1) Covariance/Correlation Models {"cov", "covRob"}. The subfunction get.fit.models.database
provides fit.models
with the classes of comparable models.
The returned object is a list containing the fitted models. The class of the retuned object depends on the classes of the model objects it contains. Returned objects containing class "cov" and "covRob" objects have class "covfm".
data(woodmod.dat) woodmod.fm <- fit.models(list(Robust = "covRob", Classical = "cov"), data = woodmod.dat) #This way doesn't work in R yet #woodmod.cls <- cov(woodmod.dat) #woodmod.rob <- covRob(woodmod.dat) #woodmod.fm <- fit.models(Robust = woodmod.rob, Classical = woodmod.cls)