The Torgegram is an empirical semivariogram is a tool used to visualize and model
spatial dependence by estimating the semivariance of a process at varying distances
separately for flow-connected, flow-unconnected, and Euclidean distances.
For a constant-mean process, the
semivariance at distance \(h\) is denoted \(\gamma(h)\) and defined as
\(0.5 * Var(z1  - z2)\). Under second-order stationarity,
\(\gamma(h) = Cov(0) - Cov(h)\), where \(Cov(h)\) is the covariance function
at distance h. Typically the residuals from an ordinary
least squares fit defined by formula are second-order stationary with
mean zero. These residuals are used to compute the empirical semivariogram.
At a distance h, the empirical semivariance is
\(1/N(h) \sum (r1 - r2)^2\), where \(N(h)\) is the number of (unique)
pairs in the set of observations whose distance separation is h and
r1 and r2 are residuals corresponding to observations whose
distance separation is h. In spmodel, these distance bins actually
contain observations whose distance separation is h +- c,
where c is a constant determined implicitly by bins. Typically,
only observations whose distance separation is below some cutoff are used
to compute the empirical semivariogram (this cutoff is determined by cutoff).