Fits an ARIMA model separately to each supplied reconstruction draw and simulates future recruitment deviations.
Usage
project_rec_devs(
data,
obj,
mcmc = NULL,
first_yr = 2021L,
last_yr = 2035L,
samp_years = 1931L:2022L,
iters = NULL,
max.p = 3L,
max.d = 3L,
max.q = 3L,
option = "auto",
bootstrap = TRUE,
pin_year = first_yr - 1L
)Arguments
- data
A
listcontaining model data including dimensions and years.- obj
A TMB model
objectreturned fromMakeADFun.- mcmc
Optional MCMC fit object from
SparseNUTS. IfNULL, uses MLE parameters.- first_yr
An
integerspecifying the first projection year (default: 2021).- last_yr
An
integerspecifying the last projection year (default: 2035).- samp_years
An
integervector of historical years to sample recruitment deviates from (default: 1931:2022).- iters
An
integervector specifying which MCMC iterations to use. IfNULL, uses all iterations.- max.p
An
integerspecifying the maximum AR order to consider in ARIMA model selection (default: 3).- max.d
An
integerspecifying the maximum degree of differencing for stationarity (default: 3).- max.q
An
integerspecifying the maximum MA order to consider in ARIMA model selection (default: 3).- option
A
characterstring specifying the ARIMA fitting method: "auto" for automatic selection or "AR1" for AR(1) model (default: "auto").- bootstrap
A
logicalindicating whether to bootstrap residuals (TRUE) or use normal random errors (FALSE) (default:TRUE).- pin_year
Optional
integerhistorical year used to pin the first projected recruitment deviate. The first simulated projection deviate is forced to equal the posterior recruitment deviate in this year. IfNULL, the first projected deviate is not pinned. The default isfirst_yr - 1, matching the previous projection setup.
Value
A list containing:
- rdev_y
A
matrixof historical recruitment deviates with dimensions \[n_iter, n_years\].- proj_rdev_y
A
matrixof projected recruitment deviates with dimensions \[n_iter, n_proj\].- arima_pars
A
matrixof ARIMA(p,d,q) specifications with dimensions \[n_iter, 3\].- ar_pars
A
matrixof AR coefficients with dimensions \[n_iter, max.p\].- ma_pars
A
matrixof MA coefficients with dimensions \[n_iter, max.q\].- pin_year
The historical year used to pin the first projected recruitment deviate, or
NULL.- pin_rdev
The posterior recruitment deviate values used for pinning, or
NULL.
Details
The output row order follows iters. Simulation and optional
residual bootstrapping consume the caller's random-number state. The
function does not set or restore a seed.
See also
Other projection helpers:
extend_hsp_cohorts(),
project_ctp_schedule(),
project_selectivity(),
run_projections()
