DisplayVariogram - Maple Help

Interpolation[Kriging]

 DisplayVariogram
 display the empirical variogram of the data from a Kriging object

 Calling Sequence DisplayVariogram(k, options)

Parameters

 k - a Kriging object options - (optional) keyword options of the form output=format, bounds=b, and/or variogram=m

Description

 • The DisplayVariogram command can be used to produce different visualizations of the empirical variogram for a given set of data; that is, the set of distances between pairs of points and the associated absolute differences in value.
 • By default, every pair of data points has its distance and absolute difference in values calculated, and each [distance, difference] pair is plotted, together with the curve of the selected variogram.
 • You can specify a different type of output using the keyword option output = format:
 – If format is pointplot, the default output described above is selected.
 – If format is points, then a list of the [distance, difference] pairs corresponding to each pair of points will be returned instead of a plot of those points.
 – If format is smoothed, then the curve given by the set of [distance, difference] pairs is smoothed by the Lowess algorithm (with bandwidth=1/3), then plotted in the relevant range.
 – If format is groupedpoints, then the set of [distance, difference] pairs is sorted in order of increasing distance, split into subsets of size 10, and each subset has its average distance and absolute difference in values calculated and plotted.
 – If format is lists, then the sequence distances, differences will be returned instead of a plot, where distances is a list of point distances and differences is a list of absolute differences in value. distances[i] corresponds to differences[i], but otherwise the lists are in no particular order.
 – If format is violinplots then the data is grouped and a set of violin plots are plotted.
 – If format is bins then the data is grouped and a list of matrices is returned. The first column of each matrix corresponds to the distances falling in that bin, and the second column holds the distances.
 By default, ten bins of equal width are used. Other options can be used by specifying the bounds option as described below.  These are the same options available in the SplitByColumn command, except with a different default value, and the value none is not allowed. (The bounds option has no effect if format = bins is not specified.)
 • $\mathrm{bounds}=n$ for a positive integer n means values from the set of distances will be divided into n bins of equal width. The default value for bounds is bounds = 10.
 • $\mathrm{bounds}=\left[\mathrm{b0},\mathrm{b1},\mathrm{...},\mathrm{bn}\right]$ means values from the set of distances will be divided into $n$ bins: from $\mathrm{b0}$ to $\mathrm{b1}$, from $\mathrm{b1}$ to $\mathrm{b2}$, etc. Values less than $\mathrm{b0}$ or greater than $\mathrm{bn}$, and the rows containing them, are discarded.
 These intervals are closed on the left and open on the right; that is, if the exact value $\mathrm{b1}$ occurs in the data, then that row goes into the second matrix, not the first one. The rightmost bin is an exception: it represents an interval closed on both sides.
 Instead of using a list $\left[\mathrm{b0},\mathrm{b1},\mathrm{...},\mathrm{bn}\right]$, you can also use a Vector with the same entries. This has the same effect.
 • $\mathrm{bounds}=\mathrm{quantiles}\left(\mathrm{q0},\mathrm{q1},\mathrm{...},\mathrm{qn}\right)$ or $\mathrm{bounds}=\mathrm{deciles}\left(\mathrm{d0},\mathrm{d1},\mathrm{...},\mathrm{dn}\right)$ or $\mathrm{bounds}=\mathrm{percentiles}\left(\mathrm{p0},\mathrm{p1},\mathrm{...},\mathrm{pn}\right)$ or $\mathrm{bounds}=\mathrm{quartiles}\left(\mathrm{q0},\mathrm{q1},\mathrm{...},\mathrm{qn}\right)$ are equivalent ways of specifying bins similar to specifying a list, but instead of specifying absolute numbers for the bounds, you specify which fraction of the data should fall in each of the bins.
 For example, specifying $\mathrm{bounds}=\mathrm{percentiles}\left(0,25,60,90\right)$ specifies three bins, the first of which contains the lowest 25% of data, then then next 60% - 25% = 35% of data, and finally the following 90% - 60% = 30% of data. That is, the bounds are at the 0th, 25th, 60th, and 90th Percentile of the data in the set of distances. This could also be specified as $\mathrm{bounds}=\mathrm{quantiles}\left(0,0.25,0.6,0.9\right)$ using the notion of Quantile instead of Percentile, or $\mathrm{bounds}=\mathrm{deciles}\left(0,2.5,6,9\right)$ using Deciles, or $\mathrm{bounds}=\mathrm{quartiles}\left(0,1,2.4,3.6\right)$ using Quartiles.
 • By default, the variogram used is the one set in the Kriging object. If the variogram = m option is set, then this is overridden and the variogram m is used instead. If the model is specified but the parameters are not given, then the parameters will be automatically set to the result of FitVariogramParameters.
 • The variogram option is ignored if output is lists or points.

Examples

 > $\mathrm{points},\mathrm{data}≔\mathrm{Interpolation}:-\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.814723686393179}& {0.706046088019609}\\ {0.905791937075619}& {0.0318328463774207}\\ {0.126986816293506}& {0.276922984960890}\\ {0.913375856139019}& {0.0461713906311539}\\ {0.632359246225410}& {0.0971317812358475}\\ {0.0975404049994095}& {0.823457828327293}\\ {0.278498218867048}& {0.694828622975817}\\ {0.546881519204984}& {0.317099480060861}\\ {0.957506835434298}& {0.950222048838355}\\ {0.964888535199277}& {0.0344460805029088}\\ {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{30 × 2 Matrix}}\end{array}{,}\begin{array}{c}\left[\begin{array}{c}{-1.31317888309841}\\ {3.78399452938781}\\ {-4.07906747556730}\\ {2.81033657021080}\\ {3.07159908082332}\\ {0.128958765233144}\\ {-3.21737272238246}\\ {0.707245165710619}\\ {0.0877877303791926}\\ {0.937296621856498}\\ {⋮}\end{array}\right]\\ \hfill {\text{30 element Vector[column]}}\end{array}$ (1)
 > $k≔\mathrm{Interpolation}:-\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.25259453854482,13.6487615617247,.5525536774\right)}\end{array}\right)$ (2)
 > $\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{DisplayVariogram}\left(k\right)$
 > $\mathrm{DisplayVariogram}\left(k,\mathrm{output}=':-\mathrm{smoothed}'\right)$
 > $\mathrm{DisplayVariogram}\left(k,\mathrm{output}=':-\mathrm{groupedpoints}'\right)$
 > $\mathrm{DisplayVariogram}\left(k,\mathrm{output}=':-\mathrm{violinplots}'\right)$

If the points are in a grid, as is the case when we use the grid option to GenerateSpatialData, then the distances between points will have clearly visible patterns in them.

 > $\mathrm{points},\mathrm{data}≔\mathrm{Interpolation}:-\mathrm{Kriging}:-\mathrm{GenerateSpatialData}\left(\mathrm{Wave}\left(0,10,2\right),\mathrm{grid},\mathrm{dimension}=3\right)$
 ${\mathrm{points}}{,}{\mathrm{data}}{≔}\begin{array}{c}\left[\begin{array}{ccc}{0.}& {0.}& {0.}\\ {0.500000000000000}& {0.}& {0.}\\ {1.}& {0.}& {0.}\\ {1.}& {0.500000000000000}& {0.}\\ {0.500000000000000}& {0.500000000000000}& {0.}\\ {0.}& {0.500000000000000}& {0.}\\ {0.}& {1.}& {0.}\\ {0.500000000000000}& {1.}& {0.}\\ {1.}& {1.}& {0.}\\ {1.}& {1.}& {0.500000000000000}\\ {⋮}& {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{27 × 3 Matrix}}\end{array}{,}\begin{array}{c}\left[\begin{array}{c}{8.26542925022924}\\ {1.71211685528736}\\ {-0.892655380227703}\\ {-0.764651791223923}\\ {1.20726674793761}\\ {6.28239590695811}\\ {3.14394183965808}\\ {-5.16321963113363}\\ {-4.10963176417732}\\ {4.32003414625718}\\ {⋮}\end{array}\right]\\ \hfill {\text{27 element Vector[column]}}\end{array}$ (4)
 > $k≔\mathrm{Interpolation}:-\mathrm{Kriging}\left(\mathrm{points},\mathrm{data}\right)$
 ${k}{≔}\left(\begin{array}{c}{Kriging intⅇrpolation obȷⅇct with 27 samplⅇ points}\\ {Variogram: Sphⅇrical\left(3.10794971558648,40.9936480954218,1.\right)}\end{array}\right)$ (5)
 > $\mathrm{SetVariogram}\left(k,\mathrm{Wave}\left(0,10,2\right)\right)$
 $\left(\begin{array}{c}{Kriging intⅇrpolation obȷⅇct with 27 samplⅇ points}\\ {Variogram: Wavⅇ\left(0,10,2\right)}\end{array}\right)$ (6)
 > $\mathrm{DisplayVariogram}\left(k\right)$
 > $\mathrm{DisplayVariogram}\left(k,\mathrm{output}=':-\mathrm{smoothed}'\right)$
 > $\mathrm{DisplayVariogram}\left(k,\mathrm{output}=':-\mathrm{groupedpoints}'\right)$
 > $\mathrm{DisplayVariogram}\left(k,\mathrm{output}=':-\mathrm{violinplots}'\right)$

Compatibility

 • The Interpolation[Kriging][DisplayVariogram] command was introduced in Maple 2018.
 • For more information on Maple 2018 changes, see Updates in Maple 2018.