Geostatistical Analysis

Gstat

variogram_model

hydrobox.gstat.variogram_model(coordinates, values, effective_range, sill, nugget=0, n_lags=15, binning='even', maxlag='median', model='spherical', estimator='cressie', s=None, plot=True, ax=None)[source]

Variogram Function

Calculate a variogram from the given parameters. This function will not fit the theoretical function to the experimental function, but use the passed arguments.

Parameters:
coordinates : numpy.ndarray

List of n-dimensional coordinates. Refer to scikit-gstat for more information of this parameter.

values : numpy.ndarray

1D-array of observaitons. Has to match the length of the first axis of coordinates. Refer to scikit-gstat for more information of this parameter.

effective_range : float

Effective range of the theoretical model function. Refer to scikit-gstat for more information of this parameter.

sill : sill

Sill of the theoretical model function. Refer to scikit-gstat for more information of this parameter.

nugget : float

Nugget of the theoretical model function. Defaults to 0 (no nugget effect included in the model). Refer to scikit-gstat for more information of this parameter.

n_lags : int

Number of lag classes to be derived for the variogram. Refer to scikit-gstat for more information of this parameter.

binning : str

Method used for calculating the lag class edges. Can be either ‘even’ (default) or ‘uniform’. ‘even’ will yield lag classes of same width, ‘uniform’ will assure a uniform distribution across all lag classes. Refer to scikit-gstat for more information of this parameter.

maxlag : float, str, None

Maximum separating distance, at which a point pair will still be included into the variogram. Can be the number itself (float > 1), the share of the maximum separating distance observed (0 < maxlag < 1), or one of ‘mean’, ‘median’ to calculate the mean or median of all separating distances as maxlag.

model : str

The theoretical variogram model. Can be one of:

  • spherical
  • exponential
  • gaussian
  • cubic
  • stable
  • matern

Refer to scikit-gstat for more information of this parameter.

estimator : str

The semi-variance estimator to be used for the experimental variogram. Can be one of:

  • materon
  • cressie
  • dowd
  • genton
  • entropy

Refer to scikit-gstat for more information of this parameter.

s : float

In case the model was set to matern, s is the smoothness parameter of the model. In case the model was set to stable, s is the shape parameter of the model. In all other cases, s will be ignored.

plot : bool

If True, the function will return a plot of the Variogram, if False, it will return a tuple of (bins, experimental, model).

ax : None, matplotlib.AxesSubplot

If None, the function will create a new matplotlib Figure. In case an AxesSubplot is passed, that instance will be used for plotting.

Returns:
plot : matlotlib.Figure

Will return a matplotlib Figure, if plot was set to True

data : tuple

Will return the tuple (bins, experimental, model) if plot was set to False.