make_data | R Documentation |
make_data
builds a tagged list of data inputs used by TMB for running the model
make_data(
b_i,
a_i,
t_i,
c_iz = rep(0, length(b_i)),
e_i = c_iz[, 1],
v_i = rep(0, length(b_i)),
FieldConfig = c(Omega1 = "IID", Epsilon1 = "IID", Omega2 = "IID", Epsilon2 = "IID"),
ObsModel_ez = c(PosDist = 1, Link = 0),
OverdispersionConfig = c(eta1 = 0, eta2 = 0),
RhoConfig = c(Beta1 = 0, Beta2 = 0, Epsilon1 = 0, Epsilon2 = 0),
VamConfig = c(Method = 0, Rank = 0, Timing = 0),
Aniso = TRUE,
PredTF_i = rep(0, length(b_i)),
covariate_data = NULL,
X1_formula = ~0,
X2_formula = ~0,
X1config_cp = NULL,
X2config_cp = NULL,
X_contrasts = NULL,
catchability_data = NULL,
Q1_formula = ~0,
Q2_formula = ~0,
Q1config_k = NULL,
Q2config_k = NULL,
spatial_list,
Network_sz = NULL,
F_ct = NULL,
F_init = 1,
CheckForErrors = TRUE,
yearbounds_zz = NULL,
Options = c(),
Expansion_cz = NULL,
Z_gm = NULL,
Version = FishStatsUtils::get_latest_version(package = "VAST"),
overlap_zz = matrix(ncol = 7, nrow = 0),
...
)
b_i |
Vector, providing sampled value (biomass, counts, etc.) for each observation i.
Users should provide values as class |
a_i |
Vector containing values greater than zero, providing sampled area for each
observation i, e.g., |
t_i |
Vector of integers, providing the time (e.g., calendar year) for each observation i.
The first modeled interval will be |
c_iz |
Vector of integers ranging from 0 to the number of variables minus 1, providing the category (e.g., species, length-bin) for each observation i. This can be specified as a matrix, such that each observation is associated with multiple categories. Such specification treats samples as arising from the sum across multiple categories, e.g., to account for unlabeled multispecies data. |
e_i |
Optional vector of integers ranging from 0 to the number of different error distributions,
providing the error distribution to use for each observation i;
by default |
v_i |
Vector of integers ranging from 0 to the number of vessels minus 1,
providing sampling category (e.g., vessel or tow) associated with overdispersed variation for each observation i
(by default |
FieldConfig |
See Details section of |
ObsModel_ez |
an optional matrix with two columns where the first column specifies the distribution for positive catch rates, and the second column specifies the functional form for encounter probabilities
|
OverdispersionConfig |
a vector of format |
RhoConfig |
vector of form
If missing, the default is to assume a value of zero for each element (i.e., |
VamConfig |
Options to estimate interactions, containing three slots:
|
Aniso |
whether to assume isotropy, |
PredTF_i |
OPTIONAL, whether each observation i is included in the likelihood, |
covariate_data |
data-frame of covariates that is used when constructing density covariates.
any variable referenced in |
X1_formula |
right-sided formula affecting the 1st linear predictor
which is then estimated independently for each model category |
X2_formula |
same as |
X1config_cp |
matrix of settings for each density covariate for the 1st lienar predictor, where the row corresponds to model category, and column corresponds to each density covariate
|
X2config_cp |
Same as argument |
X_contrasts |
list defining the contrasts for each density-covariate factor
specified in |
catchability_data |
data-frame of covariates for use when specifying |
Q1_formula |
Similar to |
Q2_formula |
same as |
Q1config_k |
Same as argument |
Q2config_k |
Same as argument |
spatial_list |
tagged list of locational information from , i.e., from |
Network_sz |
An interface to specify a directed acyclic graphic representing a stream network, used only when |
F_ct |
matrix of instantanous fishing mortality for each category c and year t. Only feasible when using a Poisson-link delta model and specifying temporal structure on intercepts, when the temporal autocorrelation is equivalent to a Spawning Potential Ratio (SPR) proxy for fishing mortality targets given the implied Gompertz density dependence. |
F_init |
In a vector-autoregressive model specifying fishing mortality rates via |
CheckForErrors |
whether to check for errors in input (NOTE: when |
yearbounds_zz |
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 |
Expansion_cz |
matrix specifying how densities are expanded when calculating annual indices, with a row for each category
The 2nd column is used when |
Z_gm |
matrix specifying coordinates to use when calculating center-of-gravity and range-edge statistics. Defaults to eastings and northings for each knots or extrapolation-grid cell. |
Version |
Which CPP version to use. If missing, defaults to latest version
using |
overlap_zz |
A matrix with seven columns (and zero rows by default), indicating whether overlap metrics should be calculated as a derived quantity.
Each row of |
... |
interface to pass deprecated inputs, included for backwards compatibility with previous versions which, e.g., specified elements of |
Specification of FieldConfig
can be seen by calling make_settings
,
which is the recommended way of generating this input for beginning users.
Argument FieldConfig
is a matrix of form
FieldConfig = matrix( c(0,10,"IID","Identity", "AR1",10,"IID","Identity"), ncol=2, nrow=4, dimnames=list(c("Omega","Epsilon","Beta","Epsilon_year"),c("Component_1","Component_2"))
.
However, for backwards compatibility, FieldConfig
can instead be specified as
a vector of format FieldConfig = c("Omega1"=0, "Epsilon1"=10, "Omega2"="AR1", "Epsilon2"=10)
,
which generates the same settings as the matrix specification, given the values of each shown in this example.
Both vector (simplified) and matrix (full) specification of FieldConfig
involve named elements
using the following naming conventions:
Omega
specifies whether spatial variation is present and/or correlated among variables
Epsilon
specifies whether spatio-temporal variation is present and/or correlated among variables
Beta
specifies whether temporal variation (a.k.a. "intercepts") is present and/or correlated among variables
Epsilon_year
specifies whether spatio-temporal variation is correlated among years
Meanwhile, Component_1
(or the numeral "1" after a component name) refers to the 1st lienar predictor (e.g., of a delta-model),
while Component_2
(or the numeral "2" after a component name) refers to the 2nd linear predictor.
The simplified vector-specification does not include slots for Beta
or Epsilon_year
and therefore
is not as general.
In each slot of FieldConfig
, the user can specify various options:
0
turns off a given model component
integer greater than zero
specifies the rank (number of factors) in a factor-analysis covariance matrix
"AR1"
specifies that a model component is correlated following an first-order autoregressive process
"IID"
specifies that a given model component is a random effect that is independent for every level
"Identity"
specifies that a given model component has covariance of an identity-matrix;
this is only useful for Epsilon_year
to "turn off" covariance among years while still including spatio-temporal variation
make_data
generates arrays of covariates X_gtp
and X_ip
using make_covariates
;
see that function for more details.
Object of class make_data
, containing inputs to function make_model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.