Expand description
Kriging interpolation methods
This module provides implementations of Kriging, also known as Gaussian process regression, which is a method of spatial interpolation based on the theory of regionalized variables. Kriging provides the best linear unbiased estimator (BLUE) for spatial data.
§Theory
Kriging assumes that the data follows a spatial stochastic process and uses a variogram or covariance function to model spatial correlation. The main types of Kriging implemented are:
- Simple Kriging: Assumes a known constant mean
- Ordinary Kriging: Estimates the mean locally (most common)
- Universal Kriging: Models trend with basis functions
The Kriging prediction at location x₀ is: Z*(x₀) = Σᵢ λᵢ Z(xᵢ)
where λᵢ are weights determined by solving the Kriging system.
§Examples
use scirs2_spatial::kriging::{OrdinaryKriging, VariogramModel};
use scirs2_core::ndarray::array;
// Sample data points (x, y, z)
let points = array![
[0.0, 0.0],
[1.0, 0.0],
[0.0, 1.0],
[1.0, 1.0],
[0.5, 0.5]
];
let values = array![1.0, 2.0, 3.0, 4.0, 2.5];
// Create Kriging interpolator with spherical variogram
let variogram = VariogramModel::spherical(1.0, 0.1, 0.0);
let kriging = OrdinaryKriging::new(&points.view(), &values.view(), variogram).expect("Operation failed");
// Interpolate at new location
let prediction = kriging.predict(&[0.25, 0.25]).expect("Operation failed");
println!("Predicted value: {:.3}", prediction.value);
println!("Prediction variance: {:.3}", prediction.variance);Structs§
- Kriging
Prediction - Prediction result from Kriging interpolation
- Ordinary
Kriging - Ordinary Kriging interpolator
- Simple
Kriging - Simple Kriging interpolator
Enums§
- Variogram
Model - Variogram model types for Kriging