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.

Many of the documents are provided as R Markdown sources. These are most easily processed in the R Studio environment.

R Project for Statistical Computing

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.

  • Spatial simulated annealing

    Step-by-step explanation of a method to optimally place sample points in order to minimize the maximum or average kriging variance. This is especially useful in irregularly-shaped areas or areas with existing samples.

  • 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 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.

Spatial sampling

  • Spatial Coverage Sampling

    The spcosa R package is described in Walvoort, D. J. J., Brus, D. J., & de Gruijter, J. J. (2010). An R package for spatial coverage sampling and random sampling from compact geographical strata by k-means. Computers & Geosciences, 36(10), 1261–1267. https://doi.org/10.1016/j.cageo.2010.04.005

    The aim is to place the sample locations so that they cover the study area as uniformly as possible. In a rectangular area grid sampling will accomplish this, but most study areas are not rectangles. Further, this package accounts for two-stage sampling: we can use the existing points and add new ones in the optimal locations.

General statistical methods

R Markdown tutorials

Regional mapping

Geographic information systems (GIS)

R Markdown tutorials

Time-series analysis

Last modified 15-December-2023