krigekit.variogram_kernels#

Engine-compatible variogram kernels and component definitions.

Classes#

vgm

Backwards-compatible namespace for theoretical model functions.

Functions#

resolve_model(name)

Return the 3-letter canonical model key for name.

calc_cov(vtype, d[, psill, rng])

Evaluate an engine-compatible covariance model.

calc_vgm(vtype, d[, psill, rng, nugget])

Evaluate a semivariogram model.

vgmfunc(models, h, *params)

Evaluate a (possibly nested) variogram model at lags h.

Module Contents#

krigekit.variogram_kernels.resolve_model(name)#

Return the 3-letter canonical model key for name.

Accepts canonical keys ("exp"), full names ("exponential") or any unambiguous prefix. Raises KeyError with a helpful message otherwise.

krigekit.variogram_kernels.calc_cov(vtype, d, psill=1.0, rng=1.0)#

Evaluate an engine-compatible covariance model.

Parameters:
  • vtype (str) – Variogram/covariance model code or alias accepted by resolve_model().

  • d (array-like) – Lag distance(s) in the same units as rng.

  • psill (float, optional) – Partial sill multiplier for the unit correlation function.

  • rng (float, optional) – Practical range / period parameter. Must be positive.

Returns:

numpy.ndarray or scalar-likepsill * rho(d / rng) using the same model shapes as the Fortran engine. Nugget handling here mirrors a standalone model evaluation: "nug" is one at zero lag and zero otherwise. In kriging matrix assembly, per-structure nugget terms are added on the diagonal by the engine.

krigekit.variogram_kernels.calc_vgm(vtype, d, psill=1.0, rng=1.0, nugget=0.0)#

Evaluate a semivariogram model.

The returned value is psill * (1 - rho(d / rng)) + nugget. This helper is intended for experimental variogram fitting and plotting, so the nugget is added uniformly to the curve. Kriging matrix assembly handles nugget terms separately through krigekit.Kriging.set_vgm().

krigekit.variogram_kernels.vgmfunc(models, h, *params)#

Evaluate a (possibly nested) variogram model at lags h.

Parameters:
  • models (sequence of str) – One model name per nested structure.

  • *params – Flattened (sill, range) pairs, one pair per model, optionally followed by a single trailing nugget when an odd number of values is given: sill0, range0, sill1, range1, ..., [nugget].

Returns:

numpy.ndarray – Sum of the requested nested variogram structures at the supplied lags.

class krigekit.variogram_kernels.vgm#

Backwards-compatible namespace for theoretical model functions.