Learn R Programming

MLZ (version 0.1.1)

compare_models: Model selection

Description

Produces a matrix of AIC for model selection.

Usage

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

Arguments

MLZ_model.list

A list containing 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

Run this code
# 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(list(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(list(ssm, msm1, msm2, msm3))
# }

Run the code above in your browser using DataLab