BETA VERSION Sample mean length (size-)-at-age data and write to file for use by the EM

sample_mlacomp(
  dat_list,
  outfile,
  ctl_file_in,
  fleets = 1,
  Nsamp,
  years,
  mean_outfile = NULL,
  verbose = TRUE
)

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.

ctl_file_in

A path to the control file, output from an OM, containing the OM parameters for growth. These values are used to determine the uncertainty about size for fish sampled in each age bin.

fleets

*A vector of integers specifying which fleets to include. The order of the fleets pertains to the input order of other arguments. An entry of fleets=NULL leads to zero samples for any fleet.

Nsamp

*A numeric list of the same length as fleets. Either single values or vectors of the same length as the number of years can be passed through. Single values are repeated for all years. If no fleet collected samples, keep the value to Nsamp=NULL.

years

*A list the same length as fleets giving the years as numeric vectors. If no fleet collected samples, keep the value to years=NULL.

mean_outfile

A path to write length and age data for external estimation of parametric growth. If NULL no file will be written. Also, if "remove" is included in the filename, the mean length at age data will be removed from the .dat file and not be available to the EM.

verbose

Logical value whether or not diagnostic information from r4ss functions should be printed to the screen. Default is FALSE.

Value

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

Details

This function is in beta and untested. Use with caution. Take a data_expval.ss file, read in by r4ss function r4ss::SS_readdat() containing observed values, and sample from the observed ages to get realistic proportions for the number of fish in each age bin, then use the mean size-at-age and CV for growth to generate random samples of size, which are then averaged to get mean length-at-age values. These values are then written to file for the EM.

Author

Cole Monnahan, Kelli F. Johnson