Runs a forward projecting MSE. Main assumptions are the projected selectivity/catchability, foraging days, and weight-at-age are the same as the terminal year of the hindcast in the operating model. Assumes survey sd is same as average across historic time series, while comp data sample size is same as last year. No implementation error and no observation error for catch!
Usage
run_mse(
om,
em,
nsim = 10,
start_sim = 1,
assessment_period = 1,
sampling_period = 1,
simulate_data = TRUE,
regenerate_past = FALSE,
sample_rec = TRUE,
rec_trend = 0,
fut_sample = 1,
cap = NULL,
catch_mult = NULL,
seed = 666,
regenerate_seed = seed,
loopnum = 1,
file = NULL,
dir = NULL,
timeout = 999,
endyr = NA,
cores = NULL
)Arguments
- om
CEATTLE model object exported from
Rceattle- em
CEATTLE model object exported from
Rceattle- nsim
Number of simulations to run (default 10)
- start_sim
First simulation number to start at. Useful if the code stops at specific seed/sim (default = 1).
- assessment_period
Period of years that each assessment is taken
- sampling_period
Period of years data sampling is conducted. Single value or vector the same length as the number of fleets.
- simulate_data
Include simulated random error proportional to that estimated/provided for the data from the OM.
- regenerate_past
Refits the EM to historical/conditioning data prior to the MSE, where the data are generated from the OM with
simulate_data = TRUEor withoutsimulate_data = FALSEsampling error.- sample_rec
Include resampled recruitment deviates from the"hindcast" in the projection of the OM. Resampled deviates are used rather than sampling from N(0, sigmaR) because initial deviates bias R0 low. If false, uses mean of recruitment deviates.
- rec_trend
Linear increase or decrease in mean recruitment from
endyrtoprojyr. This is the terminal multipliermean rec * (1 + (rec_trend/projection years) * 1:projection years). Can be of length 1 or of length nspp. If length 1, all species get the same trend.- fut_sample
future sampling effort relative to last year.
Log_sd * 1 / fut_samplefor index andSample_size * fut_samplefor comps- cap
A cap on the catch in the projection. Can be a single number applied to all species (proportional to recommended catch) or vector of length
nsppapplied to each species. Default = NULL- catch_mult
A multiplier for the catch in the projection. Can be a single number or vector of length nspp. Default = NULL
- seed
seed for the simulation
- regenerate_seed
seed for regenerating data
- loopnum
number of times to re-start optimization (where
loopnum=3sometimes achieves a lower final gradient thanloopnum=1)- file
(Optional) Filename where each OM simulation with EMs will be saved. If NULL, no files are saved.
- dir
(Optional) Directory where each OM simulation is saved
- timeout
length of time (minutes) estimation will run before stopping a sim (default 999 minutes)
- endyr
Terminal year of the MSE projection. Default = NA uses
projyrfrom the operating model.- cores
Number of cores to use for parallel simulations. Default
NULLpicksparallel::detectCores() - 6, capped at 2 when running underR CMD check(which sets_R_CHECK_LIMIT_CORES_). Set to 1 to force sequential execution.