In the subsequent sections we are going to predict values of a spatially distributed variable at locations where it was not observed based on a set of observations. In the first example we make inferences on the mean annual rainfall in Germany based on a set of observations at 586 DWD weather stations. In the second example we predict the spatial distribution of Zinc in Lake Rangsdorf based on 32 sediment samples taken during a field survey in 2017.

The general procedure is outlined below. First, if necessary, we prepare the data for subsequent analysis. Then we investigate the sample variogram and propose a variogram model that fits the observational data. Then we evaluate the different models using the root mean squared error (RMSE) as model assessment metric. Finally we use the gstat package for spatial prediction.

1. Data preparation
2. Sample variogram
3. Variogram modelling
4. Model evaluation
5. Spatial prediction

Before we continue recall Tobler’s first law of geography:

“everything is related to everything else, but near things are more related than distant things.”