Learn R Programming

SpatialTools (version 0.3.2)

krige.uk: Performs universal kriging

Description

Performs Universal Kriging using X, the $n \times k$ design matrix for the regression coefficients of the observed data, y, the $n \times 1$ matrix of observed responses, V, the (positive definite) covariance matrix of the observed responses, Xp, the $np \times k$ design matrix of the responses to be predicted, Vp, the $np \times np$ covariance matrix of the responses to be predicted, and Vop, the $n \times np$ matrix of covariances between the observed responses and the responses to be predicted. Uses Armadillo C++ template via RcppArmadillo to perform most of the operations.

Usage

krige.uk(y, V, Vp, Vop, X, Xp)

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$
X
The design matrix of the observed data. The size is $n \times k$
Xp
The design matrix of the responses to be predicted. The size is $np \times k$

Value

  • The function a list containing the following objects:
  • predA vector of length $np$ containing the predicted responses.
  • mopeA 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.
  • coeffA vector of length $k$ containing the estimated regression coefficients.
  • vcov.coeffA $k \times k$ matrix containing the (estimated) covariance matrix of estimated the regression coefficients.

Details

It is assumed that there are $n$ observed data values and that we wish to make predictions at $np$ locations. We assume that there are $k$ regression coefficients (including the intercept). Both X and Xp should contain a column of 1's if an intercept is desired.

References

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

Examples

Run this code
data(toydata)
	X <- toydata$X
	y <- toydata$y
	V <- toydata$V
	Xp <- toydata$Xp
	Vp <- toydata$Vp
	Vop <- toydata$Vop
	krige.uk(y = y, V = V, Vp = Vp, Vop = Vop, X = X, Xp = Xp)

Run the code above in your browser using DataLab