VAST_condition: Estimate parameters by fitting VAST to empirical data

View source: R/VAST_condition.R

VAST_conditionR Documentation

Estimate parameters by fitting VAST to empirical data

Description

Fits data loaded in your R session or data that is downloaded from the Northwest Fisheries Science Center data warehouse to a VAST::make_model using TMBhelper::fit_tmb. See the sections below for more details on how the model is configured.

Usage

VAST_condition(
  conditiondir,
  settings,
  spp,
  overdispersion,
  data = NULL,
  sensitivity = TRUE,
  compiledir = conditiondir
)

Arguments

conditiondir

A directory, either a full or relative path, that will be used to save the results. The directory will be created recursively if it does not already exist.

settings

A list of settings used to run the spatiotemporal model. The full list of necessary settings can be seen by running get_settings(), and any settings that are not included in the list supplied to this argument will be added at their default values.

spp

A character value that includes the survey acronym and the species name in latin with all words separated by an underscore. For example, "WCGBTS_Sebastes_crameri".

overdispersion

A vector of two integer values named "eta1" and "eta2" that specify how overdispersion is modeled. "eta1" is for the encounter model and "eta2" is for the positive catch-rate model. Typical options include c("eta1"=0, "eta2"=0), which is used for the Alaska Fisheries Science Center Slope Survey, and c("eta1"=1, "eta2"=1), which is used for the Northwest Fisheries Science Center West Coast Groundfish Bottom Trawl Survey. This vector is passed to "OverdispersionConfig" within the make_data() function. The former configuration of zero turns off this feature in VAST. The latter configuration allows for random covariation in catchability (e.g., a vessel effect if v_i is assigned to vessel or a vessel-year effect if v_i is assigned to a vector that combines vessel and year into a factor). Specifically, one random effect will be estimated for each unique value in v_i if this feature is set to one. The eta values can also be set to "AR1" if you want correlated overdispersion in the available categories. The autoregressive process might be appropriate if you believe there is overdispersion at the tow level and tows closer in time provide more information about other tows than tows that are further apart in time. L_1 and L_2 are the estimated parameters representing the variance of these random effects for each model. The configuration for the overdispersion parameters is automatically set in VAST_condition based on the input argument spp, which includes a short-hand version of the survey name. Leaving the input value to the default of NULL allows the overdispersion parameter to be set behind the scenes. This can be overridden by providing a vector. If there is no default value for overdispersion, then a named vector must be supplied where the first value is for the encounter model and the second value is for the positive catch-rate model as given in the examples above for the different surveys.

data

A data frame that can be passed to the conditioning function such that no data will be downloaded. todo: document the columns that are needed.

sensitivity

logical; run sensitivity analyses specific to a given survey. For example, the Triennial survey can be split into two separate surveys and limited to 366 m depth.

compiledir

A file path, either relative or full, to a directory where the VAST cpp file will be compiled leading to three files saved to the disk. Thus, users should have both read and write capabilities within this directory. A single file path can be used for multiple models allowing for the model to be only compiled once rather than multiple times. This file path is tranfered to the CompileDir within make_model().

Value

Nothing is returned by the function, but the function saves .RData files to the disk in conditiondir.

Pass

The US West Coast has operated using two passes of the survey area, where each pass is done during a different time of year. If you think that migration happens temporally and this migration will affect spatial density, then you should include pass as a covariate. The default is to ignore pass, but I presume that many US West Coast users will want to change this using the settings argument.

Author(s)

Kelli F. Johnson

See Also

See get_settings() for a list of default settings. Anything not included in your own list supplied to the settings argument will be taken from this default list.

Examples

## Not run: 
# Use the default settings to run the model for WCGBTS - sablefish
VAST_condition(conditiondir = getwd(), settings = get_settings(),
  spp = settings$Species, sensitivity = FALSE)

## End(Not run)


nwfsc-assess/VAST_WestCoast documentation built on July 4, 2023, 5:45 p.m.