Function to create parameter scen_list
in
run_SSMSE
, but also could be used by users to construct their
list prior to using run_SSMSE
. Note that there is no error
checking in this function, so getting output does not insure that this output
can be used as input to run_SSMSE.
Usage
create_scen_list(
scen_name_vec,
out_dir_scen_vec = NULL,
iter_vec = NULL,
OM_name_vec = NULL,
OM_in_dir_vec = NULL,
EM_name_vec = NULL,
EM_in_dir_vec = NULL,
MS_vec = NULL,
use_SS_boot_vec = NULL,
nyrs_vec = NULL,
nyrs_assess_vec = NULL,
sample_struct_list = NULL,
sample_struct_hist_list = NULL,
sample_catch_vec = NULL,
interim_struct_list = NULL
)
Arguments
- scen_name_vec
A vector containing names of the scenarios. The each string will be a directory containing all the model runs for a scenario.s
- out_dir_scen_vec
The directory to which to write output. IF NULL, will default to the working directory.
- iter_vec
The number of iterations per scenario. A vector of integers in the same order as scen_name_vec.
- OM_name_vec
Names of a valid Stock Synthesis stock assessment model. To see the names of built-in models, type
list.dirs(system.file("extdata", "models", package = "SSMSE"),full.names = FALSE, recursive = FALSE)
into the R console.- OM_in_dir_vec
Vector of relative or absolute paths to the operating model, if using a model outside of the SSMSE package.
- EM_name_vec
Should be NULL unless
MS = "EM"
. Name of a valid Stock Synthesis stock assessment model to use as an EM. If the value of EM_name is NULL andMS = "EM"
, then SSMSE will look for the estimation model in the path specified in EM_in_dir. valid inputs for EM_name are:"cod"
orNULL
.- EM_in_dir_vec
Relative or absolute path to the estimation model, if using model outside of the SSMSE package. Note that this value should be NULL if
MS
has a value other than "EM".- MS_vec
Vector of management strategies. Current options are:
"last_yr_catch"
which uses the previous year's catch;"no_catch"
which uses 0 catch;"EM"
which uses an stock synthesis model as the estimation method and the management strategy as defined in the forecast file of the stock synthesis estimation method;"Interim"
to modify catch based on survey predictions between assessments. Users can also specify their own managment strategies as an function. To use the function, it must be available in the global enviroment and specified by name in MS. For example, if the function is called "my_ms" then the user should make it available in the global environment and specify "my_ms" as a component of MS_vec.- use_SS_boot_vec
Should a bootstrapped data set generated by SS be used? Defaults to TRUE.
- nyrs_vec
Number of years beyond the years included in the OM to run the MSE. A single integer value.
- nyrs_assess_vec
The number of years between assessments. E.g., if an assessment is conducted every 3 years, put 3 here. A single integer value. (NOTE: This could be made more flexible by instead reading in a vector of assessment years, so users could specify irregular numbers of yrs between assessments.)
- sample_struct_list
A optional list of lists including which years, seasons, and fleets should be added from the OM into the EM for different types of data. If NULL, the data structure will try to be infered from the pattern found for each of the datatypes within the EM datafiles. Include this strucutre for the number of years to extend the model out.
- sample_struct_hist_list
An optional list of lists including which years should be sampled for the historical period for the data generated from the OM. If this is left as NULL, then the same sampling scheme will be used as in the OM's data file. If it is not NULL, then each year
- sample_catch_vec
Should catch be sampled or fixed at the OM values? This can be a single Boolean (TRUE or FALSE) to apply to all scenarios or a vector of the same length as the number of scenarios. Defaults to FALSE.
- interim_struct_list
A optional list of parameters to control an interim assessment with an example structure below, where Beta=a positive value that is inversely proportional to risk, MA_years= the number of years to average index observations of when calculating deviations, assess_freq=the number of years between full assessments during with an interim assessment will happen every year, and Index_weights is a vector of length n indexes that weights all indexes for multi index inference.
interim_struct_list<-list(Beta=1,MA_years=3,assess_freq=5,Index_weights=rep(1,max(ref_index[,3])))
Examples
scen_list <- create_scen_list(
scen_name_vec = c("scen 1", "scen_2"),
out_dir_scen_vec = file.path("path", "to", "dir"),
iter_vec = list(1:2, 5:7),
OM_name_vec = "cod",
OM_in_dir_vec = NULL,
EM_name_vec = "cod",
EM_in_dir_vec = NULL,
MS_vec = "EM",
use_SS_boot_vec = TRUE,
nyrs_vec = 6,
nyrs_assess_vec = 3,
sample_struct_list = NULL
)