Calculates spatial covariance matrix of the observed responses, and
possibly, the responses to be predicted.
If pcoords
is not provided, then only V
,
the covariance matrix of the observed responses will be returned.
If pcoords
is provided, then Vp
and Vop
(the covariance matrix for predicted responses and between observed and
predicted responses, respectively) will also be returned.
cov.sp(coords, sp.type = "exponential",
sp.par = stop("specify sp.par argument"),
error.var = 0, smoothness = 0.5, finescale.var = 0,
pcoords = NULL, D = NULL, Dp = NULL, Dop = NULL)
Returns a list with the following elements:
The covariance matrix for the observed responses. Will be of size \(n \times n\).
The covariance matrix for the predicted responses. Only returned if pcoords
is supplied. Will be of size \(np \times np\).
The covariance matrix between the observed responses and the predicted responses. Only returned if pcoords
is supplied. Will be of size \(n \times np\).
A numeric matrix of size \(n \times d\) containing the observed data locations.
A character vector specifying the spatial covariance type. Valid types are currently exponential, gaussian, matern, matern2, and spherical.
A vector of length 2 specifying the scale and strength of dependence of the covariance function. The first element is the variance of the underlying spatial process (also known as the hidden or latent spatial process). This value is also called the partial sill. The second element is the strength of dependence between responses.
A non-negative number indicating the variance of the error term.
A positive number indicating the variance of the error term.
A non-negative positive number indicating the finescale variability. The is also called the microscale variance
A numeric matrix of size \(np \times d\) containing the locations of the responses to be predicted.
The Euclidean distance matrix for the coords
matrix. Must be of size \(n \times n\).
The Eucliean distance matrix for the pcoords
matrix. Must be of size \(np \times np\).
The Euclidean intersite distance matrix between the locations in coords
and the locations in pcoords
. Must be of size \(n \times np\).
Joshua French
The spatial covariance functions are parameterized in a manner
consistent with the cov.spatial
function in the
geoR
package. The matern2
covariance function is an alternative covariance function suggested by Handcock and Wallis (1994).
The benefit of this parameterization is that the range parameter is that it allows the effective range to be less dependent on the smoothness parameter.
The D
, Dp
, and Dop
arguments are supplied to decrease the number of necessary computations needed when performing repetitive analysis or simulations. It is probably in the user's interest to not supply these arguments unless the duration of analysis is an important consideration. Note that these arguments override the information given in coords
and pcoords
, i.e., if dist1(coords) != D, then D is used in subsequent calculations, etc. This could create problems.
M.S. Handcock, J.R. Wallis. An approach to statistical spatial-temporal modeling of meteorological fields (with discussion). Journal of the American Statistical Association, 89 (1994), pp. 368--390.
simple.cov.sp
coords <- matrix(rnorm(30), ncol = 3)
cov.sp(coords = coords, sp.type = "exponential", sp.par = c(2, 1),
error.var = 1)
Run the code above in your browser using DataLab