Create estimation model (EM) files from operating model (OM) files. By making small changes to the OM rather than having two sets of files, less files need to be maintained. Differences between the OM and EM are mainly related to how the OM takes input fishing mortality values rather than absolute catches.

create_em(
  dir_in = system.file("extdata", "models", "cod-om", package = "ss3sim"),
  dir_out = file.path(getwd(), "new-em")
)

Arguments

dir_in

A file path to a directory that contains the following files: forecast.ss, starter.ss, and a control file (e.g., xxxOM.ctl). The default is to get the codOM within ss3sim.

dir_out

A file path to a directory where the new files will be saved. The default is to save the files in your current working directory in a folder called new-em.

Value

Nothing is returned, but three files are saved to the disk in the specified folder that may also be new.

Control file

Most changes to the EM control file relate to recruitment and fishing. The phase in which recruitment deviations are estimated is checked to ensure that it is positive. Though, this might be unnecessary because the OM file can have negative or positive phases. Thus, users are encouraged to just set the phase in which recruitment is estimated in the OM at the value that they would like to use in the EM. Additional changes are made to the bias adjustment procedure based on the biology of the stock.

The F_Method is set to 3 to allow the model to estimate fishing mortality based on catches in the data file. Users might want to adjust the maximum fishing mortality based on their scenarios.

Data file

No data file is needed for the EM. The data_expval.ss file produced when executing the OM contains the expected values of the OM population dynamics. ss3sim provides three functions which carry out the random sampling process and generate .dat files to be used in the EM. See the Introduction vignette vignette("introduction", package = "ss3sim") for more details.

Forecast file

Nothing is changed in the forecast file from the OM.

Starter file

The names of the data and control files are specified and the maximum phase for estimation is set to 100.

Author

Kelli F. Johnson

Examples

create_em()
# The necessary files are in the following folder
dir(file.path(getwd(), "new-em"))
#> [1] "codEM.ctl"   "forecast.ss" "starter.ss" 
# Clean up your directory
unlink(file.path(getwd(), "new-em"), recursive = TRUE)