Ordinary and Universal Kriging

DESCRIPTION:

Performs ordinary or universal kriging for two dimensional spatial data. The function predict.krige can then be called to compute interpolation surfaces and prediction errors.

USAGE:

krige(formula, data=sys.parent(), subset, na.action=na.fail, 
      covfun, nc=10000, ...) 

REQUIRED ARGUMENTS:

formula
a formula describing the kriging variable and the spatial location variables and optionally a polynomial trend surface. Its simplest form is:

z ~ loc(x,y)

where z is the kriging variable and x and y are the spatial locations, that is, z[i] is observed at the location ( x[i],y[i]). The right hand side must contain a call to the function loc. A polynomial trend surface is of the form:

z ~ loc(x,y) + x + y + x^2 + y^2

The polynomial must be in the same variables as the first two arguments used in the loc function. A constant term is always fit. All terms on the right hand side must be entered with a + sign. The loc call can include arguments angle and ratio to correct for geometric anisotropy; see the loc help file. Note that an evaluated loc object cannot be used in formula.
covfun
a function that returns the distanced based covariance between two points. The first argument to the function must be the distance. Additional parameters will be passed through the ....

OPTIONAL ARGUMENTS:

data
an optional data frame in which to find the objects mentioned in formula.
subset
expression saying which subset of the rows of the data should be used in the fit. This can be a logical vector (which is replicated to have length equal to the number of observations), or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included.
na.action
a function to filter missing data. This is applied to the data in formula after any subset argument has been used. The default (with na.fail) is to create an error if any missing values are found. A possible alternative is na.omit, which deletes observations that contain one or more missing values.
nc
the number of points to use internally by the algorithm in approximating the distance-based covariance function. Note: this argument has nothing to do with the number of observed points used in computing the kriging. All observed points are used in computing kriging predictions.
...
additional named arguments can be passed to covfun.

VALUE:

an object of class "krige" with components:
x
the first spatial location vector i.e. the first argument in loc function call in formula.
y
the second spatial location vector i.e. the second argument in loc function call in formula.
coefficients
the vector of coefficients for the trend surface. These are for the polynomial based on the scaled spatial location vectors (see the DETAILS section).
residuals
the vector of residuals from the trend surface.
call
an image of the call that produced the object.

Other components are included that are used by predict.krige for computing interpolations.

DETAILS:

The kriging system is solved using generalized least squares (see Ripley, 1981). The polynomial terms are scaled to (-1, 1) internally to avoid numeric problems; the coefficients component returned is for these scaled terms.

This implementation of kriging does not handle multiple observations at a point.

Methods for objects of class "krige" include predict and print.

REFERENCES:

Cressie, Noel A. C. (1993). Statistics for Spatial Data, Revised Edition. Wiley, New York.

Ripley, Brian D. (1981). Spatial Statistics. Wiley, New York

SEE ALSO:

, , .

EXAMPLES:

# krige the Coal Ash data with a quadratic trend in the x direction 
#   using a spherical covariance function: 
kcoal <- krige(coal ~ loc(x, y) + x + x^2, data = coal.ash, 
        covfun = spher.cov, range = 4.31, sill = 0.14, nugget = 0.89) 
# predictions over default 30 x 30 grid  
pcoal <- predict(kcoal) 
# plot prediction surface 
wireframe(fit ~ x * y, data = pcoal, 
        screen = list(z = 300, x = -60, y = 0), drape = T)