run_proj: run_proj

View source: R/run_proj.r

run_projR Documentation

run_proj

Description

Deterministic projections

Usage

run_proj(
  rdat = NULL,
  run_bam_args = NULL,
  bam2r_args = NULL,
  pstar = NULL,
  styr_proj = NULL,
  nyb_rcn = list(L = 3, U = 3, R = 5, comp = 3),
  nyp_cur = 3,
  nyp = 5,
  F_cur = NULL,
  F_proj = NULL,
  L_cur = NULL,
  ages = NULL,
  N_styr_proj = NULL,
  S_styr_proj = NULL,
  sel_L = NULL,
  sel_D = NULL,
  sel_tot = NULL,
  sel_F_flt = NULL,
  wgt_mt = NULL,
  wgt_L_klb = NULL,
  wgt_D_klb = NULL,
  wgt_F_flt_klb = NULL,
  len_F_flt_mm = NULL,
  reprod = NULL,
  M = NULL,
  spawn_time = NULL,
  SR_par = NULL,
  SR_method = "BH",
  age_error = NULL,
  project_bam = FALSE,
  ia_args = list(U_nm = NULL),
  obs_error = list(cv_U_sc = 0),
  plot = FALSE
)

Arguments

rdat

BAM output rdat (list) object read in with dget().

run_bam_args

list of arguments passed internally to run_bam if any are provided

bam2r_args

list of arguments passed internally to bam2r if any are provided

pstar

Value to use for applying pstar scaling of Fmsy. If set to NULL, it is not used and pstar code will not be run.

styr_proj

start year (i.e. first calendar year) of projection

nyb_rcn

number of years in calculations that include recent landings (L) or discards and their cvs, index cvs (U), recruitment (R), or numbers of samples in age or length compositions (comp). Fleets without L or D within the last nyb_rcn years of the base model will not be projected forward. named list

nyp_cur

number of years to maintain current conditions before implementing management

nyp

number of years of projection. Must be >nyp_cur

F_cur

current fully selected fishing mortality rate

F_proj

fully selected fishing mortality rate

L_cur

current level of landings

ages

ages. numeric vector

N_styr_proj

abundance at age in styr_proj. numeric vector

S_styr_proj

spawning stock size at age in styr_proj. Often biomass in mt, sometimes eggs in n. numeric vector

sel_L

selectivity at age to compute landings. numeric vector

sel_D

selectivity at age to compute dead discards. numeric vector

sel_tot

selectivity at age to compute Z (includes landings and discards). numeric vector

sel_F_flt

list of selectivity vectors (by age) or matrices (by year,age) for each fleet associated with landings or discards. numeric vector or matrix

wgt_mt

weight at age of population in metric tons (mt). numeric vector

wgt_L_klb

weight at age of landings in thousand pounds (klb). numeric vector

wgt_D_klb

weight at age of discards in thousand pounds (klb). numeric vector

wgt_F_flt_klb

list of weight vectors (klb by age) or matrices (by year,age) for each fleet associated with landings or discards. numeric vector or matrix

len_F_flt_mm

list of length vectors (mm by age) or matrices (by year,age) for each fleet associated with landings or discards. numeric vector or matrix

reprod

reproductive contribution at age to SSB. numeric vector

M

natural mortality rate, at age

spawn_time

time of year for peak spawning

SR_par

list of parameters associated with the stock-recruit (SR) relationship. Currently only works with a Beverton-Holt SR relationship for which the parameters are: h = steepness of spawner-recruit function, R0 = virgin recruitment of spawner-recruit function, Phi0 = virgin spawners per recruit, biascorr = bias correction

SR_method

Spawner-recruit function BH = Beverton-Holt, GM = constant geometric mean of nyb_rcn$R recent years of t.series$recruits. By default, run_proj will try to use BH, but if it can't find all the parameters, it will resort to GM (and will return a message letting you know that)

age_error

age error matrix to use for the projection years. By default, the function uses the same age_error matrix from the base model

project_bam

logical. After the projection is run, should the function build a new set of projected bam files?

ia_args

list of arguments to pass to interim adjustment function. See Details section below.

obs_error

list of optional arguments for incorporating observation error into projections. See Details section below.

plot

logical. Produce plots of extended base model including projected data

Details

ia_args:

  • U_nmThe fleet abbreviation for an index of abundance that you want to use to adjust F (e.g. sTV, sCT).

  • typeMethod used for computing F adjustment. "Uprop" computes the mean U from recent years, divided by U from reference year. The reference year is the terminal year of the last full stock assessment. The set of recent years is computed as the current projection year plus yr_U_lag. By default, type = "Uprop"

  • yr_U_lagA vector of negative integers used to compute the set of years used for computing an interim adjustment from the reference index (comma separated example values: -1, -1:-3, -2:4). By default, yr_U_lag = -(2:4).

  • yr_ia_byFrequency of interim adjustments, in year units. Used to determine the years between stock assessments when interim adjustments will be computed and applied to F. The interim adjustment years are computed as yrlim_p <- endyr + c(1,nyp); yr_ia <- seq(yrlim_p[1], yrlim_p[2], by = yr_ia_by). By default, yr_ia_by = 5

  • include_yrlimLogical. Should interim analysis be conducted in the first and last years of the projection period? By default, include_yrlim_p = FALSE

obs_error:

  • cv_U_scNumber to multiply by cv values of abundance indices in the projection period.

Author(s)

Kyle Shertzer, Erik Williams, and Nikolai Klibansky

Examples

## Not run: 
proj_VeSn <- run_proj(rdat_VermilionSnapper)
proj_VeSn <- run_proj(rdat_VermilionSnapper, project_bam=TRUE,
run_bam_args = list(
dat_obj=dat_VermilionSnapper,
tpl_obj=tpl_VermilionSnapper,
cxx_obj=cxx_VermilionSnapper
))

## End(Not run)

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