Mathwords logoMathwords

Semivariance — Definition, Formula & Example

Semivariance is half the average squared difference between measurements taken a fixed distance apart. It tells you how quickly values change as you move farther from a point. In finance, the same word means something different: downside semivariance, which measures how far returns fall below their average.

For a spatial random variable Z(x)Z(x), the semivariance function (semivariogram) at lag distance hh is γ(h)=12 E[(Z(x)−Z(x+h))2]\gamma(h) = \tfrac{1}{2}\,E\big[(Z(x) - Z(x+h))^2\big]. Under intrinsic stationarity this depends only on hh, not on the location xx. You estimate it from data by averaging over all N(h)N(h) pairs of points separated by hh. In finance, downside semivariance is a different quantity: 1n∑ri<rˉ(ri−rˉ)2\frac{1}{n}\sum_{r_i < \bar{r}} (r_i - \bar{r})^2, the squared shortfalls of returns below their mean (or below a target return), summed and divided by the number of returns nn. Some texts divide by the number of returns below the mean instead. The formula and example on this page use the spatial meaning.

Key Formula

γ^(h)=12N(h)∑i=1N(h)[z(xi)−z(xi+h)]2\hat{\gamma}(h) = \frac{1}{2N(h)} \sum_{i=1}^{N(h)} \big[z(x_i) - z(x_i + h)\big]^2
Where:
  • hh = Lag: the distance separating each pair of measurements
  • N(h)N(h) = Number of data pairs that are exactly distance h apart
  • z(xi)z(x_i) = Measured value at location xix_i
  • z(xi+h)z(x_i + h) = Measured value at the location a distance h from xix_i
  • γ^(h)\hat{\gamma}(h) = Estimated semivariance at lag h, in squared units of z

Worked Example

Problem: A farmer measures topsoil depth every 10 feet along a fence line. The depths, in order, are 4, 6, 5, 9, and 8 inches. Find the semivariance at lags of 10, 20, and 30 feet.
Step 1: For h = 10 ft, pair each neighbor: (4,6), (6,5), (5,9), (9,8). There are N = 4 pairs. Square each difference and add: 4 + 1 + 16 + 1 = 22.
γ^(10)=222(4)=2.75\hat{\gamma}(10) = \frac{22}{2(4)} = 2.75
Step 2: For h = 20 ft, skip one point: (4,5), (6,9), (5,8). There are N = 3 pairs. The squared differences are 1, 9, and 9, which sum to 19.
γ^(20)=192(3)=196≈3.17\hat{\gamma}(20) = \frac{19}{2(3)} = \frac{19}{6} \approx 3.17
Step 3: For h = 30 ft, the pairs are (4,9) and (6,8). There are N = 2 pairs. The squared differences are 25 and 4, which sum to 29.
γ^(30)=292(2)=7.25\hat{\gamma}(30) = \frac{29}{2(2)} = 7.25
Answer: The semivariances are 2.75, about 3.17, and 7.25 (in units of inches squared) at 10, 20, and 30 feet. The values rise with distance. Spots close together have similar topsoil depths, and spots far apart differ more. That pattern is called spatial correlation.

Why It Matters

Geologists, environmental scientists, and mining engineers plot semivariance against distance to build a semivariogram. That model feeds kriging, a method for predicting values such as groundwater contamination or ore grade at places nobody sampled. The distance where the curve levels off, called the range, shows how far apart samples can be and still tell you something about each other.

Common Mistakes

Mistake: Confusing spatial semivariance with the finance term "downside semivariance."
Correction: In finance, semivariance averages squared deviations below the mean (or a target return) to measure downside risk. The spatial version compares pairs of points separated by a lag h. Check which field you are working in before you pick a formula.

Related Terms