Projects each non-direct-removal selectivity series either by repeating its recent mean or by drawing independent lognormal values by age.
Usage
project_selectivity(
data,
obj,
mcmc = NULL,
first_yr = 2021L,
last_yr = 2035L,
samp_years = NULL,
iters = NULL,
option = c("mean_last", "lognormal"),
n_years = 10L,
retain_fitted_through = first_yr - 1L
)Arguments
- data
A
listcontaining model data including dimensions and biological parameters.- 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 use when projecting selectivity. IfNULL, uses then_yearsyears immediately beforefirst_yr.- iters
An
integervector specifying which MCMC iterations to use. IfNULL, all posterior draws are used whenmcmcis supplied and one MLE iteration is used otherwise.- option
A
characterstring specifying the projection method."mean_last"repeats the mean selectivity oversamp_years;"lognormal"draws future selectivity from the historical log-scale mean and standard deviation.- n_years
An
integerspecifying the number of historical years to use whensamp_years = NULL.- retain_fitted_through
Final historical assessment year whose fitted selectivity is retained in the output. It must be between
first_yr - 1anddata$last_yr. The default,first_yr - 1, projects selectivity for every output year.
Details
The output row order follows iters. The lognormal option
calls rnorm() and changes the caller's random-number state; set the
seed before calling when reproducibility is required. Output years through
retain_fitted_through are copied from the corresponding fitted
posterior selectivity before the projection method is applied to later
years. Direct-removal series remain missing because selectivity is not used
for those removals.
See also
Other projection helpers:
extend_hsp_cohorts(),
project_ctp_schedule(),
project_rec_devs(),
run_projections()
