Skip to contents

Project recruitment deviates

Usage

project_rec_devs(
  data,
  obj,
  mcmc = NULL,
  first_yr = 2021,
  last_yr = 2035,
  samp_years = 1931:2022,
  iters = NULL,
  max.p = 5,
  max.d = 5,
  max.q = 5,
  option = "auto",
  bootstrap = TRUE
)

Arguments

data

A list containing model data including dimensions and years.

obj

A TMB model object returned from MakeADFun.

mcmc

Optional MCMC fit object from SparseNUTS. If NULL, uses MLE parameters.

first_yr

An integer specifying the first projection year (default: 2021).

last_yr

An integer specifying the last projection year (default: 2035).

samp_years

An integer vector of historical years to sample recruitment deviates from (default: 1931:2022).

iters

An integer vector specifying which MCMC iterations to use. If NULL, uses all iterations.

max.p

An integer specifying the maximum AR order to consider in ARIMA model selection (default: 5).

max.d

An integer specifying the maximum degree of differencing for stationarity (default: 5).

max.q

An integer specifying the maximum MA order to consider in ARIMA model selection (default: 5).

option

A character string specifying the ARIMA fitting method: "auto" for automatic selection or "AR1" for AR(1) model (default: "auto").

bootstrap

A logical indicating whether to bootstrap residuals (TRUE) or use normal random errors (FALSE) (default: TRUE).

Value

A list containing:

rdev_y

A matrix of historical recruitment deviates with dimensions \[n_iter, n_years\].

proj_rdev_y

A matrix of projected recruitment deviates with dimensions \[n_iter, n_proj\].

arima_pars

A matrix of ARIMA(p,d,q) specifications with dimensions \[n_iter, 3\].

ar_pars

A matrix of AR coefficients with dimensions \[n_iter, max.p\].

ma_pars

A matrix of MA coefficients with dimensions \[n_iter, max.q\].