I have a point dataset which I'd like to Krige, ideally using an open-source software package. If possible, I'd also like to choose the semi-variogram model during the process to improve the estimation.
9 Answers
Depending on which Kriging type you want to apply, there are different packages to choose from:
The most common version is implemented for example in:
- GRASS - v.krige
- SAGA - Module: Ordinary Kriging
- HPGL - ordinary-kriging() (PDF page 12)
- gstat - krige
Simple Kriging uses the average of the entire data set while Ordinary Kriging uses a local average. Therefore, Simple Kriging can be less accurate, but it generally produces "smoother" results. It's implemented in:
- HPGL - simple_kriging() (PDF page 12)
- gstat krige
Universal Kriging allows for consideration of drift in data. Implementations are included in:
Other Kriging Types
GRASS v.krige also supports Block Kriging.
HPGL implements a big number of less known Kriging methods (check the manual for more information on those):
- Indicator Kriging (IK)
- Local Varying Mean Kriging (LVM Kriging)
- Simple CoKriging (Markov Models 1 & 2)
- Sequential Indicator Simulation (SIS)
- Corellogram Local Varying Mean SIS (CLVM SIS)
- Local Varying Mean SIS (LVM SIS)
- Sequential Gaussian Simulation (SGS)
- Truncated Gaussian Simulation (GTSIM) [in Python scripts collection]
SAGA offers different versions of both Ordinary and Universal Kriging.
Gstat krige additionally supports Block and Point Kriging.
-
1
-
2
It looks like there are a few options with GRASS GIS. Check out the GRASS Kriging Wiki page: http://grass.osgeo.org/wiki/Kriging
A Google Summer of Code project in 2009 produced V.krige: http://grass.osgeo.org/wiki/V.krige_GSoC_2009
The GPL gstat package should work by itself or interfaced with GRASS GIS. http://www.gstat.org/
Dylan Beaudette has a nice example of doing kriging with GRASS. http://casoilresource.lawr.ucdavis.edu/drupal/node/438 (His blog is full of great and interesting examples of using OpenSource GIS and statistical tools!)
The R-project has substantial number of spatial statistics software packages, but R has rather steep learning curve.
-
-
I've seen the "steep learning curve" comment thrown at R a few times- it just doesn't make sense to me. I was a year into my relationship with MATLAB when I discovered R. I found R so easy to learn that I gave MATLAB the one finger salute and promptly quit using it heavily.– SharpieAug 12, 2010 at 8:33
-
1i think it's because people rarely try to understand statistics, and because of that it has a steep learning curve syntax wise, there are rarely problems picking it up– dodobasAug 12, 2010 at 8:51
-
2I think syntax wise it is one of the easier languages to learn. What is an example of a statistical language that is easy to learn from the command line. I think people complain because it is not Excel. Aug 14, 2010 at 4:39
-
1It is step in comparison with a GUI based program. If you used Windows all your life, and GUI based programs, you will run when you see the command line look. The Excel comparison indeed make them run. But R is very simple to use if someone can show you the basic tricks. You must be prepared to learn new concepts like vectors, matrices, functions, loops, which in an Excel/Windows world does not exist. If you previously used Linux, it wouldn't be a step curve. Feb 1, 2013 at 12:27
If you are happy to read your raster into a numpy array (gdal can do this), then you could use the High Performance Geostatistics Library implementation from Python or C/C++.
HPGL implements the following algorithms:
- Simple Kriging (SK)
- Ordinary Kriging (OK)
- Indicator Kriging (IK)
- Local Varying Mean Kriging (LVM Kriging)
- Simple CoKriging (Markov Models 1 & 2)
- Sequential Indicator Simulation (SIS)
- Corellogram Local Varying Mean SIS (CLVM SIS)
- Local Varying Mean SIS (LVM SIS)
- Sequential Gaussian Simulation (SGS)
- Truncated Gaussian Simulation (GTSIM) [in Python scripts collection]
I haven't used it myself but have heard good things about it, especially with respect to speed.
Check this free book, it's about doing geostatistics in R, and contains some info on doing it in SAGA and GRASS as well. http://spatial-analyst.net/book/ http://spatial-analyst.net/book/sites/default/files/Hengl_2009_GEOSTATe2c1w.pdf
I remember using SAGA to do this a few years back for some flood modelling output. Open Source and well worth a look.
gvSIG (another free GIS) does allow kriging, using Sextante. This is basically the same as using SAGA, but gvSIG provides a more 'typical' (i.e. ESRI-like) gis experience.
You could try the Kriging model in Surfpack version 1.1 (I wrote it while I was still on the DAKOTA team), or the latest and greatest version which comes with the "stable" version of DAKOTA (Surfpack is a sub-package of DAKOTA), it does universal Kriging from the perspective of correlation functions rather than semi-variograms.
Recently a user, Joel Guerrero, compared it head to head against a bunch of other implementations and stated that "Always related to surfpack, we are comparing it to other implementations (including a commercial one), and so far it outperform all of them, to the point that sometimes is seems that is doing black magic"
GSLIB (Geostatistical Software Library) is top-notch file/command-driven software developed from Stanford University and released in the 1990s, with some maintenance last decade. The source code can be freely downloaded and compiled on Linux/Windows using a Fortran compiler. There are online resources and a book available.
Kriging is one of the software's strengths:
- 1, 2 or 3-D grid kriging, cross validation, jackknifing
- SK, OK, UK, kriging with external drift
- cokriging
- indicator kriging