make_parameters: Calculate parameter inputs for TMB

View source: R/make_parameters.R

make_parametersR Documentation

Calculate parameter inputs for TMB

Description

make_parameters generates the parameters input for TMB::MakeADFun

Usage

make_parameters(
  Version,
  DataList,
  RhoConfig = c(Beta1 = 0, Beta2 = 0, Epsilon1 = 0, Epsilon2 = 0)
)

Arguments

Version

Which CPP version to use. If missing, defaults to latest version using get_latest_version. Can be used to specify using an older CPP, to maintain backwards compatibility.

DataList

list outputted from make_data

RhoConfig

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, e.g. for component Epsilon2 indicated in the 4rd slot:

RhoConfig[4]=0

Each year as fixed effect

RhoConfig[4]=1

Each year as an independent and identically distributed random effect, thus estimating the variance as fixed effect

RhoConfig[4]=2

Each year as a random effect following a random walk, thus estimating the variance as fixed effect

RhoConfig[4]=3

Constant among years as fixed effect

RhoConfig[4]=4

Each year as a random effect following a first-order autoregressive process, thus estimating the variance as fixed effects and a single first-order autoregression parameter

RhoConfig[4]=5

Each year as a random effect following a first-order autoregressive process, estimating the variance as fixed effects and a separate first-order autoregression parameter for each category

RhoConfig[4]=6

Only possible for Epsilon2 or Beta2, and specifying that that associated hyperparameters parameters have identical values to the first component Epsilon1 or Beta1

If missing, the default is to assume a value of zero for each element (i.e., RhoConfig[1:4]=0)

Value

Tagged list containing starting values for all fixed effects (parameters) and random effects (coefficients)

ln_H_input

two parameters governing geometric anisotropy (rotation matrix H)

beta1_ct

intercepts for encounter probability

gamma1_cp

effect of density covariates on encounter prob

lambda1_k

effect of catchability covariates on encounter prob

L1_z

trimmed Cholesky (i.e., parameters for square-root of covariance) for overdispersion in encounter prob

L_omega1_z

trimmed Cholesky pointwise variance in spatial variation in encounter prob

L_epsilon1_z

trimmed Cholesky pointwise variance in spatio-temporal variation in encounter prob

logkappa1

governs decorrelation distance in encounter prob

Beta_mean1

average intercept of encounter prob (used with RhoConfig options)

logsigmaB1

SD for intercept of encounter prob (used with RhoConfig options)

Beta_rho1

first-order autoregressive coefficient for intercept of encounter prob (used with RhoConfig options)

Epsilon_rho1

first-order autoregressive coefficient for spatio-temporal variation of encounter prob (used with RhoConfig options)

eta1_vf

overdispersion parameters (i.e., vessel or tow-level effects) on encounter prob

Omegainput1_sf

Spatial variation in encounter prob

Epsiloninput1_sft

Spatio-temporal variation in encounter prob

beta2_ct

intercepts for positive catch rates

gamma2_cp

effect of density covariates on positive catch rates

lambda2_k

effect of catchability covariates on positive catch rates

L2_z

trimmed Cholesky (i.e., parameters for square-root of covariance) for overdispersion in positive catch rates

L_omega2_z

trimmed Cholesky pointwise variance in spatial variation in positive catch rates

L_epsilon2_z

trimmed Cholesk pointwise variance in spatio-temporal variation in positive catch rates

logkappa2

governs decorrelation distance in positive catch rates

Beta_mean2

average intercept of positive catch rates (used with RhoConfig options)

logsigmaB2

SD for intercept of positive catch rates (used with RhoConfig options)

Beta_rho2

first-order autoregressive coefficient for intercept of positive catch rates (used with RhoConfig options)

Epsilon_rho2

first-order autoregressive coefficient for spatio-temporal variation of positive catch rates (used with RhoConfig options)

eta2_vf

overdispersion parameters (i.e., vessel or tow-level effects) on positive catch rates

Omegainput2_sf

Spatial variation in positive catch rates

Epsiloninput2_sft

Spatio-temporal variation in positive catch rates

logSigmaM

variance parameters for positive catch rates


James-Thorson/VAST documentation built on July 18, 2024, 4:27 a.m.