run_sdmtmb(
  dir_main = getwd(),
  data,
  family,
  formula,
  n_knots = 500,
  share_range = FALSE,
  sdmtmb_control = sdmTMB::sdmTMBcontrol(newton_loops = 3),
  ...
)

Arguments

dir_main

A string specifying a path where results will be saved. The default is your current working directory.

data

A data frame containing tow-level information on catch weight and effort. Additional columns can be present such as depth.

family

The family and link. Supports gaussian(), Gamma(), binomial(), poisson(), Beta(), nbinom2(), truncated_nbinom2(), nbinom1(), truncated_nbinom1(), censored_poisson(), gamma_mix(), lognormal_mix(), student(), tweedie(), and gengamma(). Supports the delta/hurdle models: delta_beta(), delta_gamma(), delta_gamma_mix(), delta_lognormal_mix(), delta_lognormal(), and delta_truncated_nbinom2(), For binomial family options, see 'Binomial families' in the Details section below.

formula

Model formula. IID random intercepts are possible using lme4 syntax, e.g., + (1 | g) where g is a column of class character or factor representing groups. Penalized splines are possible via mgcv with s(). Optionally a list for delta (hurdle) models. See examples and details below.

n_knots

An integer specifying the number of knots you want in your mesh that is created by fmesher. More knots is not always better. The default is to use 500 knots. Future work will look at specifying a threshold distance between points rather than number of knots.

share_range

Logical, whether or not to share the range between the spatial and spatiotemporal fields. This defaults to FALSE, but adds extra parameters. The default in sdmTMB is TRUE, and sharing the range may improve estimation for data limited applications

sdmtmb_control

Optional list, in the format of sdmTMB::sdmTMBcontrol(). By default, this is includes 3 newton loops

...

Optional arguments passed to sdmTMB::sdmTMB(). Note that users cannot pass anisotropy because this are set internal to this function, where anisotropy = TRUE because the coastline of the western coastline of the U.S.A. is not perpendicular to the country and three newton loops are specified in the control parameters.

Value

An list object of class sdmTMB. This object is returned by sdmTMB::sdmTMB() when fitting data to the model.

Author

Chantel R. Wetzel