spatial-ews/spatialwarnings

Add variogram-based indicators

alexgenin opened this issue · 3 comments

Nijp et al. (2019) suggest using (semi-)variograms as a way to detect spatial autocorrelation. In their words:

Variograms (Figure 6) provide a measurable, interpretable and intuitive measure of vegetation patch‐size distribution (Li & Reynolds, 1995; Woodcock et al., 1988), are applicable to binary data, quantify spatial correlation (in random and spatially structured components) and can account for anisotropy (e.g. linear features on sloping terrain) in a single analysis (Rossi et al., 1992; Webster & Oliver, 2007). Additionally, variograms do not, in contrast to wavelength analyses (e.g. Fast Fourier Transforms; Mugglestone and Renshaw (1998)), require equidistant sampling and preprocessing to deal with no data values. https://onlinelibrary.wiley.com/doi/full/10.1111/gcb.14591

Variograms would indeed be a good addition to the package. On top of just using variogram-based measures of autocorrelation, variograms could be used as an alternative way to measure anisotropy in a given image (complementing the theta-spectrum method to detect if patterns are periodic/anistropic in an image).

However, after a quick look, it seems that variogram implementations in R are designed for cases when you have spatial points with x/y coordinates, and not a raster image. As a consequence, they are quite slow (and thus cannot be repeated 1000 times, which is required to test for significance). We could however use a different implementation, or use our own (probably not too hard to implement).

TODO:

  • Implement or find a fast variogram implementation for raster data in R
  • Implement variogram-based indicators (see Nijp et al. 2019, figure 6)
  • Implement the computation of variograms based on different directions to test for anistropy in a given image

There is now a first stab at an implementation in the package. To speed up variogram computations, a random subset of cells is chosen from the matrix.

These indicators will not make it for spatialwarnings 2.0, but will be integrated later so that we can have the feedback from Jelmer (Nijp, from Nijp et al. 2019)

These are now implemented in the package (still with experimental status).