This function creates a matrix of sampled catches from the expected available catches for all fleets with catches. The input value used for catch_se will be used to resample the catches. There is a bit of a disconnect here because catches are defined by input F values not absolute catches. Let \(D_y\) be the discard from the operating model for year y. Then the sampled value is calculated as: \(D_y*exp(stats::rnorm(1, 0, sds_obs)-sds_obs^2/2)\). The second term adjusts the random samples so that their expected value is \(D_y\), i.e., the log-normal bias correction.

sample_catch(dat_list, outfile = NULL)

Arguments

dat_list

A Stock Synthesis data list object as read in from SS_readdat. Be sure to correctly specify which section of the data file you want to work with when reading it in using the section argument. Where, section = 1 reads in the input values used to run the model and section = 2 reads in the expected values generated given all the input to the OM. section = 3 is not used within ss3sim, but this section provides bootstrapped data sets that have been sampled internally within SS.

outfile

A character string specifying the file name to use when writing the information to the disk. The string must include the proper file extension. No file is written using the default value of NULL, which leads to increased speed because writing the file takes time and computing resources.

Value

A modified .dat file if !is.null(outfile). A list object containing the modified .dat file is returned invisibly.

Author

Kelli F. Johnson