{"id":726,"date":"2022-04-01T11:24:02","date_gmt":"2022-04-01T11:24:02","guid":{"rendered":"https:\/\/ml-gis-service.com\/?p=726"},"modified":"2022-04-01T11:24:02","modified_gmt":"2022-04-01T11:24:02","slug":"geostatistics-theoretical-variogram-models","status":"publish","type":"post","link":"https:\/\/ml-gis-service.com\/index.php\/2022\/04\/01\/geostatistics-theoretical-variogram-models\/","title":{"rendered":"Geostatistics: Theoretical Variogram Models"},"content":{"rendered":"\n<p>Kriging is a technique of spatial interpolation that uses the dissimilarity measure between observations to interpolate values at missing locations. This &#8220;dissimilarity measure&#8221; is a semivariogram. And semivariogram is a mathematical function, or more visually, a curve that shows how dissimilar (variance) are points with each other with the rising distance. The Image represents this concept:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/2-1024x576.png\" alt=\"\" class=\"wp-image-759\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/2-1024x576.png 1024w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/2-300x169.png 300w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/2-768x432.png 768w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/2-1536x864.png 1536w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/2.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>From points to variogram. Check squared differences between points within each radius and build variogram, where $\\gamma$ parameter is semivariance and x axis describes distance.<\/figcaption><\/figure>\n\n\n\n<p>Semivariogram has three basic properties:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>nugget:<\/strong> the initial value at a zero distance, in most cases, it is zero, but sometimes it represents a bias in observations.<\/li><li><strong>sill:<\/strong> the point where semivariogram flattens and reaches approximately 95% of dissimilarity. Sometimes we cannot find a sill; for example, if differences grow exponentially,<\/li><li><strong>range:<\/strong> is a distance where a variogram reaches its sill. Larger distances are negligible for interpolation.<\/li><\/ul>\n\n\n\n<p>The crucial step performed by a geostatistican is to choose a valid variogram model for interpolation. The most important are initial distances, before the variogram reaches its sill. That&#8217;s why it is good to inspect all available models visually. In this article, we will take a look into different kinds of theoretical models used to analysis of a quasi-random surface generated with a logistic map and blurred with a mean filter:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"576\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/surface.png\" alt=\"\" class=\"wp-image-760\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/surface.png 583w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/surface-300x296.png 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><figcaption>Quasi-random surface generated with logistic map and blurred with a mean filter.<\/figcaption><\/figure><\/div>\n\n\n\n<p>This surface has some large-scale patterns and noise. For the analysis purpose, we will take a look into the omnidirectional variogram of this dataset:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"874\" height=\"357\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/experimental.png\" alt=\"\" class=\"wp-image-762\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/experimental.png 874w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/experimental-300x123.png 300w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/experimental-768x314.png 768w\" sizes=\"auto, (max-width: 874px) 100vw, 874px\" \/><figcaption>Experimental variogram of generated surface.<\/figcaption><\/figure><\/div>\n\n\n\n<p>The range and sill of the variogram are not random. The surface was blurred with a mean filter of size 7&#215;7, and we see here that the similarity is close to 7 units of distance. Based on it, we can set properties for a theoretical variogram for:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>nugget: 0<\/li><li>sill: 1.3<\/li><li>range: 7<\/li><\/ul>\n\n\n\n<p>Now, we can take a look at different theoretical models. All models were generated with the <a href=\"https:\/\/pypi.org\/project\/pyinterpolate\/\">Pyinterpolate<\/a> package.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Circular Model<\/h2>\n\n\n\n<p>(1) $\\gamma = c0 + c[1 &#8211; (\\frac{2}{\\pi} * arccos(\\frac{a}{h})) + (\\frac{2}{\\pi} * \\frac{a}{h}) * \\sqrt{1 &#8211; (\\frac{a}{h})^{2}}]$, $0 &lt; a &lt;= h$;<\/p>\n\n\n\n<p>(2) $\\gamma = c0 + c$, $a &gt; h$;<\/p>\n\n\n\n<p>(3) $\\gamma = 0$, $a = 0$.<\/p>\n\n\n\n<p>where:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>$\\gamma$ &#8211; semivariance,<\/li><li>$c0$ &#8211; nugget,<\/li><li>$c$ &#8211; sill,<\/li><li>$a$ &#8211; lag,<\/li><li>$h$ &#8211; range.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"371\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/circular.png\" alt=\"\" class=\"wp-image-763\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/circular.png 888w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/circular-300x125.png 300w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/circular-768x321.png 768w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><figcaption>Circular model. Looks promising.<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Cubic Model<\/h2>\n\n\n\n<p>(1) $\\gamma = c0 + c * (7 * (\\frac{a}{h})^{2} &#8211; 8.75 * (\\frac{a}{h})^{3} + 3.5 * (\\frac{a}{h})^{5} &#8211; 0.75 * (\\frac{a}{h})^{7})$, $0 &lt; a &lt;= h$;<\/p>\n\n\n\n<p>(2) $\\gamma = c0 + c$, $a &gt; h$;<\/p>\n\n\n\n<p>(3) $\\gamma = 0$, $a = 0$.<\/p>\n\n\n\n<p>where:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>$\\gamma$ &#8211; semivariance,<\/li><li>$c0$ &#8211; nugget,<\/li><li>$c$ &#8211; sill,<\/li><li>$a$ &#8211; lag,<\/li><li>$h$ &#8211; range.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"371\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/cubic.png\" alt=\"\" class=\"wp-image-764\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/cubic.png 888w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/cubic-300x125.png 300w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/cubic-768x321.png 768w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><figcaption>Cubic model. Rather ominous, it reaches sill too fast.<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Exponential Model<\/h2>\n\n\n\n<p>(1) $\\gamma = c0 + c * (1 &#8211; \\exp({-\\frac{a}{h}}))$, $a &gt; 0$,<\/p>\n\n\n\n<p>(2) $\\gamma = 0$, $a = 0$.<\/p>\n\n\n\n<p>where:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>$\\gamma$ &#8211; semivariance,<\/li><li>$c0$ &#8211; nugget,<\/li><li>$c$ &#8211; sill,<\/li><li>$a$ &#8211; lag,<\/li><li>$h$ &#8211; range.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"371\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/expo.png\" alt=\"\" class=\"wp-image-765\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/expo.png 888w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/expo-300x125.png 300w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/expo-768x321.png 768w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><figcaption>Exponential model. Very bad, it underestimates differences, and it is unbounded.<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Gaussian Model<\/h2>\n\n\n\n<p>(1) $\\gamma = c0 + c * (1 &#8211; \\exp(-\\frac{a^{2}}{h^{2}}))$, $a &gt; 0$<\/p>\n\n\n\n<p>(2) $\\gamma = 0$, $a = 0$.<\/p>\n\n\n\n<p>where:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>$\\gamma$ &#8211; semivariance,<\/li><li>$c0$ &#8211; nugget,<\/li><li>$c$ &#8211; sill,<\/li><li>$a$ &#8211; lag,<\/li><li>$h$ &#8211; range.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"371\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/gauss.png\" alt=\"\" class=\"wp-image-766\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/gauss.png 888w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/gauss-300x125.png 300w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/gauss-768x321.png 768w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><figcaption>Gaussian model. Similar to exponential near the origin, it makes it not reliable for our case.<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Linear Model<\/h2>\n\n\n\n<p>(1) $\\gamma = c0 + c * \\frac{a}{h}$, $0 &lt; a &lt;= h$;<\/p>\n\n\n\n<p>(2) $\\gamma = c0 + c$, $a &gt; h$;<\/p>\n\n\n\n<p>(3) $\\gamma = 0$, $a = 0$.<\/p>\n\n\n\n<p>where:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>$\\gamma$ &#8211; semivariance,<\/li><li>$c0$ &#8211; nugget,<\/li><li>$c$ &#8211; sill,<\/li><li>$a$ &#8211; lag,<\/li><li>$h$ &#8211; range.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"371\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/linear.png\" alt=\"\" class=\"wp-image-767\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/linear.png 888w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/linear-300x125.png 300w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/linear-768x321.png 768w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><figcaption>Linear model. Probably the best for our case.<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Power Model<\/h2>\n\n\n\n<p>(1) $\\gamma = c0 + c * (\\frac{a}{h})^{2}$, $0 &lt; a &lt;= h$;<\/p>\n\n\n\n<p>(2) $\\gamma = c0 + c$, $a &gt; h$;<\/p>\n\n\n\n<p>(3) $\\gamma = 0$, $a = 0$.<\/p>\n\n\n\n<p>where:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>$\\gamma$ &#8211; semivariance,<\/li><li>$c0$ &#8211; nugget,<\/li><li>$c$ &#8211; sill,<\/li><li>$a$ &#8211; lag,<\/li><li>$h$ &#8211; range.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"371\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/power.png\" alt=\"\" class=\"wp-image-768\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/power.png 888w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/power-300x125.png 300w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/power-768x321.png 768w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><figcaption>Power model. Terrible at the point of origin, but rather not useful.<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Spherical Model<\/h2>\n\n\n\n<p>(1) $\\gamma = c0 + c * ( \\frac{3}{2} * \\frac{a}{h} &#8211; 0.5 * (\\frac{a}{h})^{3} )$, $0 &lt; a &lt;= h$;<\/p>\n\n\n\n<p>(2) $\\gamma = c0 + c$, $a &gt; h$;<\/p>\n\n\n\n<p>(3) $\\gamma = 0$, $a = 0$.<\/p>\n\n\n\n<p>where:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>$\\gamma$ &#8211; semivariance,<\/li><li>$c0$ &#8211; nugget,<\/li><li>$c$ &#8211; sill,<\/li><li>$a$ &#8211; lag,<\/li><li>$h$ &#8211; range.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"371\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/sph.png\" alt=\"\" class=\"wp-image-769\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/sph.png 888w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/sph-300x125.png 300w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/sph-768x321.png 768w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><figcaption>Spherical model. Not bad, but not good.<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Comparison of multiple models<\/h2>\n\n\n\n<p>The best idea is to compare multiple models with the experimental points:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"435\" src=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/all-1024x435.png\" alt=\"\" class=\"wp-image-770\" srcset=\"https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/all-1024x435.png 1024w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/all-300x128.png 300w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/all-768x326.png 768w, https:\/\/ml-gis-service.com\/wp-content\/uploads\/2022\/04\/all.png 1167w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Multiple variogram models.<\/figcaption><\/figure><\/div>\n\n\n\n<p>This comparison clearly shows that the linear and circular models are the best in our case. We should be aware that &#8220;automatic fitting&#8221; of the best model may return a model that best fits long-distance (semi)variances (for example, lags 10-18) and works poorly for short-range values. It is a huuuge mistake! We should always minimize the error of the first few lags because those distances are most similar, and they describe a correlation between points!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bibliography<\/h2>\n\n\n\n<p>Want to learn more? Use those resources:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Webster, R., Oliver, M.A. Geostatistics for environmental scientist (2nd ed.). ISBN: 978-0-470-02858-2. Wiley 2007.<\/li><li>Oliver, M.A., Webster, R. Basic steps in geostatistics: the variogram and Kriging. ISBN: 978-3-319-15865-5. Springer 2015.<\/li><li>Armstrong, M. Basic Linear Geostatistics. ISBN: 978-3-642-58727-6. Springer 1998.<\/li><li>McBratney, A. B., Webster R. Choosing Functions for Semivariograms of Soil Properties and Fitting Them to Sampling Estimates. Journal of Soil Science 37: 617\u2013639. 1986.<\/li><li>Moli\u0144ski, S., (2022). Pyinterpolate: Spatial interpolation in Python for point measurements and aggregated datasets. Journal of Open Source Software, 7(70), 2869, https:\/\/doi.org\/10.21105\/joss.02869<\/li><\/ul>\n\n\n\n<p>Want to experiment by yourself? Use this package:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>https:\/\/pypi.org\/project\/pyinterpolate\/<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Comparison of different semivariogram models<\/p>\n","protected":false},"author":1,"featured_media":758,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,170,66,30],"tags":[108,171,33,172,152],"class_list":["post-726","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-science","category-geocomputation","category-pyinterpolate","category-spatial-statistics","tag-kriging","tag-semivariogram","tag-spatial-interpolation","tag-theoretical-semivariogram","tag-variogram"],"_links":{"self":[{"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/posts\/726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/comments?post=726"}],"version-history":[{"count":21,"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/posts\/726\/revisions"}],"predecessor-version":[{"id":773,"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/posts\/726\/revisions\/773"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/media\/758"}],"wp:attachment":[{"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/media?parent=726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/categories?post=726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ml-gis-service.com\/index.php\/wp-json\/wp\/v2\/tags?post=726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}