Class KrigingInterpolation

java.lang.Object
smile.interpolation.KrigingInterpolation

public class KrigingInterpolation extends Object
Kriging interpolation for the data points irregularly distributed in space. Kriging belongs to the family of linear least squares estimation algorithms, also known as Gauss-Markov estimation or Gaussian process regression.

Kriging can be either an interpolation method or a fitting method. The distinction between the two is whether the fitted/interpolated function goes exactly through all the input data points (interpolation), or whether it allows measurement errors to be specified and then "smooths" to get a statistically better predictor that does not generally go through the data points.

The aim of kriging is to estimate the value of an unknown real-valued function, f, at a point, x, given the values of the function at some other points, x1,…, xn. Kriging computes the best linear unbiased estimator based on a stochastic model of the spatial dependence quantified either by the variogram γ(x,y) or by expectation μ(x) = E[f(x)] and the covariance function c(x,y) of the random field. A kriging estimator is a linear combination that may be written as

ƒ(x) = Σ λi(x) f(xi)

The weights λi are solutions of a system of linear equations which is obtained by assuming that f is a sample-path of a random process F(x), and that the error of prediction

ε(x) = F(x) - Σ λi(x) F(xi)

is to be minimized in some sense.

Depending on the stochastic properties of the random field different types of kriging apply. The type of kriging determines the linear constraint on the weights λi implied by the unbiasedness condition; i.e. the linear constraint, and hence the method for calculating the weights, depends upon the type of kriging.

This class implements ordinary kriging, which is the most commonly used type of kriging. The typical assumptions for the practical application of ordinary kriging are:

  • Intrinsic stationarity or wide sense stationarity of the field
  • enough observations to estimate the variogram.
The mathematical condition for applicability of ordinary kriging are:
  • The mean E[f(x)] = μ is unknown but constant
  • The variogram γ(x,y) = E[(f(x) - f(y))2] of f(x) is known.
The kriging weights of ordinary kriging fulfill the unbiasedness condition Σ λi = 1
  • Constructor Details

    • KrigingInterpolation

      public KrigingInterpolation(double[][] x, double[] y)
      Constructor. The power variogram is employed. We assume no errors, i.e. we are doing interpolation rather fitting.
      Parameters:
      x - the data points.
      y - the function values at x.
    • KrigingInterpolation

      public KrigingInterpolation(double[][] x, double[] y, Variogram variogram, double[] error)
      Constructor.
      Parameters:
      x - the data points.
      y - the function values at x.
      variogram - the variogram function of offset distance to estimate the mean square variation of function y(x).
      error - the measure error associated with y. It is the sqrt of diagonal elements of covariance matrix.
  • Method Details

    • interpolate

      public double interpolate(double... x)
      Interpolate the function at given point.
      Parameters:
      x - a point.
      Returns:
      the interpolated function value.
    • toString

      public String toString()
      Overrides:
      toString in class Object