Kriging Class

class skgstat.OrdinaryKriging(variogram, min_points=5, max_points=15, mode='exact', precision=100, solver='inv', n_jobs=1, perf=False, sparse=False, coordinates=None, values=None)[source]
__init__(variogram, min_points=5, max_points=15, mode='exact', precision=100, solver='inv', n_jobs=1, perf=False, sparse=False, coordinates=None, values=None)[source]

Ordinary Kriging routine

Ordinary kriging estimator derived from the given Variogram <skgstat.Variogram> class. To calculate estimations for unobserved locations, an instance of this class can either be called, or the OrdinaryKriging.transform method can be used.

Parameters
  • variogram (Variogram) – Variogram used to build the kriging matrix. Make sure that this instance is describing the spatial dependence in the data well, otherwise the kriging estimation will most likely produce bad estimations.

  • min_points (int) – Minimum amount of points, that have to lie within the variogram’s range. In case not enough points are available, the estimation will be rejected and a null value will be estimated.

  • max_points (int) – Maximum amount of points, that will be considered for the estimation of one unobserved location. In case more points are available within the variogram’s range, only the max_points closest will be used for estimation. Note that the kriging matrix will be an max_points x max_points matrix and large numbers do significantly increase the calculation time.

  • mode (str) – Has to be one of ‘exact’ or ‘estimate’. In exact mode (default) the variogram matrix will be calculated from scratch in each iteration. This gives an exact solution, but it is also slower. In estimate mode, a set of semivariances is pre-calculated and the closest value will be used. This is significantly faster, but the estimation quality is dependent on the given precision.

  • precision (int) – Only needed if mode=’estimate’. This is the number of pre-calculated in-range semivariances. If chosen too low, the estimation will be off, if too high the performance gain is limited.

  • solver (str) – Do not change this argument

  • n_jobs (int) – Number of processes to be started in multiprocessing.

  • perf (bool) – If True, the different parts of the algorithm will record their processing time. This is meant to be used for optimization and will be removed in a future version. Do not rely on this argument.

  • sparse (bool) –

  • coordinates (numpy.ndarray, MetricSpace) –

  • values (numpy.ndarray) –

transform(*x)[source]

Kriging

returns an estimation of the observable for the given unobserved locations. Each coordinate dimension should be a 1D array.

Changed in version 0.6.4: sigma array is now initialized with NaN, instead of empty.

Parameters

x (numpy.array, MetricSpace) – One 1D array for each coordinate dimension. Typically two or three array, x, y, (z) are passed for 2D and 3D Kriging

Returns

Z – Array of estimates

Return type

numpy.array