Empirical semivariogram (source code)

= Empirical semivariogram
{title2=$\widehat\gamma(h)$}

For a distance bin $B$, the <empirical semivariogram> is $\widehat\gamma(B)=(2|B|)^{-1}\sum_{(i,j)\in B}(z_i-z_j)^2$. A nonconstant drift adds half its squared pairwise differences to the expected raw <semivariogram>. Residual <semivariograms> estimate spatial dependence after adjusting for the drift.