6 Spatial Interpolation

Conventional geostatistical spatial interpolation (kriging) can be performed with options for:

  1. Simple kriging
  2. Ordinary kriging
  3. Trend (universal) kriging
  4. External trend kriging

There are additional options for Box-Cox transformation (and back transformation of the results) and anisotropic models. Simulations can be drawn from the resulting predictive distributions if requested.

As a first example consider the prediction at four locations labeled 1, 2, 3, 4 and indicated in the figure below.



  > plot(s100$coords, xlim = c(0, 1.2), ylim = c(0,
  +     1.2), xlab = "Coord X", ylab = "Coord Y")
  > loci <- matrix(c(0.2, 0.6, 0.2, 1.1, 0.2, 0.3,
  +     1, 1.1), ncol = 2)
  > text(loci, as.character(1:4), col = "red")
  > polygon(x = c(0, 1, 1, 0), y = c(0, 0, 1, 1),
  +     lty = 2)

pict

Figure 11: Data locations and points to be predicted

The command to perform ordinary kriging using the parameters estimated by weighted least squares with nugget fixed to zero would be:


  > kc4 <- krige.conv(s100, locations = loci, krige = krige.control(obj.m = wls))

The output is a list including the predicted values (kc4$predict) and the kriging variances (kc4$krige.var).

Consider now a second example. The goal is to perform prediction on a grid covering the area and to display the results. Again, we use ordinary kriging. The commands commands below defines a grid of locations and performs the prediction at those locations.


  > pred.grid <- expand.grid(seq(0, 1, l = 51), seq(0,
  +     1, l = 51))
  > kc <- krige.conv(s100, loc = pred.grid, krige = krige.control(obj.m = ml))

A method for the function image can be used for displaying predicted values as shown in the next Figure, as well as other prediction results returned by krige.conv.



  > image(kc, loc = pred.grid, col = gray(seq(1, 0.1,
  +     l = 30)), xlab = "Coord X", ylab = "Coord Y")

pict

Figure 12: Map of the kriging estimates