Learn R Programming

SpatialTools (version 0.4.1)

krige.sk: 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, return.w = FALSE, nsim = 0, 
	Ve.diag = NULL, method = "eigen")

Arguments

y
The vector of observed responses. Should be a matrix of size $n \times 1$ or a vector of length $n$.
V
The covariance matrix of the observed responses. The size is $n \times n$.
Vp
The covariance matrix of the responses to be predicted. The size is $np \times np$
Vop
The cross-covariance between the observed responses and the responses to be predicted. The size is $n \times np$.
m
A numeric vector of length 1 giving the mean of each response.
return.w
A boolean value (TRUE or FALSE) indicating whether the matrix of prediction weights should be returned. By default, this is FALSE (and results in faster computation since there is less to return).
nsim
A non-negative value indicating the number of conditional simulations that should be returned. If this is less than 1, then no conditional simulation is done.
Ve.diag
A vector of length n specifying the measurement error variances of the observed data.
method
A character vector specifying the method used to decompose V. Options are "eigen", "chol", or "svd" (Eigen decomposition, Cholesky decomposition, or Singular value decomposition, respectively).

Value

  • The function a list containing the following objects:
  • predA vector of length $np$ containing the predicted responses.
  • mspeA vector of length $np$ containing the mean-square prediction error of the predicted responses.
  • wA $np \times n$ matrix containing the kriging weights used to calculate red.
  • simulationsAn $n \times nsim$ matrix containing the nsim realizations of the conditional realizations. Each column of the matrix represents a realization of the conditional normal distribution.
  • meanThe mean value (m) originally provided to the function
  • .

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.

References

Statistical Methods for Spatial Data Analysis, Schabenberger and Gotway (2003). See p. 226-228.

Examples

Run this code
data(toydata)
	y <- as.vector(toydata$y)
	V <- toydata$V
	Vp <- toydata$Vp
	Vop <- toydata$Vop
	krige.sk(y, V, Vp, Vop, m = 2)

Run the code above in your browser using DataLab