Variogram models#

Scikit-GStat implements different theoretical variogram functions. These model functions expect a single lag value or an array of lag values as input data. Each function has at least a parameter a for the effective range and a parameter c0 for the sill. The nugget parameter b is optional and will be set to b:=0 if not given.

Spherical model#

skgstat.models.spherical(h, r, c0, b=0.0)[source]#

Spherical Variogram function

Implementation of the spherical variogram function. Calculates the dependent variable for a given lag (h). The nugget (b) defaults to be 0.

Parameters:
  • h (float) – Specifies the lag of separating distances that the dependent variable shall be calculated for. It has to be a positive real number.

  • r (float) – The effective range. Note this is not the range parameter! However, for the spherical variogram the range and effective range are the same.

  • c0 (float) – The partial sill of the variogram, where it will flatten out. The function will not return a value higher than C0 + b.

  • b (float) – The nugget of the variogram. This is the value of independent variable at the distance of zero. This is usually attributed to non-spatial variance.

Returns:

gamma – Unlike in most variogram function formulas, which define the function for 2*\gamma, this function will return \gamma only.

Return type:

numpy.float64

Notes

The implementation follows [6]:

\gamma = b + C_0 * \left({1.5*\frac{h}{a} - 0.5*\left(\frac{h}{a}\right)^3}\right)

if h < r, and

\gamma = b + C_0

else. r is the effective range, which is in case of the spherical variogram just a.

References

Exponential model#

skgstat.models.exponential(h, r, c0, b=0.0)[source]#

Exponential Variogram function

Implementation of the exponential variogram function. Calculates the dependent variable for a given lag (h). The nugget (b) defaults to be 0.

Parameters:
  • h (float) – Specifies the lag of separating distances that the dependent variable shall be calculated for. It has to be a positive real number.

  • r (float) – The effective range. Note this is not the range parameter! For the exponential variogram function the range parameter a is defined to be a=\frac{r}{3}. The effective range is the lag where 95% of the sill are exceeded. This is needed as the sill is only approached asymptotically by an exponential function.

  • c0 (float) – The partial sill of the variogram, where it will flatten out. The function will not return a value higher than C0 + b.

  • b (float) – The nugget of the variogram. This is the value of independent variable at the distance of zero. This is usually attributed to non-spatial variance.

Returns:

gamma – Unlike in most variogram function formulas, which define the function for 2*\gamma, this function will return \gamma only.

Return type:

numpy.float64

Notes

The implementation following [7], [9] and [8] is as:

\gamma = b + C_0 * \left({1 - e^{-\frac{h}{a}}}\right)

a is the range parameter, that can be calculated from the effective range r as: a = \frac{r}{3}.

References

Gaussian model#

skgstat.models.gaussian(h, r, c0, b=0.0)[source]#

Gaussian Variogram function

Implementation of the Gaussian variogram function. Calculates the dependent variable for a given lag (h). The nugget (b) defaults to be 0.

Parameters:
  • h (float) – Specifies the lag of separating distances that the dependent variable shall be calculated for. It has to be a positive real number.

  • r (float) – The effective range. Note this is not the range parameter! For the exponential variogram function the range parameter a is defined to be a=\frac{r}{2}. The effetive range is the lag where 95% of the sill are exceeded. This is needed as the sill is only approached asymptotically by an exponential function.

  • c0 (float) – The partial sill of the variogram, where it will flatten out. The function will not return a value higher than C0 + b.

  • b (float) – The nugget of the variogram. This is the value of independent variable at the distance of zero. This is usually attributed to non-spatial variance.

Returns:

gamma – Unlike in most variogram function formulas, which define the function for 2*\gamma, this function will return \gamma only.

Return type:

numpy.float64

Notes

This implementation follows [10] and [11]:

\gamma = b + c_0 * \left({1 - e^{-\frac{h^2}{a^2}}}\right)

a is the range parameter, that can be calculated from the effective range r as:

a = \frac{r}{2}

References

Cubic model#

skgstat.models.cubic(h, r, c0, b=0.0)[source]#

Cubic Variogram function

Implementation of the Cubic variogram function. Calculates the dependent variable for a given lag (h). The nugget (b) defaults to be 0.

Parameters:
  • h (float) – Specifies the lag of separating distances that the dependent variable shall be calculated for. It has to be a positive real number.

  • r (float) – The effective range. Note this is not the range parameter! However, for the cubic variogram the range and effective range are the same.

  • c0 (float) – The partial sill of the variogram, where it will flatten out. The function will not return a value higher than C0 + b.

  • b (float) – The nugget of the variogram. This is the value of independent variable at the distance of zero. This is usually attributed to non-spatial variance.

Returns:

gamma – Cubic variogram model values

Return type:

numpy.ndarray

Notes

This implementation is taken from [12]_:

\gamma = b + C_0 * \left[{7 * \left(\frac{h^2}{a^2}\right) - \frac{35}{4} * \left(\frac{h^3}{a^3}\right) + \frac{7}{2} * \left(\frac{h^5}{a^5}\right) - \frac{3}{4} * \left(\frac{h^7}{a^7}\right)}\right]

a is the range parameter. For the cubic function, the effective range and range parameter are the same.

References

Stable model#

skgstat.models.stable(h, r, c0, s, b=0.0)[source]#

Stable Variogram function

Implementation of the stable variogram function. Calculates the dependent variable for a given lag (h). The nugget (b) defaults to be 0.

Changed in version 0.4.4: Now returns the nugget at lag 0

Parameters:
  • h (float) – Specifies the lag of separating distances that the dependent variable shall be calculated for. It has to be a positive real number.

  • r (float) – The effective range. Note this is not the range parameter! For the stable variogram function the range parameter a is defined to be a = \frac{r}{3^{\frac{1}{s}}}. The effective range is the lag where 95% of the sill are exceeded. This is needed as the sill is only approached asymptotically by the e-function part of the stable model.

  • c0 (float) – The partial sill of the variogram, where it will flatten out. The function will not return a value higher than C0 + b.

  • s (float) – Shape parameter. For s <= 2 the model will be shaped more like a exponential or spherical model, for s > 2 it will be shaped most like a Gaussian function.

  • b (float) – The nugget of the variogram. This is the value of independent variable at the distance of zero. This is usually attributed to non-spatial variance.

Returns:

gamma – Unlike in most variogram function formulas, which define the function for 2*\gamma, this function will return \gamma only.

Return type:

numpy.float64

Notes

The implementation is taken from [12]_:

\gamma = b + C_0 * \left({1. - e^{- {\frac{h}{a}}^s}}\right)

a is the range parameter and is calculated from the effective range r as:

a = \frac{r}{3^{\frac{1}{s}}}

References

Matérn model#

skgstat.models.matern(h, r, c0, s, b=0.0)[source]#

Matérn Variogram function

Implementation of the Matérn variogram function. Calculates the dependent variable for a given lag (h). The nugget (b) defaults to be 0.

Changed in version 0.4.4: now returns the nugget instead of NaN for lag 0.

Parameters:
  • h (float) – Specifies the lag of separating distances that the dependent variable shall be calculated for. It has to be a positive real number.

  • r (float) – The effective range. Note this is not the range parameter! For the Matérn variogram function the range parameter a is defined to be a = \frac{r}{2} and a = \frac{r}{3} if s is smaller than 0.5 or larger than 10. The effective range is the lag where 95% of the sill are exceeded. This is needed as the sill is only approached asymptotically by Matérn model.

  • c0 (float) – The partial sill of the variogram, where it will flatten out. The function will not return a value higher than C0 + b.

  • s (float) – Smoothness parameter. The smoothness parameter can shape a smooth or rough variogram function. A value of 0.5 will yield the exponential function, while a smoothness of +inf is exactly the Gaussian model. Typically a value of 10 is close enough to Gaussian shape to simulate its behaviour. Low values are considered to be ‘smooth’, while larger values are considered to describe a ‘rough’ random field.

  • b (float) – The nugget of the variogram. This is the value of independent variable at the distance of zero. This is usually attributed to non-spatial variance.

Returns:

gamma – Unlike in most variogram function formulas, which define the function for 2*\gamma, this function will return \gamma only.

Return type:

numpy.float64

Notes

The implementation is taken from [13]:

\gamma (h) = b + C_0 \left( 1 - \frac{1}{2^{\upsilon - 1} \Gamma(\upsilon)}\left(\frac{h}{a}\right)^\upsilon K_\upsilon \left(\frac{h}{a}\right)\right)

a is the range parameter and is calculated from the effective range r as:

a = \frac{r}{2}

References