Data_Fn: Build data input for VAST model

Description Usage Arguments Value

View source: R/Data_Fn.R

Description

Data_Fn builds a tagged list of data inputs used by TMB for running the model

Usage

1
2
3
4
5
6
7
8
9
Data_Fn(Version, FieldConfig, OverdispersionConfig = c(eta1 = 0, eta2 = 0),
  ObsModel = c(PosDist = 1, Link = 0), b_i, a_i, c_i, s_i, t_iz, a_xl,
  MeshList, GridList, Method, v_i = rep(0, length(b_i)), PredTF_i = rep(0,
  length(b_i)), X_xj = NULL, X_xtp = NULL, Q_ik = NULL, Aniso = 1,
  RhoConfig = c(Beta1 = 0, Beta2 = 0, Epsilon1 = 0, Epsilon2 = 0),
  t_yz = NULL, CheckForErrors = TRUE, yearbounds_zz = NULL,
  Options = c(SD_site_logdensity = 0, Calculate_Range = 0,
  Calculate_effective_area = 0, Calculate_Cov_SE = 0, Calculate_Synchrony = 0,
  Calculate_proportion = 0))

Arguments

Version

a version number (see example for current default).

FieldConfig

a vector of format c("Omega1"=0, "Epsilon1"=10, "Omega2"="AR1", "Epsilon2"=10), where Omega refers to spatial variation, Epsilon refers to spatio-temporal variation, Omega1 refers to variation in encounter probability, and Omega2 refers to variation in positive catch rates, where 0 is off, "AR1" is an AR1 process, and >0 is the number of elements in a factor-analysis covariance

OverdispersionConfig

OPTIONAL, a vector of format c("eta1"=0, "eta2"="AR1") governing any correlated overdispersion among categories for each level of v_i, where eta1 is for encounter probability, and eta2 is for positive catch rates, where 0 is off, "AR1" is an AR1 process, and >0 is the number of elements in a factor-analysis covariance

ObsModel

an optional vector of format c(1,0), where first element specifies the distribution for positive catch rates, and second element specifies the functional form for encounter probabilities

ObsModel[1]=0

Normal

ObsModel[1]=1

Lognormal

ObsModel[1]=2

Gamma

ObsModel[1]=5

Negative binomial

ObsModel[1]=6

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

ObsModel[1]=7

Poisson (more numerically stable than negative-binomial)

ObsModel[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[1]=9

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

ObsModel[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[2]=0

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

ObsModel[2]=1

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

ObsModel[2]=2

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

ObsModel[2]=3

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

b_i

Sampled biomass for each observation i

a_i

Sampled area for each observation i

c_i

Category (e.g., species, length-bin) for each observation i

s_i

Spatial knot (e.g., grid cell) for each observation i

t_iz

Matrix where each row species the time for each observation i (if t_iz is a vector, it is coerced to a matrix with one column; if it is a matrix with two or more columns, it specifies multiple times for each observation, e.g., both year and season)

a_xl

Area associated with each knot

MeshList,

tagged list representing location information for the SPDE mesh hyperdistribution, i.e., from SpatialDeltaGLMM::Spatial_Information_Fn

GridList,

tagged list representing location information for the 2D AR1 grid hyperdistribution, i.e., from SpatialDeltaGLMM::Spatial_Information_Fn

Method,

character (either "Mesh" or "Grid") specifying hyperdistribution (Default="Mesh")

v_i

OPTIONAL, sampling category (e.g., vessel or tow) associated with overdispersed variation for each observation i

PredTF_i

OPTIONAL, whether each observation i is included in the likelihood (PredTF_i[i]=0) or in the predictive probability (PredTF_i[i]=1)

X_xj

OPTIONAL, matrix of static density covariates (e.g., measured variables affecting density, as used when interpolating density for calculating an index of abundance)

X_xtp

OPTIONAL, array of dynamic (varying among time intervals) density covariates

Q_ik

OPTIONAL, matrix of catchability covariates (e.g., measured variables affecting catch rates but not caused by variation in species density) for each observation i

Aniso

OPTIONAL, whether to assume isotropy (Aniso=0) or geometric anisotropy (Aniso=1)

RhoConfig

OPTIONAL, vector of form c("Beta1"=0,"Beta2"=0,"Epsilon1"=0,"Epsilon2"=0) specifying whether either intercepts (Beta1 and Beta2) or spatio-temporal variation (Epsilon1 and Epsilon2) is structured among time intervals (0: each year as fixed effect; 1: each year as random following IID distribution; 2: each year as random following a random walk; 3: constant among years as fixed effect; 4: each year as random following AR1 process)

t_yz

OPTIONAL, matrix specifying combination of levels of t_iz to use when calculating different indices of abundance or range shifts

CheckForErrors

OPTIONAL, whether to check for errors in input (NOTE: when CheckForErrors=TRUE, the function will throw an error if it detects a problem with inputs. However, failing to throw an error is no guaruntee that the inputs are all correct)

yearbounds_zz

OPTIONAL, matrix with two columns, giving first and last years for defining one or more periods (rows) used to calculate changes in synchrony over time (only used if Options['Calculate_Synchrony']=1)

Options

OPTIONAL, a vector of form c('SD_site_logdensity'=0,'Calculate_Range'=0,'Calculate_effective_area'=0,'Calculate_Cov_SE'=0,'Calculate_Synchrony'=0,'Calculate_proportion'=0), where Calculate_Range=1 turns on calculation of center of gravity, and Calculate_effective_area=1 turns on calculation of effective area occupied

Value

Tagged list containing inputs to function VAST::Build_TMB_Fn()


James-Thorson/VAST documentation built on Oct. 8, 2017, 1:15 a.m.