Alter the structure of data that is available from a Stock Synthesis operating model (OM), which in turn leads to changes in the output and ability to sample data after running the model.

change_data(
  dat_list,
  outfile = NULL,
  fleets,
  years,
  types = c("len", "age", "cal", "mla", "mwa"),
  age_bins = NULL,
  len_bins = NULL,
  pop_binwidth = NULL,
  pop_minimum_size = NULL,
  pop_maximum_size = NULL,
  lcomp_constant = NULL,
  tail_compression = NULL,
  nsex = 1
)

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.

fleets

A numeric vector of fleets.

years

A numeric vector of years.

types

A vector that can take combinations of the following entries: "len", "age", "cal", "mla". types controls what data structures the function acts on, with "len" augmenting the length-composition data, "age" augmenting the age-composition data, "cal" augmenting the conditional age-at-length data, and "mla" augmenting the mean length-at-age data.

age_bins

A numeric vector of age bins to use. If left as NULL, the age bin structure will be taken from the OM.

len_bins

A numeric vector of length bins to use. If left as NULL, the length bin structure will be taken from the OM. For conditional age-at-length data, the last value provided to len_bins will be used for Lbin_lo and -1 will be used for Lbin_hi for the largest length bin category, i.e., row of conditional age-at-length data.

pop_binwidth

Population length bin width. Note that this value must be smaller than the bin width specified in length-composition data len_bins or Stock Synthesis will fail, see notes in the Stock Synthesis manual.

pop_minimum_size

Population minimum length bin value.

pop_maximum_size

Population maximum length bin value.

lcomp_constant

The robustification constant for length-composition data. Must be a numeric value, as a proportion. For example, 0.1 means 10 percent. See the notes in the Stock Synthesis manual. A NULL value indicates no action resulting in using the current value, and a value of 0 will throw an error because zero leads to an error when zeroes exist in the data. Instead use a very small value like 1e-07.

tail_compression

Tail compression value to be used in Stock Synthesis. Must be a numeric value, as a proportion. For example 0.1 means 10 percent. See the notes in the Stock Synthesis manual. A NULL value indicates no action, a negative value turns the feature off in Stock Synthesis.

nsex

An integer value of 1 or 2 specifying the number of sexes in the model. If 1, then females are the only included sex. This information can be found in the data file for a given model and dictates how the composition data are structured.

Value

An invisible data list, and a file is written to the disk if an entry other than the default of NULL is provided for outfile.

Details

change_data() is called internally within ss3sim, but it can be used to manipulate data or to prepare a new OM for use in a simulation. Original data is removed and dummy data is added to the Stock Synthesis .dat object. The dummy data expands the data structure to provide information for all years and fleets, potentially adding many rows of data.

Currently, .dat files with multiple sexes cannot be manipulated with change_data().

The robustification constant is added to both the observed and expected proportions of length composition data, before being normalized internally. It is designed to help stabilize the model, but is unclear how and when to use it for optimal effect. The same value is used for all length data.

See also

See clean_data() for a counter function.

Other change functions: change_e(), change_em_binning(), change_f(), change_o(), change_retro(), change_tv()

Author

Cole Monnahan, Ian G. Taylor, Sean Anderson, Kelli F. Johnson