run_proj_seq: Sequence of projection and estimation

View source: R/run_proj_seq.r

run_proj_seqR Documentation

Sequence of projection and estimation

Description

This function runs a sequence of projections with run_proj, and estimation with run_bam, to build long-term closed-loop simulations. If a single dat object is provided, it will run a single deterministic projection. If a list of dat objects is provided, for example as output from run_MCBE(run_est=FALSE), the function will run multiple projections in parallel.

Usage

run_proj_seq(
  CommonName = NULL,
  fileName = "bam",
  dat_obj = NULL,
  tpl_obj = NULL,
  cxx_obj = NULL,
  rdat_obj = NULL,
  run_proj_args = list(),
  nyps = NULL,
  plot_type = "final",
  write_bam_files = "final",
  parallel = TRUE,
  ncores = NULL
)

Arguments

CommonName

Common name of species associated with dat, tpl, and cxx files

fileName

Name given to BAM files, not including file extensions.

dat_obj

dat file read in as a character vector with readLines(con=dat_file)

tpl_obj

tpl file read in as a character vector with readLines(con=tpl_file)

cxx_obj

cxx file read in as a character vector with readLines(con=cxx_file)

run_proj_args

List of arguments to pass to run_proj

nyps

Total number of years to project which may include multiple assessment cycles. nyps = Number of Years to Project in Sequence

plot_type

Indicate which bam results should be plotted by calling plot_bam. Current options include "all", "final", or "none", to plot results from all stock assessments in the projection sequence, the final assessment, or none of the assessments.

write_bam_files

indicate which bam files should be written. Current options include "all", "final", or "none", to write files from all stock assessments in the projection sequence, the final assessment, or none of the assessments.

parallel

logical. Should parallel processing be used? This setting is only used when dat_obj is a list of multiple dat objects. The function will not use parallel processing for a single dat object (it would actually be somewhat slower).

ncores

number of cores to use for parallel processing

rdat

(list) object read in with dget(). Specifically, the BAM output file produced by the cxx file.

Value

By default, returns the bam model object from the end of the projection sequence.

Author(s)

Nikolai Klibansky


nikolaifish/bamExtras documentation built on July 21, 2023, 8:26 a.m.