Note
Go to the end to download the full example code.
Ordinary Kriging
Ordinary kriging will estimate an appropriate mean of the field, based on the given observations/conditions and the covariance model used.
The resulting system of equations for \(W\) is given by:
\[\begin{split}\begin{pmatrix}W\\\mu\end{pmatrix} = \begin{pmatrix}
c(x_1,x_1) & \cdots & c(x_1,x_n) &1 \\
\vdots & \ddots & \vdots & \vdots \\
c(x_n,x_1) & \cdots & c(x_n,x_n) & 1 \\
1 &\cdots& 1 & 0
\end{pmatrix}^{-1}
\begin{pmatrix}c(x_1,x_0) \\ \vdots \\ c(x_n,x_0) \\ 1\end{pmatrix}\end{split}\]
Thereby \(c(x_i,x_j)\) is the covariance of the given observations and \(\mu\) is a Lagrange multiplier to minimize the kriging error and estimate the mean.
Example
Here we use ordinary kriging in 1D (for plotting reasons) with 5 given observations/conditions.
The estimated mean can be accessed by krig.mean.

Total running time of the script: (0 minutes 0.058 seconds)