Introduction to Semivariograms

A semivariogram describes how data values change with increasing distance. It helps quantify spatial dependence.

Spatial Dependence and Tobler’s Law

Tobler’s First Law of Geography states: > “Everything is related to everything else, but near things are more related than distant things.”

In semivariograms: - Short distances → Similar values (low variance). - Large distances → Increasing dissimilarity.


Semivariogram Components

The key parameters of a semivariogram are:

A basic semivariogram


Basic Variogram Statistics

1. Sill - Nugget

  • Measures the structured spatial variance.
  • Large value → Strong spatial structure.
  • Small value → Weak spatial dependence.

2. Relative Nugget Effect (Nugget/Sill)

  • High (~1) → Mostly random noise.
  • Low (~0) → Strong spatial structure.

3. Range-to-Distance Ratio (Range / Max Distance)

  • Close to 1 → Strong correlation across the study area.
  • Close to 0 → Correlation fades quickly.

4. Partial Sill (Sill - Nugget)

  • Measures the variance explained by spatial dependence.

5. Proportion of Spatially Structured Variation

  • Formula: Partial Sill / Sill.
  • Close to 1 → Mostly structured.
  • Close to 0 → Mostly random.

6. Mean Variogram Value Over Specific Lag Distances

  • Helps analyze how spatial dependence changes at different distances.

7. Relative Range (Range / Study Area Size)

  • Close to 1 → Correlation spans the entire study area.
  • Much less than 1 → Limited spatial dependence.
  • This will be discussed briefly at the end of the tutorial.

8. Anisotropy

  • Sometimes spatial dependence varies by direction, a phenomenon known as anisotropy.
  • To measure anisotropy, we can compute variograms along different angles (e.g., 0°, 45°, 90°).
  • If spatial correlation differs by direction, we can quantify it using anisotropy ratios.

Working Through a Real Example: The Meuse Dataset

library(sp)
library(gstat)

data(meuse, package = "sp")
coordinates(meuse) <- ~x+y  # Define spatial coordinates

# Compute the Empirical Variogram
variogram_model <- variogram(zinc ~ 1, meuse)
plot(variogram_model, main = "Empirical Semivariogram")

# Fit a Variogram Model
vgm_model_nugget <- fit.variogram(variogram_model, 
                                  vgm(psill = 10000, model = "Nug", range = 0, add.to = 
                                      vgm(psill = 150000, model = "Sph", range = 600)))
print(vgm_model_nugget)
##   model     psill    range
## 1   Sph 134743.02 830.8819
## 2   Nug  24797.86   0.0000
plot(variogram_model, vgm_model_nugget, main = "Fitted Semivariogram Model")

# Next Step

For practice with your own CSV data (and side-by-side comparison of correlograms and semivariograms), see:

Rendering the RMarkdown File

Run in R:

rmarkdown::render("variogram_tutorial1.Rmd")

This will create a Markdown file that you can push to GitHub.