Validation#
Cross-validation#
- validate_kriging(points, theoretical_model, how='ok', neighbors_range=None, no_neighbors=4, use_all_neighbors_in_range=False, sk_mean=None, allow_approx_solutions=False)[source]
Function performs cross-validation of kriging models.
- Parameters:
- pointsnumpy array
Known points and their values.
- theoretical_modelTheoreticalVariogram
Fitted variogram model.
- howstr, default=’ok’
- Select what kind of kriging you want to perform:
‘ok’: ordinary kriging,
‘sk’: simple kriging - if it is set then
sk_mean
parameter must be provided.
- neighbors_rangefloat, default=None
The maximum distance where we search for neighbors. If
None
is given then range is selected from thetheoretical_model
rang
attribute.- no_neighborsint, default = 4
The number of the n-closest neighbors used for interpolation.
- use_all_neighbors_in_rangebool, default = False
True
: if the real number of neighbors within theneighbors_range
is greater than thenumber_of_neighbors
parameter then take all of them anyway.- sk_meanfloat, default=None
The mean value of a process over a study area. Should be know before processing. That’s why Simple Kriging has a limited number of applications. You must have multiple samples and well-known area to know this parameter.
- allow_approx_solutionsbool, default=False
Allows the approximation of kriging weights based on the OLS algorithm. We don’t recommend set it to
True
if you don’t know what are you doing. This parameter can be useful when you have clusters in your dataset, that can lead to singular or near-singular matrix creation.
- Returns:
- : Tuple
- Function returns tuple with:
Mean Prediction Error,
Mean Kriging Error: ratio of variance of prediction errors to the average variance error of kriging,
array with:
[coordinate x, coordinate y, prediction error, kriging estimate error]
References
Clark, I., (2004) “The Art of Cross Validation in Geostatistical Applications”
Clark I., (1979) “Does Geostatistics Work”, Proc. 16th APCOM, pp.213.-225.