krige.sk {SpatialTools} | R Documentation |
Performs simple kriging
Description
Performs simple kriging using y
, a vector of length n
,
V
, the (positive definite) covariance matrix of the
observed responses, Vp
, the
np \times np
covariance matrix of the responses to be predicted, Vop
,
the n \times np
matrix of covariances between the observed
responses and the responses to be predicted, and m
, a numeric vector
of length 1 identifying the value of the mean
for each response.
Usage
krige.sk(y, V, Vp, Vop, m = 0, nsim = 0, Ve.diag = NULL, method = "eigen")
Arguments
y |
The vector of observed responses.
Should be a matrix of size |
V |
The covariance matrix of the observed responses.
The size is |
Vp |
The covariance matrix of the responses to be predicted.
The size is |
Vop |
The cross-covariance between the observed responses
and the responses to be predicted. The size is
|
m |
A numeric vector of length 1 giving the mean of each response. |
nsim |
The number of simulated data sets to sample from the conditional predictive distribution. |
Ve.diag |
A vector of length |
method |
The method for decomposing |
Details
It is assumed that there are n
observed data values
and that we wish to make predictions at np
locations.
The mean is subtracted from each value of y
before determining the kriging weights,
and then the mean is added onto the predicted response.
If doing conditional simulation, the Cholesky decomposition should not work when there are coincident locations between the observed data locations and the predicted data locations. Both the Eigen and Singular Value Decompositions should work.
If user specifies nsim
to be a positive integer, then nsim
conditional realizations of the predictive distribution will be generated. If this is less than 1, then no conditional simulation is done. If nsim
is a positive integer, then Ve.diag
must also be supplied. Ve.diag
is should be a vector of length n
specifying the measurement error variances of the observed data. This information is only used for conditional simulation, so this argument is only needed when nsim
> 0. When conditional simulation is desired, then the argument method
can be to specify the method used to decompose V
. Options are "eigen", "chol", or "svd" (Eigen decomposition, Cholesky decomposition, or Singular value decomposition, respectively). This information is only used for conditional simulation, so this argument is only applicable when nsim
> 0.
Value
The function returns a list containing the following objects:
pred |
A vector of length |
mspe |
A vector of length |
simulations |
An |
mean |
The mean value (m) originally provided to the function |
.
If nsim
> 0, this list has class "krigeConditionalSample".
Author(s)
Joshua French
References
Statistical Methods for Spatial Data Analysis, Schabenberger and Gotway (2003). See p. 226-228.
Examples
data(toydata)
y <- as.vector(toydata$y)
V <- toydata$V
Vp <- toydata$Vp
Vop <- toydata$Vop
krige.sk(y, V, Vp, Vop, m = 2)