fit_sraplus: Run sraplus

Description Usage Arguments Value Examples

View source: R/fit-sraplus.R

Description

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

Usage

1
2
3
4
5
6
7
8
9
fit_sraplus(driors, include_fit = TRUE, seed = 42, plim = 0.2,
  model_name = "sraplus_tmb", randos = "log_proc_errors",
  draws = 1e+06, 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_proc_error = TRUE, marginalize_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 = 1, newtonsteps = 1)

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_proc_error

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

ci

confidence/credible interval range for summaries

Value

a fitted sraplus object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

catch_only_driors <- sraplus::format_driors(
taxa = example_taxa,
catch = cod$catch,
years = cod$year,
use_heuristics = TRUE
)

 catch_only_fit <- sraplus::fit_sraplus(driors = catch_only_driors,
engine = "sir",
draws = 1e6,
n_keep = 2000)


## End(Not run)

DanOvando/sraplus documentation built on Dec. 1, 2019, 5:15 a.m.