In spatial statistics the theoretical variogram 2γ(x,y) is a function describing the degree of spatial dependence of a spatial random field or stochastic process Z(x). It is defined as the expected squared increment of the values between locations x and y (Wackernagel 2003):
where γ(x,y) itself is called the semivariogram. In case of a stationary process the variogram and semivariogram can be represented as a function γ_{s}(h) = γ(0,0 + h) of the difference h = y − x between locations only, by the following relation (Cressie 1993):
If the process is furthermore isotropic, then variogram and semivariogram can be represented by a function γ_{i}(h): = γ_{s}(he_{1}) of the distance only (Cressie 1993):
The indexes i or s are typically not written. The terms are used for all three forms of the function. Moreover the term variogram is sometimes used for semivariogram and the symbol γ for the variogram, which brings some confusion.
Contents 
According to (Cressie 1993, Chiles and Delfiner 1999, Wackernagel 2003) the theoretical variogram has the following properties:
which corresponds to the fact that the variance var(X) of is given by the negative of this double sum and must be nonnegative.
For an instationary process the square of the difference between expected values at both points must be added:2γ(x,y) = C(x,x) + C(y,y) − 2C(x,y)
2γ(x,y) = C(x,x) + C(y,y) − 2C(x,y) + E(Z(x) − Z(y))^{2}
For observations at locations the empirical variogram is defined as (Cressie 1993):
where N(h) denotes the set of pairs of observations such that  x_{i} − x_{j}  = h, and  N(h)  is the number of pairs in the set. (Generally an "approximate distance" h is used, implemented using a certain tolerance.)
The empirical variogram is used in geostatistics as a first estimate of the (theoretical) variogram needed for spatial interpolation by kriging.
According (Cressie 1993) for observations z_{i} = Z(x_{i}) from a stationary random field Z(x) the empirical variogram with lag tolerance 0 is an unbiased estimator of the theoretical variogram, due to
See the controversy discussion on the correctness of the scaling factor below.
The following parameters are often used to describe variograms:
The empirical variogram cannot be computed at every lag distance h and due to variation in the estimation it is not ensured that it is a valid variogram, as defined above. However some Geostatistical methods such as kriging need valid semivariograms. In applied geostatistics the empirical variograms are thus often approximated by model function ensuring validity (Chiles&Delfiner 1999). Some important models are (Chiles&Delfiner 1999, Cressie 1993):
The parameter a has different values in different references, due to the ambiguity in the definition of the range. E.g. a = 1 / 3 is the value used in (Chiles&Delfiner 1999). The 1_{A}(h) function is 1 if and 0 otherwise.
Three functions are used in geostatistics for describing the spatial or the temporal correlation of observations: these are the correlogram, the covariance and the semivariogram. The last is also more simply called variogram. The sampling variogram, unlike the semivariogram and the variogram, shows where a significant degree of spatial dependence in the sample space or sampling unit dissipates into randomness when the variance terms of a temporally or insitu ordered set are plotted against the variance of the set and the lower limits of its 99% and 95% confidence ranges.
The variogram is the key function in geostatistics as it will be used to fit a model of the temporal/spatial correlation of the observed phenomenon. One is thus making a distinction between the experimental variogram that is a visualisation of a possible spatial/temporal correlation and the variogram model that is further used to define the weights of the kriging function. Note that the experimental variogram is an empirical estimate of the covariance of a Gaussian process. As such, it may not be positive definite and hence not directly usable in kriging, without constraints or further processing. This explains why only a limited number of variogram models are used: most commonly, the linear, the spherical, the gaussian and the exponential models.
When a variogram is used to describe the correlation of different variables it is called crossvariogram. Crossvariograms are used in cokriging. Should the variable be binary or represent classes of values, one is then talking about indicator variograms. Indicator variogram is used in indicator kriging.
In mathematical statistics, a set of n measured values gives df=n1 degrees of freedom whereas the in situ or temporally ordered set gives df(o)=2(n1) degrees for the first variance term. It is claimed ^{[1]} that the variogram and semivariogram are both invalid measures for variability, precision and risk because the sum of squared differences between x and x+h is divided by n, the number of data in the set rather than by df(o)=2(n1), the degrees of freedom for the first variance term of the ordered set.
