[an error occurred while processing this directive]
Fields: Web Manual
Table of Contents
1. Introduction

2. Thin Plate Splines: Tps 3. Spatial Process Models: Krig 4. Simulating Random Fields (sim.rf)

5. Spatial Predictions for Large Data Sets
6. Other Fields Functions References

Printable version of Fields Manual

Back to Fields Home Page
3. Spatial Process Models: Krig


Spatial Statistics refers to the class of models and methods for data collected over a region, and informally we will refer to spatial estimates based on a covariance model as "Kriging". Examples of such regions might be a mineral field, a quadrant in a forest, or a geographic region. A typical problem is to predict values of a measurement at places where it is not observed, or, if the measurements are observed with error, to estimate a smooth spatial process, or surface, from the data. The Kriging function in Fields has the advantage that it can use arbitrary covariance functions. In doing so it is not limited to two dimensional problems or standard models.
Fields assumes a spatial model of the form

Y_i = P(x_i) + Z(X_i) + e_i,     1 <= i <= n


where P is a low order polynomial (default polynomial used by Krig is a linear function (m=2)). Z is a mean zero, Gaussian stochastic process with a covariance that is known up to a scale constant, k(x, x') and denote the variance of e_i by /W_i. Consistent with the spline estimate, we take = / . The covariance function, k, may also depend on other parameters that we explain how to specify below but these are not estimated directly by the Krig function.

3.1 Using Krig

The S function, Krig, takes data and a covariance function and returns a Krig object that has information about the estimate of P and Z. The simplest call making use of all the default choices is to specify the locations, x , and the independent variable, Y and the range for the exponential covariance function theta . Here, x is an n x d matrix where each row has the coordinates of the location. Although many examples of spatial data are two-dimensional, the general structure is not limited to the 2-d case.
The returned Krig object is the standard best linear unbiased estimate (BLUE) of f(x) and by default the nugget variance, , is found by GCV. If one assumes a Gaussian process and Gaussian errors, then this estimate is also related to the conditional expectation of f(x) given the observed data. Of equal value are estimates of the standard errors of prediction and more will be said about these below.
The primary flexibility of the Krig function is in specifying the covariance function and parameters associated with it. The default covariance is the exponential function

k(x, x') = exp( -rdist(x, x')/theta)


where rdist( x, x') is the Euclidean distance function and the default for theta is 1. To set parameters of the covariance function to values other than their defaults, simply include them in the calling list to Krig. The example below indicates how this is done.

fit <- Krig( ozone$x, ozone$y, theta=100)

View the help file for Krig to find more information on all of the optional arguments that can be passed into Krig. In the ozone example below, Krig could have been called without specifying exp.cov (since this is the default).

3.2 Examples

The following examples illustrate the use of Krig and supporting functions.


This is software for statistical research and not for commercial uses. The authors do not guarantee the correctness of any function or program in this package. Any changes to the software should not be made without the authors permission.

Last modified: Dec 21 2005   by thoar@ucar.edu