Tutorials

Kootwijkerzand (NL)

Here are the many tutorials I’ve written [1] dealing with various aspects of spatial statistics. Please note the dates of each one, the older ones may be partly obsolete or require some adjustment to new versions of the computer programs.

Geostatistics

Spatial analysis in R is transitioning to the “Simple Features” representation of spatial objects, as implemented in the sf package. Many of the tutorials listed here were developed with the earlier “Spatial Objects in R” representation, as implemented in the sp package. Be alert also to changes in the GDAL and PROJ packages when specifying or transforming coördinate reference systems.

  • An introduction to (geo)statistics with R

    A brief introduction to exploratory and inferential geo- statistical analysis. At the same time, it introduces the R environment for statistical computing and visualisation] and several R packages, notably sp for spatial data structures and gstat for conventional geostatistics. The exercise assumes no prior knowledge of either geostatistics nor the R environment.

    • R code
    • Introduction to Rikken, M. G. J., & Van Rijn, R. P. G. (1993) : Soil pollution with heavy metals—An inquiry into spatial variation, cost of mapping and the risk evaluation of copper, cadmium, lead and zinc in the floodplains of the Meuse west of Stein, the Netherlands. Dept. of Physical Geography, Utrecht University. This is the orignal report from which the “Meuse dataset” was created.
  • Co-kriging with the gstat package of the R environment for statistical computing

    Improving the mapping of an undersampled attribute that is co-regionalized with a more intensively sampled attribute.

  • Distance education course Geostatistics & Open-source statistical computing

    • Supplementary exercises

      • Exercise: Change of support

        All geographical measurements are made on some support, that is, an interval (1-D), area (2-D) or volume (3-D) of some finite size. As long as the measurements, interpretations, and predictions all refer to the same support, techniques that treat the support as a 0-D point are satisfactory. But if measurements and predictions are made on different supports, the relation between them must be determined and used to adjust the geostatistical analysis.

      • Exercise: Compositional variables

        Certain (geo)statistical variables, when considered as a group, are not independent in feature space, because they are constrained to sum to some constant; the set of these is called a composition. They should not be modelled separately, rather, as a group.

      • Exercise: Spatio-temporal Geostatistics

        Spatio-temporal observations are those for which both a spatial location (georeference) and a time of observation are recorded, as well as attributes measured at the specified location and time. This exercise introduces space-time geostatistics to analyze attributes in space and time, separately and simultaneously.

  • Interactive Excel worksheets explaining spatial autocorrelation, variograms and kriging (XLS, compressed)

    Written by prof.dr.ir. Alfred Stein (University of Twente), formatted and with some more explanation by me. (1) Simulation of spatial correlation in one dimension, (2) Ordinary Kriging, (3) Universal Kriging, (4) Cokriging, (5) Selecting a grid spacing for kriging. Distributed by permission.

R Markdown mini-tutorials

These illustrate some details of geostatistics. Load into R Studio and compile (“knit”) to HTML, or execute chunk-by-chunk

  • Constructing a prediction grid

    Shows how to create a regular grid onto which kriging or another prediction method can be applied.

  • Kriging From scratch -- Spatial Classes version

    A direct application of the ordinary kriging equations to derive kriging weights. This version uses the legacy sp “Classes and Methods for Spatial Data” representation of spatial objects.

  • Kriging From scratch -- Simple Features version

    A direct application of the ordinary kriging equations to derive kriging weights. This version uses the newer sf “Simple Features” representation of spatial objects.

  • Detecting and modelling anisotropy for Ordinary Kriging

  • Mapping classes

    Shows how to map class probabilities over a grid using indicator kriging in gstat, and then make a map of the most probable, along with a map of prediction reliability, represented by the maximum probability of any class. It also has a section on using classification trees and random forests to classify the same dataset.

  • (Geo)statistical simulation

    Random numbers in R; simulation of binomial, normal, and mixed distributions; application to simulating random fields.

Spatial analysis

Spatial analysis in R is transitioning to the “Simple Features” representation of spatial objects, as implemented in the sf package. Many of the tutorials listed here were developed with the earlier “Spatial Objects in R” representation, as implemented in the sp package. Be alert also to changes in the GDAL and PROJ packages when specifying or transforming coördinate reference systems.

General statistical methods

R Markdown mini-tutorials

Regional mapping

Geographic information systems (GIS)

Time-series analysis

[1]or adapted from others

Last modified 29-May-2020