 SetVariogram - Maple Help

Interpolation[Kriging]

 SetVariogram
 set the variogram of the Kriging object Calling Sequence SetVariogram(k, var) Parameters

 k - a Kriging object var - a variogram, specified by name (Spherical, Exponential, Gaussian, Wave, RationalQuadratic or Circular) or as a function call with three positive numerical arguments Description

 • The SetVariogram command sets the variogram associated with the given Kriging object.
 • This variogram is used in the Kriging interpolation process to determine the weights for various points. For example, it is used when you interpolate at a given point. The variogram gives the variance of the difference between field values at two locations at a given distance.
 • If the variogram is specified as a name only, then the parameters will be estimated by the FitVariogramParameters command.
 • A Kriging object by default has its variogram set to the Spherical model with parameters determined by FitVariogramParameters, and it will keep this default until SetVariogram is called.
 • The variogram has three parameters: the nugget, sill, and range.
 – The nugget is the limit of the variogram as the distance approaches zero, and corresponds to a base level of uncertainty and variation. The nugget must be nonnegative.
 – The sill is the maximum variance achieved for any distance. The sill must be greater than or equal to the nugget; so in particular, it must be nonnegative.
 – The (effective) range is the distance at which the variogram reaches 95% of the sill, or for some variograms, the distance where the sill is reached. More precisely, it is a distance $a$ so that if $a\le h$, then $\mathrm{\gamma }\left(h\right)$ deviates from the sill by less than 5%. Points at a distance greater than the range are not used to compute interpolated values. The range must be positive. Examples

The available variogram models are as follows. Each is a family of functions of $h$, the distance, with parameters $\mathrm{c__n}$, $\mathrm{c__s}$, and $a$ corresponding to the nugget, sill, and range, respectively. After defining each variogram model, you see a graph of the variogram with parameters $\mathrm{c__n}=0.5$, $\mathrm{c__s}=5$, and $a=4$, displayed for $h$ from 0 to 6. Dashed lines indicate the nugget, sill, and range, and a gray rectangle indicates the bounds between which the variogram is guaranteed to lie at distances greater than the range. After this graph, you see a heat map of a sample generated with GenerateSpatialData according to the same variogram over a square with sides of length 6.

The $\mathrm{Spherical}\left(\mathrm{c__n},\mathrm{c__s},a\right)$ model has the following equation.

$\mathrm{\gamma }\left(h\right)=\left\{\begin{array}{cc}\mathrm{c__n}+\left(\mathrm{c__s}-\mathrm{c__n}\right)\left(\frac{3h}{2a}-\frac{{h}^{3}}{2{a}^{3}}\right)& h\le a\\ \mathrm{c__s}& \mathrm{otherwise}\end{array}\right\$ > $\mathrm{heatmap}$ The $\mathrm{Exponential}\left(\mathrm{c__n},\mathrm{c__s},a\right)$ model has the following equation.

$\mathrm{\gamma }\left(h\right)=\mathrm{c__n}+\left(\mathrm{c__s}-\mathrm{c__n}\right)\left(1-{ⅇ}^{-\frac{3h}{a}}\right)$ > $\mathrm{heatmap}$ The $\mathrm{Gaussian}\left(\mathrm{c__n},\mathrm{c__s},a\right)$ model has the following equation.

$\mathrm{\gamma }\left(h\right)=\mathrm{c__n}+\left(\mathrm{c__s}-\mathrm{c__n}\right)\left(1-{ⅇ}^{-\frac{3{h}^{2}}{{a}^{2}}}\right)$ > $\mathrm{heatmap}$ The $\mathrm{Wave}\left(\mathrm{c__n},\mathrm{c__s},a\right)$ model has the following equation.

$\mathrm{\gamma }\left(h\right)=\mathrm{c__n}+\left(\mathrm{c__s}-\mathrm{c__n}\right)\left(1-\frac{\mathrm{sin}\left(\frac{20h}{a}\right)a}{20h}\right)$ > $\mathrm{heatmap}$ The $\mathrm{RationalQuadratic}\left(\mathrm{c__n},\mathrm{c__s},a\right)$ model has the following equation.

$\mathrm{\gamma }\left(h\right)=\mathrm{c__n}+\frac{19\left(\mathrm{c__s}-\mathrm{c__n}\right){h}^{2}}{{a}^{2}\left(1+\frac{19{h}^{2}}{{a}^{2}}\right)}$ > $\mathrm{heatmap}$ The $\mathrm{Circular}\left(\mathrm{c__n},\mathrm{c__s},a\right)$ model has the following equation.

$\mathrm{\gamma }\left(h\right)=\left\{\begin{array}{cc}\mathrm{c__n}+\left(\mathrm{c__s}-\mathrm{c__n}\right)\left(1-\frac{2\mathrm{arccos}\left(\frac{h}{a}\right)}{\mathrm{\pi }}+\frac{2h\sqrt{1-\frac{{h}^{2}}{{a}^{2}}}}{\mathrm{\pi }a}\right)& h > $\mathrm{heatmap}$ > $\mathrm{with}\left(\mathrm{Interpolation}\right):$

We generate some values that have the specified variogram.

 > $\mathrm{points},\mathrm{data}≔\mathrm{Kriging}:-\mathrm{GenerateSpatialData}\left(\mathrm{Spherical}\left(1,10,1\right)\right)$
 ${\mathrm{points}}{,}{\mathrm{data}}{≔}\begin{array}{c}\left[\begin{array}{cc}{0.000708423343318998}& {0.110381199808607}\\ {0.671951628775546}& {0.473089845292611}\\ {0.299811429777143}& {0.678738644452139}\\ {0.998724199710475}& {0.576885934616121}\\ {0.985961174167959}& {0.591712054655430}\\ {0.922852193582620}& {0.452796871692237}\\ {0.524658213342072}& {0.339012774839588}\\ {0.823740713775947}& {0.0644678229844171}\\ {0.754322703506438}& {0.0763155889148138}\\ {0.139453549258317}& {0.175785369268051}\\ {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{30 × 2 Matrix}}\end{array}{,}\begin{array}{c}\left[\begin{array}{c}{-1.23263629099854}\\ {-0.214521966304383}\\ {3.49559026889199}\\ {0.897397912601766}\\ {2.31151267570559}\\ {1.02548508463270}\\ {-3.14226902569686}\\ {-0.669699027951622}\\ {-1.88884560928795}\\ {-4.61706390779939}\\ {⋮}\end{array}\right]\\ \hfill {\text{30 element Vector[column]}}\end{array}$ (1)
 > $k≔\mathrm{Kriging}\left(\mathrm{points},\mathrm{data}\right)$
 ${k}{≔}\left(\begin{array}{c}{Kriging intⅇrpolation obȷⅇct with 30 samplⅇ points}\\ {Variogram: Sphⅇrical\left(1.94850490681899,21.5388709430198,.52789833\right)}\end{array}\right)$ (2)

Setting the variogram explicitly is not required, as a variogram with estimated parameters is set by default. However, it leads to better results if the correct variogram is set.

 > $\mathrm{SetVariogram}\left(k,\mathrm{Spherical}\left(1,10,1\right)\right)$
 $\left(\begin{array}{c}{Kriging intⅇrpolation obȷⅇct with 30 samplⅇ points}\\ {Variogram: Sphⅇrical\left(1,10,1\right)}\end{array}\right)$ (3)
 > $\mathrm{ComputeGrid}\left(k,\left[0..1,0..1\right],0.1,\mathrm{output}=\mathrm{plot}\right)$  Compatibility

 • The Interpolation[Kriging][SetVariogram] command was introduced in Maple 2018.