fit.vast: Fits a VAST model, compatible with VAST v8_3_0 through...

Description Usage Arguments Value

View source: R/fit.vast.r

Description

Fits a VAST model, compatible with VAST v8_3_0 through 16/12/2019 Some of the descriptions come from JT VAST package descriptions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
fit.vast(
  Data_Geostat,
  RunDir,
  SaveDir,
  save.output = FALSE,
  Q_ik = NULL,
  vf.re = FALSE,
  FieldConfig = c(Omega1 = 1, Epsilon1 = 1, Omega2 = 1, Epsilon2 = 1),
  RhoConfig = c(Beta1 = 0, Beta2 = 0, Epsilon1 = 0, Epsilon2 = 0),
  ObsModel_ez = c(1, 3),
  fine_scale = TRUE,
  input.grid.res = 1,
  crop.extrap.by.data = TRUE,
  knot_method = "grid",
  n_x = 100,
  Version = "VAST_v8_3_0",
  Method = "Mesh",
  ADREPORT = TRUE,
  normalize_idx = FALSE,
  Xconfig_zcp = NULL,
  slim.output = FALSE,
  strata.sp,
  enviro
)

Arguments

Data_Geostat

A data-frame of i rows containing the following columns: Response_variable, Year, Lon, Lat, Spp, AreaSwept_km2, Vessel

RunDir

Path to the directory where the .cpp VAST source code is stored or compiled

SaveDir

Path to the directory where the outputs will be saved

save.output

TRUE or FALSE

Q_ik

Matrix or i rows and k covariates impacting catchability. Can be created using stats::model.matrix

vf.re

TRUE or FALSE switch indicating if vessel random effects are to be estimated. If so then the Vessel column in Data_Geostat is used

FieldConfig

Controls the number of factors estimated with the spatial and spatiotemporal random fields. default setting = c(Omega1 = 1, Epsilon1 = 1, Omega2 = 1, Epsilon2 = 1)

RhoConfig

Controls the temporal structure of the annual intercepts and the spatiotemporal random field. default setting = c(Beta1 = 0, Beta2 = 0, Epsilon1 = 0, Epsilon2 = 0)

ObsModel_ez

Controls the error structure. default setting = c(1,3)

ObsModel_ez[e,1]=0

Normal

ObsModel_ez[e,1]=1

Lognormal

ObsModel_ez[e,1]=2

Gamma

ObsModel_ez[e,1]=3

Inverse-Gaussian

ObsModel_ez[e,1]=5

Negative binomial

ObsModel_ez[e,1]=6

Conway-Maxwell-Poisson (likely to be very slow)

ObsModel_ez[e,1]=7

Poisson (more numerically stable than negative-binomial)

ObsModel_ez[e,1]=8

Compound-Poisson-Gamma, where the expected number of individuals is the 1st-component, the expected biomass per individual is the 2nd-component, and SigmaM is the variance in positive catches (likely to be very slow)

ObsModel_ez[e,1]=9

Binned-Poisson (for use with REEF data, where 0=0 individual; 1=1 individual; 2=2:10 individuals; 3=>10 individuals)

ObsModel_ez[e,1]=10

Tweedie distribution, where epected biomass (lambda) is the product of 1st-component and 2nd-component, variance scalar (phi) is the 1st component, and logis-SigmaM is the power

ObsModel_ez[e,1]=11

Zero-inflated Poisson with additional normally-distributed variation overdispersion in the log-intensity of the Poisson distribution

ObsModel_ez[e,1]=12

Poisson distribution (not zero-inflated) with log-intensity from the 1st linear predictor, to be used in combination with the Poisson-link delta model for combining multiple data types

ObsModel_ez[e,1]=13

Bernoilli distribution using complementary log-log (cloglog) link from the 1st linear predictor, to be used in combination with the Poisson-link delta model for combining multiple data types

ObsModel_ez[e,1]=14

Similar to 12, but also including lognormal overdispersion

ObsModel_ez[e,2]=0

Conventional delta-model using logit-link for encounter probability and log-link for positive catch rates

ObsModel_ez[e,2]=1

Alternative "Poisson-link delta-model" using log-link for numbers-density and log-link for biomass per number

ObsModel_ez[e,2]=2

Link function for Tweedie distribution, necessary for ObsModel_ez[e,1]=8 or ObsModel_ez[e,1]=10

ObsModel_ez[e,2]=3

Conventional delta-model, but fixing encounter probability=1 for any year where all samples encounter the species

ObsModel_ez[e,2]=4

Poisson-link delta-model, but fixing encounter probability=1 for any year where all samples encounter the species and encounter probability=0 for any year where no samples encounter the species

fine_scale

TRUE or FALSE. Better maps and slightly better index fit when TRUE but is slower.

input.grid.res

Resolution of extrapolation grid in kilometers.

crop.extrap.by.data

TRUE or FALSE: If TRUE then the extrapolation grid is cropped by the smooth hull surrounding the data

knot_method

knot_method whether to determine location of GMRF vertices based on the location of samples knot_method=`samples` or extrapolation-grid cells within the specified strata knot_method='grid'

n_x

Number of knots

Version

Version of VAST to use. Compatible with version "VAST_v8_3_0"

Method

Method to use for defining spatial field. default setting = "Mesh"

ADREPORT

TRUE or FALSE. Calculate the SD for the params and index?

normalize_idx

TRUE or FALSE. Normalize the index (and the SE) by dividing by the mean of the index

Xconfig_zcp

OPTIONAL, 3D array of settings for each dynamic density covariate, where the first dimension corresponds to 1st or 2nd linear predictors, second dimension corresponds to model category, and third dimension corresponds to each density covariate

Xconfig_zcp[z,c,p]=0

X_itp[,,p] has no effect on linear predictor z for category c

Xconfig_zcp[z,c,p]=1

X_itp[,,p] has a linear effect on linear predictor z for category c

Xconfig_zcp[z,c,p]=2

X_itp[,,p] has a spatially varying, zero-centered linear effect on linear predictor z for category c

Xconfig_zcp[z,c,p]=3

X_itp[,,p] has a spatially varying linear effect on linear predictor z for category c

slim.output

TRUE or FALSE, if true then vast_output only contains idx and/or idx.se, fit.time, mgc

strata.sp

[Optional] If present, a shapefile containing the strata boundaries to calculate the indicies for

enviro

[Optional] If present, a named-list of length two is required: "formula" is a character string that can be coerced to a formula using stats::as.formula, and "covariate_data" is a data frame with the following columns - Year, Lon, Lat, covariates...

Value

Named list "vast_output"

idx

the index within each strata if strata is provided

idx.se

the associated se for the index

Opt

the diagnostics from the model run

Report

the objects estimated and calculated by VAST

Sdreport

the report generated by ADREPORT

TmbData

the data passed to TMB and used to fit the model

Extrapolation_List

the extrapolation list

fit.time

the time to run the function

MapDetails_List

the map details to make additional plots


N-DucharmeBarth/ndd.vast.utils documentation built on April 5, 2020, 9 p.m.