# gstools.variogram¶

GStools subpackage providing tools for estimating and fitting variograms.

## Variogram estimation¶

 vario_estimate_unstructured(pos, field, …) Estimates the variogram on a unstructured grid. vario_estimate_structured(field[, …]) Estimates the variogram on a regular grid.

gstools.variogram.vario_estimate_unstructured(pos, field, bin_edges, sampling_size=None, sampling_seed=None, estimator='matheron')[source]

Estimates the variogram on a unstructured grid.

The algorithm calculates following equation: with being the bins.

Or if the estimator “cressie” was chosen: with being the bins. The Cressie estimator is more robust to outliers.

Notes

Internally uses double precision and also returns doubles.

Parameters: pos (list) – the position tuple, containing main direction and transversal directions field (numpy.ndarray) – the spatially distributed data bin_edges (numpy.ndarray) – the bins on which the variogram will be calculated sampling_size (int or None, optional) – for large input data, this method can take a long time to compute the variogram, therefore this argument specifies the number of data points to sample randomly Default: None sampling_seed (int or None, optional) – seed for samples if sampling_size is given. Default: None estimator (str, optional) – the estimator function, possible choices: ”matheron”: the standard method of moments of Matheron ”cressie”: an estimator more robust to outliers Default: “matheron” the estimated variogram and the bin centers
gstools.variogram.vario_estimate_structured(field, direction='x', estimator='matheron')[source]

Estimates the variogram on a regular grid.

The indices of the given direction are used for the bins. The algorithm calculates following equation: with being the bins.

Or if the estimator “cressie” was chosen: with being the bins. The Cressie estimator is more robust to outliers.

Warning

It is assumed that the field is defined on an equidistant Cartesian grid.

Notes

Internally uses double precision and also returns doubles.

Parameters: field (numpy.ndarray) – the spatially distributed data direction (str) – the axis over which the variogram will be estimated (x, y, z) estimator (str, optional) – the estimator function, possible choices: ”mathoron”: the standard method of moments of Matheron ”cressie”: an estimator more robust to outliers Default: “matheron” the estimated variogram along the given direction. numpy.ndarray