In Stock Synthesis, empirical weight-at-age data can be used to read empirical body weight for the population from each fleet. This data removes the use of growth parameters from the EM because weights are assigned to each age internally rather than from the growth parameters, from which spawning biomass/fecundity can be determined. These values are not data in the sense they have a likelihood but are generated from samples. Sampling empirical weight-at-age data from the expected values takes many steps.

sample_wtatage(
  wta_file_in,
  outfile,
  dat_list,
  ctl_file_in,
  years,
  fill_fnc = fill_across,
  fleets,
  cv_wtatage = NULL
)

Arguments

wta_file_in

The file to read weight-at-age from. Specifically to get the age-0 weight-at-age. This is typically wtatage.ss_new.

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.

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.

ctl_file_in

A path to the control file, output from an OM, containing the OM parameters for growth and weight/length relationship. These values are used to determine the uncertainty about weight for fish sampled in each age bin. Commonly control.ss_new

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.

fill_fnc

A function to fill in missing values (ages and years). The resulting weight-at-age file will have values for all years and ages.One function is fill_across().

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.

cv_wtatage

A user specified coefficient of variation (CV) for growth. Default is NULL.

Value

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

Details

The steps for sampling empirical weight-at-age are as follows:

  • Sample from the expected ages to get realistic proportions for the number of fish in each age bin.

  • Use the mean size-at-age and coefficient of variation for growth to generate random samples of size, which are then converted to weight and averaged to get mean weight-at-age values.

  • Fill in missing ages and years.

  • Write the information to the appropriate files.

  • Turn on weight-at-age data in Stock Synthesis by setting the maturity option to 5.

Author

Cole Monnahan, Allan Hicks, Peter Kuriyama