Point Kriging#
- kriging(observations, theoretical_model, points, how='ok', neighbors_range=None, no_neighbors=4, use_all_neighbors_in_range=False, sk_mean=None, allow_approx_solutions=False, number_of_workers=1, show_progress_bar=True)[source]
Function manages Ordinary Kriging and Simple Kriging predictions.
- Parameters:
- observationsnumpy array
Known points and their values.
- theoretical_modelTheoreticalVariogram
Fitted variogram model.
- pointsnumpy array
Coordinates with missing values (to estimate results).
- 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.- number_of_workersint, default=1
How many processing units can be used for predictions. Increase it only for a very large number of interpolated points (~10k+).
- show_progress_barbool, default=True
Show progress bar of predictions.
- Returns:
- : numpy array
Predictions
[predicted value, variance error, longitude (x), latitude (y)]
- ordinary_kriging(theoretical_model, known_locations, unknown_location, neighbors_range=None, no_neighbors=4, use_all_neighbors_in_range=False, allow_approximate_solutions=False)[source]
Function predicts value at unknown location with Ordinary Kriging technique.
- Parameters:
- theoretical_modelTheoreticalVariogram
A trained theoretical variogram model.
- known_locationsnumpy array
The known locations.
- unknown_locationUnion[List, Tuple, numpy array]
Point where you want to estimate value
(x, y) <-> (lon, lat)
.- 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.- allow_approximate_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:
- : numpy array
[predicted value, variance error, longitude (x), latitude (y)]
- Raises:
- RunetimeError
Singularity matrix in a Kriging system.
- simple_kriging(theoretical_model, known_locations, unknown_location, process_mean, neighbors_range=None, no_neighbors=1, use_all_neighbors_in_range=False, allow_approximate_solutions=False)[source]
Function predicts value at unknown location with Ordinary Kriging technique.
- Parameters:
- theoretical_modelTheoreticalVariogram
A trained theoretical variogram model.
- known_locationsnumpy array
The known locations.
- unknown_locationUnion[List, Tuple, numpy array]
Point where you want to estimate value
(x, y) <-> (lon, lat)
.- process_meanfloat
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.
- 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.- allow_approximate_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:
- : numpy array
[predicted value, variance error, longitude (x), latitude (y)]
- Raises:
- RunetimeError
Singularity matrix in a Kriging system.