run_proj | R Documentation |
Project BAM forward in time to conduct deterministic or stochastic projections.
run_proj(
rdat = NULL,
run_bam_args = NULL,
bam2r_args = NULL,
stochastic = FALSE,
pstar = NULL,
styr_proj = NULL,
nyb_rcn = list(L = 3, U = 3, R = 5, comp = 3),
nyp_cur = 3,
nyp = 5,
nm_yr_p = c("endyr", "endyr_rec_dev", "endyr_rec_phase2", "endyr_rec_spr", "styr_regs",
"endyr_proj"),
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,
nm_comp_sfx = c(""),
t_series_na_vals = c(-9999, -99999, -999999),
key_lenprob = c(all = "^len.cv")
)
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 |
stochastic |
logical. Is this a stochastic projection? Mostly runs the same code either way, but stochastic projections add normal errors to recruitment. Stochastic setting is intended to be run with rdat input from MCBE. |
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 |
nm_yr_p |
names of |
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, R0 = model estimated mean recruitment (R0), GM = constant geometric mean of nyb_rcn$R recent years of t.series$recruits. By default, run_proj will try to use BH, or R0, but if it can't find all the parameters, it will resort to GM. Note GM method has not been reviewed and should be used with caution. |
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 |
nm_comp_sfx |
Character vector. Possible suffix added to fleet abbreviation in comps
(e.g. c("a","b") in SEDAR 82 gray triggerfish). Used to match comps with catch when projecting
comp data when |
t_series_na_vals |
Numeric vector of values to consider as NA in t.series object. |
key_lenprob |
Optional list for specifying cv values for length-at-age, for each set of length compositions. (e.g. key_lenprob = c("D.rHD"="len.cv.L", "L.rGN"="len.cv.L")). Use keyword 'all', as in default to set all values to a particular value in parm.cons. |
ia_args
:
U_nmThe fleet abbreviation for an index of abundance that you want to use to adjust F (e.g. sTV, sCT). If set to NULL
, no interim adjustment will be used.
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.
Kyle Shertzer, Erik Williams, and Nikolai Klibansky
## Not run:
# Run deterministic projection with defaults
proj_VeSn <- run_proj(rdat_VermilionSnapper,plot=TRUE)
# Run deterministic projection with defaults
# and project bam inputs, by adding the bam files with bam2r_args
proj_VeSn <- run_proj(rdat_VermilionSnapper,
project_bam=TRUE,
bam2r_args = list(
dat_obj=dat_VermilionSnapper,
tpl_obj=tpl_VermilionSnapper,
cxx_obj=cxx_VermilionSnapper
))
# The projections work for most of the assessments
proj_BlSb <- run_proj(rdat_BlackSeaBass,plot=TRUE)
proj_GaGr <- run_proj(rdat_GagGrouper,plot=TRUE)
proj_RdGr <- run_proj(rdat_RedGrouper,plot=TRUE)
proj_RdSn <- run_proj(rdat_RedSnapper,plot=TRUE)
proj_VeSn <- run_proj(rdat_VermilionSnapper,plot=TRUE)
# Some need additional arguments to run correctly
proj_GrTr <- run_proj(rdat_GrayTriggerfish,
nm_comp_sfx = c("a","b"),
plot=TRUE,
key_lenprob = c("D.rHDs"="len.cv.L", "L.rGNs"="len.cv.L")
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.