View source: R/compare_wham_models.R
compare_wham_models | R Documentation |
After fitting multiple WHAM (or ASAP) models, compare_wham_models
produces plots
and a table of AIC and Mohn's rho to aid model comparison.
compare_wham_models(
mods,
do.table = TRUE,
do.plot = TRUE,
fdir = getwd(),
compare.opts = NULL,
table.opts = NULL,
plot.opts = NULL,
fname = NULL,
sort = NULL,
calc.rho = NULL,
calc.aic = NULL,
do.print = NULL
)
mods |
(named) list of fit WHAM/ASAP models. To read in ASAP model output, use |
do.table |
T/F, produce table of AIC and/or Mohn's rho? Default = TRUE. |
do.plot |
T/F, produce plots? Default = TRUE. |
fdir |
character, path to directory to save table and/or plots. Default = |
compare.opts |
list of options to generate comparison results:
|
table.opts |
list of options for AIC/rho table:
|
plot.opts |
list of options for plots:
|
plot.opts$which
specifies which plots to make:
3-panel of SSB (spawning stock biomass), F (fully-selected fishing mortality), and Recruitment
CV (coefficient of variation) for SSB, F, and Recruitment
Fleet selectivity (by block, averaged across years)
Index selectivity (by block, averaged across years)
Selectivity tile (fleets + indices, useful for time-varying random effects)
M time series (natural mortality, can specify which age with plot.opts$M.age)
M tile (useful for time-varying random effects)
3-panel of F X% SPR, SSB at F_X%SPR, and yield at F_X%SPR
2-panel of relative status (SSB / SSB at F_X%SPR and F / F_X%SPR)
Kobe status (relative SSB vs. relative F)
If plot.opts$return.ggplot = TRUE
, a list g
is returned holding the above ggplot2 objects for later modification.
g[[i]]
holds the plot corresponding to i
above, e.g. g[[2]]
is the CV plot.
a list with the following components:
daic
Vector of delta-AIC by model (if do.table=T
and table.opts$calc.aic=T
)
aic
Vector of AIC by model (if do.table=T
and table.opts$calc.aic=T
)
rho
Matrix of Mohn's rho by model (if do.table=T
and table.opts$calc.rho=T
)
best
Name of best model (lowest AIC) (if do.table=T
and table.opts$calc.aic=T
)
tab
Results table of AIC and Mohn's rho (if do.table=T
)
g
List of ggplot2 objects for later modification (if do.plot=T
and plot.opts$return.ggplot=T
)
fit_wham
, read_asap3_fit,
read_wham_fit
## Not run:
base <- read_asap3_fit()
m1 <- fit_wham(input1)
m2 <- fit_wham(input2)
mods <- list(base=base, m1=m1, m2=m2)
res <- compare_wham_models(mods)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.