SS2MOM: Import Stock Synthesis to MOM (2-sex multi-fleet) or OM...

View source: R/SS2MOM.R

SS2MOMR Documentation

Import Stock Synthesis to MOM (2-sex multi-fleet) or OM (single-sex, single-fleet)

Description

Functions that uses the file location or the r4ss output list of a fitted SS3 model including input files to populate the various slots of an MOM or OM object. SS2MOM and SS2OM mainly populates the Stock and Fleet components components of the operating model. SS2MOM creates a 2-sex model and multiple fleets with discarding behavior. SS2OM returns a single sex (either male, female, or averaged biological parameters) and single fleet (aggregate selectivity and mortality, no explicit discarding modeled). For either, the user still needs to parameterize most of the observation and implementation portions. SSMOM2OM is the internal function that simplifies the MOM object to an OM object. plot_SS2OM generates a markdown report to compare the OM and SS output.

Usage

SS2MOM(
  SSdir,
  nsim = 48,
  proyears = 50,
  reps = 1,
  maxF = 3,
  seed = 1,
  interval = 1,
  pstar = 0.5,
  Obs = MSEtool::Generic_Obs,
  Imp = MSEtool::Perfect_Imp,
  silent = FALSE,
  Name = "MOM generated by SS2MOM",
  Source = "No Source provided",
  ...
)

plot_SS2MOM(
  x,
  SSdir,
  gender = 1:2,
  filename = "SS2MOM",
  dir = tempdir(),
  open_file = TRUE,
  silent = FALSE,
  ...
)

SS2OM(
  SSdir,
  nsim = 48,
  proyears = 50,
  reps = 1,
  maxF = 3,
  seed = 1,
  interval = 1,
  pstar = 0.5,
  Obs = MSEtool::Generic_Obs,
  Imp = MSEtool::Perfect_Imp,
  import_mov = TRUE,
  gender = 1:2,
  seasons_to_years = TRUE,
  model_discards = TRUE,
  silent = FALSE,
  Name = "OM generated by SS2OM function",
  Source = "No source provided",
  Author = "No author provided",
  report = FALSE,
  filename = "SS2OM",
  dir = tempdir(),
  open_file = TRUE,
  ...
)

SSMOM2OM(
  MOM,
  SSdir,
  gender = 1:2,
  import_mov = TRUE,
  seed = 1,
  silent = FALSE,
  model_discards = TRUE
)

plot_SS2OM(
  x,
  SSdir,
  gender = 1:2,
  filename = "SS2OM",
  dir = tempdir(),
  open_file = TRUE,
  silent = FALSE,
  ...
)

MOM_agg_fleets(MOM)

Arguments

SSdir

A folder with Stock Synthesis input and output files in it.

nsim

The number of simulations to take for parameters with uncertainty (for OM@cpars custom parameters).

proyears

The number of projection years for MSE

reps

The number of stochastic replicates within each simulation in the operating model.

maxF

The maximum allowable F in the operating model.

seed

The random seed for the operating model.

interval

The interval at which management procedures will update the management advice in multiMSE, e.g., 1 = annual updates.

pstar

The percentile of the sample of the management recommendation for the MP/MMP.

Obs

The observation model (class Obs). These functions do not update implementation parameters.

Imp

The implementation model (class Imp). These functions do not update implementation parameters.

silent

Whether to silence messages to the console.

Name

The name of the operating model

Source

Reference to assessment documentation e.g. a url

...

Arguments to pass to SS_output.

x

For plot_SS2OM, an object of either class OM or Hist. For plot_SS2MOM, an object of either class MOM or multiHist.

gender

An integer that indexes the sex for importing life history parameters (1 = usually female, 2 = usually male, 1:2 = mean across both sexes). Only used for SS2OM only in a 2-sex model.

filename

If report = TRUE, character string for the name of the markdown and HTML files.

dir

If report = TRUE, the directory in which the markdown and HTML files will be saved.

open_file

If report = TRUE, whether the HTML document is opened after it is rendered.

import_mov

Logical. Import movement matrix?

seasons_to_years

Logical, when season is the time step, whether to convert OM from a seasonal model to annual model.

model_discards

Logical, how to simplify a multi-fleet SS model to an OM object. If TRUE, OM will still model discards using the mean retention across fleets (weighted by fleet F). Otherwise, no discards are modeled and all fishing removals are calculated in the OM from the SS F-at-age matrix.

Author

Who did the assessment

report

Logical, if TRUE, the function will run runMSE to generate the Hist object from the operating model to compare against SS output. A markdown report will be generated.

MOM

MOM object

Value

SS2MOM returns an object of class MOM. SS2OM returns an object of class OM.

Functions

  • MOM_agg_fleets(): Aggregate all fleets in an MOM object.

Note

Currently tested on r4ss version 1.38.1-40.0 and SS 3.30.14.

Author(s)

Q. Huynh

See Also

SS2Data SS2DataMOM


Blue-Matter/MSEtool documentation built on Nov. 22, 2024, 8:23 p.m.