On this page

Run a retrospective analysis of an ALSCL fit; a short form of retro_model(model_type = "alscl").

Usage

retro_alscl(
  nyear = 5,
  data.CatL,
  data.wgt,
  data.mat,
  rec.age,
  nage,
  M,
  sel_L50,
  sel_L95,
  growth_step = NULL,
  ...
)

Arguments

ArgumentDefaultDescription
nyear5

Integer. Number of retrospective peels. Default 5. The number of time steps that each peel removes follows the peel_step argument of retro_model() (default 1).

data.CatLrequired

Survey index table (length labels followed by one column per time step), or the input bundle used by run_acl() or run_alscl(), as in retro_alscl(x, nyear = 3).

data.wgtrequired

Weight table, with the same length bins and time steps as the survey index table.

data.matrequired

Maturity table, with values between 0 and 1 and the same length bins and time steps as the survey index table.

rec.agerequired

Recruitment age in years.

nagerequired

Number of age classes. The last class holds the fish of its starting age and older.

Mrequired

Natural mortality rate per model time step; see retro_model() for its forms.

sel_L50required

Length at 50 percent survey catchability.

sel_L95required

Length at 95 percent survey catchability, greater than sel_L50.

growth_stepNULL

Length of a time step in years (0.25 for quarterly data). NULL uses rec.age when it is below 1, otherwise 1, as in run_alscl(); an input bundle supplies its own value.

...…

Other arguments of retro_model(), such as peel_step, nstarts or silent. A model or model_type that names the model of this function is ignored; one that names the other model is an error.

Value

The list that retro_model() returns, with results, last_points, rho_by_peel, rho_text, raw_rho_text, fit_diagnostics, errors, model_type, workers, nstarts, peel_step and, with plot = TRUE, plot; retro_model() describes each element.

Details

retro_alscl() calls retro_model() with model_type = "alscl". It takes the input bundle of the fitting functions, as in retro_alscl(x, nyear = 3), and passes the arguments of retro_model() that are not listed here, such as peel_step, nstarts, silent or F_structure, through .... retro_model() describes how the peels are made, the numerical checks behind Mohn's rho, the records in fit_diagnostics and the restrictions on map.

When the full fit and every peel stop with an error, the call stops with an error that quotes their messages; when at least one fit returns, the result is returned with the failures recorded in fit_diagnostics and errors. rho_text$Rho gives a value only when the full fit and every peel pass the numerical checks.

Examples

Run the setup before the example. Fitting examples require an R-compatible C++ toolchain; simulation and export examples may write files.

Example setup
library(ALSCL)
library(ggplot2)
library(patchwork)
data("YTF_example")
x <- YTF_example
inputs <- x[c("data.CatL", "data.wgt", "data.mat")]
dat <- x$data.CatL
a <- run_acl(x, silent = TRUE)
b <- run_alscl(x, silent = TRUE)
# Use objects defined above
rb <- retro_alscl(x, nyear = 3)
rb$fit_diagnostics
rb$rho_text
Example figure
Example figure: plot_retro(retro_alscl(x, nyear = 3))

See also

Search documentation