Build_TMB_Fn: Build TMB object for VAST model

Description Usage Arguments Value

View source: R/Build_TMB_Fn.R

Description

Build_TMB_Fn builds a tagged list with everything necessary to run or interpret inputs to a VAST model

Usage

1
2
3
4
5
6
Build_TMB_Fn(TmbData, Version, Q_Config = TRUE, CovConfig = TRUE,
  RhoConfig = c(Beta1 = 0, Beta2 = 0, Epsilon1 = 0, Epsilon2 = 0),
  Method = "Mesh", ConvergeTol = 1, Use_REML = FALSE, loc_x = NULL,
  Parameters = "generate", Random = "generate", Map = "generate",
  DiagnosticDir = NULL, TmbDir = system.file("executables", package =
  "VAST"), RunDir = getwd())

Arguments

TmbData,

a tagged list of data inputs generated by Data_Fn

Version

a version number (see example for current default).

Q_Config,

a boolean whether to estimate catchability covariates (Q_ik in the TmbData input) or not

CovConfig,

a boolean whether to estimate density covariates (X_xj and X_xtp in the TmbData input) or not

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)

Method

Spatial method used for estimation (determines bounds for logkappa)

ConvergeTol,

OPTIONAL override for TMB convergence criteria

Use_REML,

OPTIONAL boolean whether to use maximum marginal likelihood or restricted maximum likelihood (termed "REML")

loc_x

OPTIONAL, location for each sample used to generate plausible bounds for scale parameter

Parameters

OPTIONAL, a tagged list of starting parameters

Random

OPTIONAL, a character vector of random effects

Map

OPTIONAL, a tagged list of parameters to either mirror or turn off

DiagnosticDir

OPTIONAL, a directory where diagonstic runtime information should be stored

TmbDir

OPTIONAL, a directory where the CPP file for the VAST model can be found locally

RunDir

OPTIONAL, a directory where the CPP file is copied, copiled, and run (must have write privileges or else the function will crash)

Value

Tagged list containing objects for running a VAST model

Obj

The built TMB object

Upper

A vector of upper bounds for parameters, optionally for use during optimization

Lower

A vector of lower bounds for parameters, optionally for use during optimization

Parameters

A tagged list of parameter starting values used when building Obj, which can be extracted, modified, and then put back into Build_TMB_Fn to define different starting values

Map

A taggged list of parameters to be turned off or mirrored, for similar use as Parameters

Random

A character vector of random effects, for similar use as Parameters


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