fit_sraplus: Run sraplus

View source: R/fit-sraplus.R

fit_sraplusR Documentation

Run sraplus

Description

The main function for taking an object created by format_driors and fitting a surplus production model using sraplus

Usage

fit_sraplus(
  driors,
  include_fit = TRUE,
  seed = 42,
  plim = 0.05,
  model_name = "sraplus_tmb",
  randos = "log_proc_errors",
  draws = 1e+05,
  n_keep = 2000,
  engine = "sir",
  cores = 4,
  chains = 1,
  cleanup = FALSE,
  max_treedepth = 10,
  adapt_delta = 0.8,
  estimate_shape = FALSE,
  estimate_qslope = FALSE,
  estimate_q = TRUE,
  estimate_proc_error = TRUE,
  estimate_initial_state = TRUE,
  estimate_k = TRUE,
  estimate_f = FALSE,
  learn_rate = 0.001,
  analytical_q = FALSE,
  use_baranov = TRUE,
  include_m = FALSE,
  ci = 0.89,
  try_again = FALSE,
  eps = 1e-06,
  max_time = Inf,
  eval.max = 200,
  iter.max = 150,
  rel.tol = 1e-10,
  loopnum = 2,
  newtonsteps = 0,
  tune_prior_predictive = TRUE,
  index_fit_tuner = "sir",
  refresh = 250,
  log_bias_correct = TRUE,
  workers = 1,
  thin_draws = FALSE,
  thin_rate = 0.5,
  catch_cv = 0.01,
  non_centered = FALSE,
  ...
)

Arguments

driors

a list of driors passed from sraplus::format_driors

include_fit

logical indicating whether to return the fitted object

seed

seed for model runs

plim

cutoff (in units of B/K) for hockey stick PT function

model_name

the name of the sraplus TMB version to be run, defaults to "sraplus_tmb"

randos

random effects when passing to TMB

draws

the number of SIR samples to run

n_keep

the number of SIR samples to keep

engine

one of 'sir','stan', or 'tmb'

cores

number of cores for stan fits

chains

number of chains for stan fits

cleanup

logical indicating whether to remove the compiled TMB model after running

max_treedepth

max_treedepth for models fit using stan

adapt_delta

adap_delta for models fit using stan

estimate_shape

logical indicating whether to estimate the shape parameter of the Pella-Tomlinson model. If FALSE shape parameter is held at the initial value, either default or supplied

estimate_qslope

logical indicating whether to estimate a slope parameter for q in CPUE fitting. If FALSE q_slope is held at the initial value, either default or supplied. if TRUE, estimate_proc_error should be set to FALSE

estimate_q

estimate catchability coefficient or leave fixed

estimate_proc_error

logical indicating whether to estimate process errors. If FALSE process errors are not included in the model

estimate_initial_state
estimate_k

estimate carrying capacity

estimate_f

estimate fishing mortality

learn_rate

learn_rate for HMC

analytical_q

use analytical q instead of empirical

use_baranov

use baranov catch equation

include_m

include natural mortality (deprecated)

ci

confidence/credible interval range for summaries

try_again

try fit again with adjusted starting guess

eps

eps for nlminb

max_time

max_time for nlminb

eval.max

eval.max for nlminb

iter.max

iter.max for nlminb

rel.tol

for nlminb

loopnum

for nlminb

newtonsteps

for TMBhelper

tune_prior_predictive

tune prior predictive to resolve borel's paradox

index_fit_tuner

"sir" tunes priors for index fit

refresh

refresh rate for Stan

log_bias_correct

correct for log-transformation bias

workers

number of workers for parallel processing of stan outputs

thin_draws

true or false thing draws

thin_rate

thinning rate

catch_cv

assumed CV for catch data when estimating catches rather than treating as data

non_centered

use centered or non-centered form for process errors

...

additional parameters

Value

a fitted sraplus object


DanOvando/sraplus documentation built on July 22, 2023, 12:03 p.m.