Learn R Programming

DLMtool (version 3.2)

runMSErobust: Run a Management Strategy Evaluation

Description

Run a Management Strategy Evaluation and save out the results to a Rdata file. To increase speed and efficiency, particulary for runs with a large number simulations (nsim), the simulations are split into a number of packets. The functions loops over the packets and combines the output into a single MSE object. If the MSE model crashes during a run, the MSE is run again until it is successfully completed. The MSE is stopped if the number of consecutive crashes exceeds maxCrash. There is an ption to save the packets as Rdata files to the current working directory (default is FALSE). By default, the functions saves the completed MSE object as a Rdata file (to the current working directory).

Usage

runMSErobust(OM = "1", MPs = NA, nsim = 200, proyears = 28, interval = 4, pstar = 0.5, maxF = 0.8, timelimit = 1, reps = 1, custompars = 0, CheckMPs = TRUE, maxsims = 64, name = NULL, maxCrash = 10, saveMSE = TRUE, savePack = FALSE)

Arguments

OM
An operating model object (class OM)
MPs
A vector of methods (character string) of class DLM_output or DLM_input. If NA all available MPs are run.
nsim
Number of simulations
proyears
Number of projected years
interval
The assessment interval - how often would you like to update the management system?
pstar
The percentile of the sample of the management recommendation for each method
maxF
Maximum instantaneous fishing mortality rate that may be simulated for any given age class
timelimit
Maximum time taken for a method to carry out 10 reps (methods are ignored that take longer)
reps
Number of samples of the management recommendation for each method. Note that when this is set to 1, the mean value of the data inputs is used.
custompars
A data.table with nsim rows and nparameter columns. The column names must respond to variables of the operating model or observation model see the OM and Obs slots of the MSE class for correct names and interpretation. This allows users to prescribe correlated parameters or estimates from stock assessments.
CheckMPs
Logical to indicate if Can function should be used to check if MPs can be run
maxsims
Maximum number of simulations per packet
name
Character string for name of saved MSE packets (if savePack=TRUE) and final MSE object. If none provided, it uses the first four letters from the OM name
maxCrash
Maximum number of consecutive crashes before the MSE stops
saveMSE
Logical to indiciate if final MSEobject should be saved to current working directory (this is probably a good idea)
savePack
Logical to indicate if packets should be save to current working directory

Value

An object of class MSE