tinyVAST model description
James T. Thorson
Source:vignettes/model-description.Rmd
model-description.Rmd
Bivariate generalized linear mixed model structure
tinyVAST is a bivariate extension of a generalized linear mixed model (see Tables 1 and 2 for notation), which includes two linear predictors that each include four additive components:
Spatial interactions among variables: The user can specify interactions among variables at a given site (or for spatially correlated latent variables) using arrow notation derived from path analysis, based on the interface from R package sem;
Temporal interaction among variables: The user can specify simultaneous and lagged interactions among variables over time using an expanded arrow-and-lag notation that is derived from R package dsem, where these interactions the annual intercept for a given variable therefore apply uniformly for all locations.
Spatio-temporal interactions among variables: The user can specify simultaneous and lagged interactions among variables over time, where these interactions occur on a site-by-site basis.
Generalized additive model: The user specifies a formula for a generalized additive model (GAM) that is interpreted by R package mgcv. If other model components are missing, tinyVAST estimates parameters that are similar to mgcv, with small differences resulting from different methods for parameter estimation;
These four components are assembled into two linear predictors:
where
- is the first linear predictor;
- is the GAM component
- is the GAM fixed effects with associated design matrix , where is the row of the design matrix for sample ;
- is the GAM random effects with associated design matrix , where is the row of the design matrix;
- is the projection of the space-veriable interaction to sample ;
- is the time-variable interaction for sample ;
- is the projection of the space-variable-time interaction to sample ;
- is the second linear predictor, and terms are defined similarly but using subscript-2;
The linear predictors are then passed through a bivariate inverse-link function to specify the distribution for errors:
where
- probability density or mass function for sample ;
- is the bivariate inverse-link function that transforms linear predictors to the central tendancy parameters of the distribution;
- is the dispersion parameters for distribution ;
In the simple case, the distribution only requires a single linear predictor such that by construction and drops out of the model. In this case, the model collapses to a generalized linear mixed model. For example we might have a log-link and Poisson distribution, such that it collapses to a log-linked Poisson GLMM, .
However, tinyVAST can also handle a delta-model using either logit-log or Poisson-linked link functions:
where and are the two linear predictors, such that ;
For the conventional logit-log bivariate link function we obtain:
while for the Poisson-linked link function we obtain:
In either case, is the (and is fitted with a Bernoulli distribution), while is the central tendancy for positive values, i.e., .
Spatial domains
Linear predictors include spatially autocorrelated latent variables. These variables are treated as Gaussian Markov random fields (GMRFs), and evaluating the probability density of GMRFs involves calculating the precision matrix as the inverse of the spatial covariance matrix. tinyVAST involves three options for specifying this spatial precision:
- Stochastic partial differentiaul equation (SPDE): The analyst can approximate spatial variation over a continuous two-dimensional surface by constructing finite element mesh (FEM), treating the value at vertices as a GMRF, and then using bilinear interpolation (i.e., a piecewise linear approximation) to interpolate from vertices to the spatial domain. In this case, the precision is constructred as:
where every row of the interpolation matrix is nonzero for only the three vertices of the triangle that contains sample
- Simultaneous autoregressive (SAR): Alternatively, the analyst can specify an areal model representing the value within spatial strata:
where is the adjacency matrix of the graph specified by the analyst, and each row of interpolation matrix is nonzero only for the single spatial stratum containing sample (and noting that adjacency matrix is different from interpolation matrix , but we use the same term for both due to a collision in standard notation).
- Stream networks: Finally, the analyst can specify that sites are
partially correlated if they are adjacent along a stream network (while
ignoring flow direction). This results in an Onstein-Uhlenbeck process
along the stream network, or an exponential
tail-down
model.
Structural equation models
tinyVAST also involves specifying a structural equation model (SEM). This SEM be viewed either:
- Weak interpretation: as a flexible way to parameterize the correlation among variables; or
- Strong interpretation: as a structural causal model, allowing inference about counterfactual changes to the system.
To specify a SEM, the user uses arrow notation. For example, to specify a linear model this involves:
This then estimates a single slope parameter (represented with a one-headed arrow), as well as the variance of and (specified with two-headed arrows). In a more complicated case, might cause , which in turn causes . This is then represented as:
Path coefficients for one-headed arrows then define path matrix :
and coefficents for two-headed arrows define the Cholesky of the exnogenous covariance matrix :
These matrices are define a simultaneous equation model:
$$ \mathbf{ w = P w + \epsilon} \\ \mathbf\epsilon \sim \mathrm{MVN}( \mathbf 0, \mathbf G^T \mathbf G ) $$ where the variance . This then results in a sparse precision matrix:
Dynamic structural equation models
Similarly, tinyVAST involves specifying dynamic structural equation models (DSEM). To specify a DSEM, the user uses arrow-and-lag notation. For example, to specify a univariate first-order autoregressive process:
If there were four time-intervals () this would then result in the path matrix:
and when the DSEM involves multiple times and variables, the sparse precision is formed by summing across the Kronecker product of time-lag and interaction matrices. This DSEM defines a GMRF over a nonseparable interaction of time and variables, represented by a matrix with dimension . The user can specify a separate arrow-and-lag notation to define the precision matrix for the time-variable interaction and for the space-time-variable interaction . The time term is used to define the time-varying intercept for each variable:
Meanwhile, the space-time term is combined with the spatial precision as we explain next.
Spatial interactions for SEM and DSEM
tinyVAST uses the SEM and DSEM notation to construct the joint precision for the space-variable interaction with dimension , and the space-time-variable interaction with dimension . To do so, it constructs the separable precision for each process:
where the precision matrix has dimension to match the length of , and
where the precision matrix has dimension , to match the length of .
Generalized additive model
Finally, the analyst can specify a generalized additive model using syntax from package mgcv. For example this might involve:
If year
and species
are factors and
depth
and log_area
are continuous, then this
would specify a fixed effect for each level year
, a spline
smoother for depth
, using log_area
as an
offset, and estimating a random intercept for each level of
species
. This formula is parsed internally to assemble
fixed effects in design matrix
and the basis functions for spline smoothers and random effects in
design matrix
.
The coefficients
associated with smoothers and random effects are then specified to
follow a GMRF:
where is a blockwise diagonal matrix, assembled from estimated variance parameters and matrices constructed by mgcv.
Symbol | Description |
---|---|
Index for each sample, in | |
spatial coordinate for sample , in | |
time-interval for sample , in | |
category for sample , in | |
error distribution and link function for sample |
Symbol | Code | Description |
---|---|---|
y_i |
Observed response data | |
p_i |
first linear predictor | |
p2_i |
second linear predictor |