compare_models: Model selection

View source: R/compare_models.R

compare_modelsR Documentation

Model selection

Description

Produces a matrix of AIC for model selection.

Usage

compare_models(..., figure = TRUE, color = NULL)

Arguments

...

Multiple objects of class MLZ_model, all from the same mortality estimator and same data set.

figure

If TRUE, produces a figure of model fits to the observed data.

color

Optional vector of colors for the figure each representing a separate model in MLZ_model.list. If NULL, colors from rich.colors will be used.

Examples

## Not run: 
data(Goosefish)
goose <- ML(Goosefish, ncp = 0)
goose1 <- ML(Goosefish, ncp = 1)
goose2 <- ML(Goosefish, ncp = 2, grid.search = TRUE, figure = FALSE)

compare_models(goose, goose1, goose2)

data(PRSnapper)
ssm <- MLmulti(PRSnapper, ncp = 1, model = "SSM")
msm1 <- MLmulti(PRSnapper, ncp = 1, model = "MSM1")
msm2 <- MLmulti(PRSnapper, ncp = 1, model = "MSM2")
msm3 <- MLmulti(PRSnapper, ncp = 1, model = "MSM3")

compare_models(ssm, msm1, msm2, msm3)

## End(Not run)

MLZ documentation built on March 29, 2022, 9:07 a.m.