| GeoModels-spacetime-ordering | R Documentation |
Defines the ordering used by GeoModels for fixed-location and dynamic-location spatio-temporal data, observation-level means and covariates, and kriging prediction tasks.
The conventions below apply consistently to data, coordinates, design matrices, known mean vectors, and prediction outputs.
For the explicit-coordinate space-time interfaces, coordt is a numeric
coordinate vector and does not need to be equally spaced. Covariance,
likelihood, pair-selection, variogram, neighborhood and kriging calculations
use temporal lags derived from the supplied values, typically
|t_i-t_j|. Consequently, maxtime is a temporal-distance threshold
expressed in the same units as coordt, not an index lag or an order of
neighboring time points.
Important exceptions are explicit. Space-time
GeoSimapprox(..., method = "CE") requires finite, strictly increasing,
equally spaced temporal coordinates, and space-time turning-bands simulation
is not implemented. GeoSimcond and GeoOutlier currently reject
space-time input.
The spobj route has a separate legacy limitation: the current
sp2Geo() conversion of STFDF/STIDF objects replaces their
time positions by sequential indices 1, 2, ..., T. Therefore an
irregular original time spacing is not preserved through spobj. When
irregular temporal distances matter, pass the data and coordinates through the
explicit interface and supply the numeric coordt values directly.
Let T be length(coordt) and let N be the number of rows of
coordx. The data must be a T \times N matrix. Row
t corresponds to coordt[t], and column i corresponds to
row i of coordx.
The internal observation order is time-major and is equivalent to
c(t(data)):
time 1: site 1, site 2, ..., site N time 2: site 1, site 2, ..., site N ... time T: site 1, site 2, ..., site N
Any observation-level vector, including a known mean vector, must use this
order. A design matrix X must have NT rows in the same order.
For example, if X_time has one row per time,
X_time[rep(seq_len(T), each = N), , drop = FALSE] creates the
corresponding observation-level design.
For dynamic locations, coordx_dyn must be a list of length T.
The element coordx_dyn[[t]] is an N_t \times 2 or
N_t \times 3 matrix containing the locations observed at
coordt[t].
The data must be a list of length T; data[[t]] must contain
N_t values, and its i-th value corresponds to row i of
coordx_dyn[[t]]. The internal order is the time-wise concatenation
unlist(data, use.names = FALSE), matched by
do.call(rbind, coordx_dyn):
all observations at time 1, then all observations at time 2, ..., then all observations at time T.
A design matrix X can be supplied either as a
(\sum_t N_t) \times p matrix in this concatenated order,
or as a list of length T with X[[t]] having N_t rows and
the same row order as coordx_dyn[[t]]. A known observation-level mean
uses the same time-wise concatenation.
For a univariate linear mean,
\mu = X\beta.
The regression vector \beta is represented by the parameters
mean, mean1, mean2, and so on. The columns of X
correspond to these coefficients in exactly this order. An intercept-only
model is equivalent to a one-column matrix of ones and the single coefficient
mean. A supplied observation-level mean vector is a known mean and is
not interpreted as regression coefficients.
Let N_{loc} be the number of rows of loc and let
T_{loc} be length(time). Kriging prediction tasks are ordered
location-major:
location 1: time 1, time 2, ..., time Tloc location 2: time 1, time 2, ..., time Tloc ... location Nloc: time 1, time 2, ..., time Tloc
Therefore the rows of Xloc and the elements of Mloc must follow
this order. If X_time_pred has one row per prediction time, use
X_time_pred[rep(seq_len(Tloc), times = Nloc), , drop = FALSE].
Equivalently, if mu_time contains one prediction mean per time, use
rep(mu_time, times = Nloc) for Mloc.
Dynamic coordinates describe the observed sites only and do not change the
prediction-task order. Spatio-temporal kriging output is a
T_{loc} \times N_{loc} matrix: rows correspond to
time and columns correspond to rows of loc.
GeoFit, GeoSim, GeoVariogram,
GeoKrig, and GeoKrigloc.
T <- 3
N <- 2
data <- matrix(seq_len(T * N), nrow = T, ncol = N)
c(t(data))
X_time <- cbind(1, seq_len(T))
X <- X_time[rep(seq_len(T), each = N), , drop = FALSE]
Nloc <- 2
Xloc <- X_time[rep(seq_len(T), times = Nloc), , drop = FALSE]
Mloc <- rep(seq_len(T), times = Nloc)
## Irregular observation times are allowed in the explicit interface.
coordt_irregular <- c(0, 0.25, 1.1, 2.8)
## Temporal lags are based on differences between these values; for example,
abs(outer(coordt_irregular, coordt_irregular, "-"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.