WSL/SLF GitLab Repository

Commit 55a4ce01 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Finally a good documentation on ordinary kriging... This should be a...

Finally a good documentation on ordinary kriging... This should be a reasonnably standard (since everybody seems to enjoy using his own notation for the various matrices) and more importantly, really show what the whole thing is about, how the matrices are filled and what is solved.
parent f130bc85
......@@ -437,13 +437,13 @@ class SnowHNWInterpolation : public InterpolationAlgorithm {
* @brief Ordinary kriging.
* This implements ordinary krigging (see https://secure.wikimedia.org/wikipedia/en/wiki/Kriging)
* with user-selectable variogram model (see https://secure.wikimedia.org/wikipedia/en/wiki/Variogram).
* The variogram and krigging
* coefficients are re-computed fresh for each new grid (or time step).
* More details about the specific computation steps of kriging are provided in Interpol2D::ODKriging.
*
* The variogram is currently computed with the current data (as 1/2*(X1-X2)^2), which makes it quite
* uninteresting... The next improvement will consist in calculating the covariances (used to build the
* variogram) from time series (thus reflecting the time-correlation between stations).
*
* Please note that the variogram and krigging coefficients are re-computed fresh for each new grid (or time step).
* The available variogram models are found in Fit1D::regression and given as optional arguments
* (by default, LINVARIO is used). Several models can be given, the first that can fit the data will be used
* for the current timestep:
......
......@@ -753,6 +753,50 @@ void Interpol2D::WinstralSB(const DEMObject& dem, const double& dmax, const doub
* @brief Ordinary Kriging matrix formulation
* This implements the matrix formulation of Ordinary Kriging, as shown (for example) in
* <i>"Statistics for spatial data"</i>, Noel A. C. Cressie, John Wiley & Sons, revised edition, 1993, pp122.
*
* First, Ordinary kriging assumes stationarity of the mean of all random variables. We start by solving the following system:
* \f{eqnarray*}{
* \mathbf{\lambda} & = & \mathbf{\Gamma_0^{-1}} \cdot \mathbf{\gamma^*} \\
* \left[
* \begin{array}{c}
* \lambda_1 \\
* \vdots \\
* \lambda_i \\
* \mu
* \end{array}
* \right]
* &
* =
* &
* {
* \left[
* \begin{array}{cccc}
* \Gamma_{1,1} & \cdots & \Gamma_{1,i} & 1 \\
* \vdots & \ddots & \vdots & \vdots \\
* \Gamma_{i,1} & \cdots & \Gamma_{i,i} & 1 \\
* 1 & \cdots & 1 & 0
* \end{array}
* \right]
* }^{-1}
* \cdot
* \left[
* \begin{array}{c}
* \gamma^*_1 \\
* \vdots \\
* \gamma^*_i \\
* 1
* \end{array}
* \right]
* \f}
* where the \f$\lambda_i\f$ are the interpolation weights (at each station i), \f$\mu\f$ is the Lagrange multiplier (used to minimize the error),
* \f$\Gamma_{i,j}\f$ is the covariance between the stations i and j and \f$\gamma^*_i\f$ the covariances between the station i and
* the local position where the interpolation has to be computed (this covariance is computed based on distance, using the variogram that gives
* covariance = f(distance)). Once the \f$\lambda_i\f$ have been computed, the local, interpolated value is computed as
* \f[
* \mathbf{X^*} = \sum \mathbf{\lambda_i} * \mathbf{X_i}
* \f]
* where \f$X_i\f$ is the value measured at station i.
*
* @param vecData vector containing the values as measured at the stations
* @param vecStations vector of stations
* @param dem digital elevation model
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment