Kriging and Inverse Distance Interpolation using GSTAT
Kriging and inverse distance are popular interpolation methods, especially in earth sciences. There are some routines already available on matlab but are severely limited by matlabs memory constraints. By using gstat to handle interpolation and variogram modelling, very large datasets are easily handled.
USAGE: Requires gstat.exe (freeware) to run (www.gstat.org).
% INVERSE DISTANCE:
% INPUTS:
% x :: sample locations in x
% y :: sample locations in y
% z :: sample data
% res :: resolution of interpolation grid
% radius :: maximum search radius for interpolation
% method = 'invdist'
% uselog :: 1 if z values should be log transformed, 0 if not
% name :: name of output file without extension. e.g. 'predictions'.
% (file is given extension '.grd')
% useloc (OPTIONAL) :: if 1, will use file 'locations.dat' if it exist for
% interpolation locations. If 0, will prompt user to choose whether to use
% locations.dat (if it exists) or rewrite. Useful when calling the
% interpolation routine in a loop.
% S is not required for inverse distance
%
% KRIGING:
% INPUTS:
% x,y,z,res,radius :: as for inverse distance
% method = 'kriging'
% uselog :: as for inverse distance
% name :: as for inverse distance
% S :: Structure containing variogram information as output
% by the variogramfit function.
% useloc (OPTIONAL):: as for inverse distance
%
% OUTPUTS:
% xi :: the prediction locations in x
% yi :: the prediction locations in y
% zi :: the predicted result
% pcolor can be used to visualise. e.g. pcolor(xi,yi,zi); shading interp;
For variogram modelling, use SampleVarioGstat.m to create the experimental variogram. The excellent variogramfit by Wolfgram Schwanghart should be used to fit the experimental variogram. File ID: #25948.
Look at the readme for tips on kriging and inverse distance interpolation, and help InterpolationGstat and help SampleVarioGstat for correct usage.
NOTE:
This routine is intended to make it easy to perform kriging or inverse distance interpolation. It is not intended as a full interface to all the capabilities of gstat. As such only 2D ordinary kriging, inverse distance and experimental variogram modelling are supported, with only key parameters being offered as options.
Citation pour cette source
James Ramm (2024). Kriging and Inverse Distance Interpolation using GSTAT (https://www.mathworks.com/matlabcentral/fileexchange/31055-kriging-and-inverse-distance-interpolation-using-gstat), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
- Sciences > Geoscience > Geology >
Tags
Remerciements
Inspiré par : variogramfit
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
Version | Publié le | Notes de version | |
---|---|---|---|
1.1.0.0 | Fixed bugs in 'InterpolationGstat.m'
|
||
1.0.0.0 |