 Constructor - Maple Help

Interpolation[Kriging]

 Constructor Calling Sequence Kriging(points, data) Parameters

 points - a list, Vector, listlist, Array, or Matrix containing the coordinates of the points corresponding to data values. If this is a listlist, each inner list must contain n entries, where n is the dimensionality of the data. If this is an Array or Matrix, then there must be n columns, with each row corresponding to one set of coordinates. If it is a plain list or a Vector, then the input points are 1-dimensional. data - a list, Array, or Matrix containing the data, which must be arranged in the same order as the corresponding coordinates appear in points Description

 • The Kriging command returns a Kriging object. See this help page for a general mathematical description of the Kriging process.
 • Input sample points must not contain duplicates. The presence of duplicate points can lead to unexpected results.
 • The following help pages describe the Kriging object and its methods further: Examples

 > $\mathrm{with}\left(\mathrm{Interpolation}\right):$

Specify some points and some data manually.

 > $\mathrm{points}≔\left[\left[0,0\right],\left[1,0\right],\left[3,0\right],\left[1,1\right],\left[2,1\right],\left[3,2\right],\left[0,3\right],\left[2,3\right]\right]$
 ${\mathrm{points}}{≔}\left[\left[{0}{,}{0}\right]{,}\left[{1}{,}{0}\right]{,}\left[{3}{,}{0}\right]{,}\left[{1}{,}{1}\right]{,}\left[{2}{,}{1}\right]{,}\left[{3}{,}{2}\right]{,}\left[{0}{,}{3}\right]{,}\left[{2}{,}{3}\right]\right]$ (1)
 > $\mathrm{data}≔\left[7.9,7.7,11.4,2.2,3.0,5.7,1.4,4.6\right]$
 ${\mathrm{data}}{≔}\left[{7.9}{,}{7.7}{,}{11.4}{,}{2.2}{,}{3.0}{,}{5.7}{,}{1.4}{,}{4.6}\right]$ (2)

We can visualize these points and data values as follows.

 > $\mathrm{ptp}≔\mathrm{plots}\left[\mathrm{pointplot3d}\right]\left(\left[\mathrm{seq}\left(\left[\mathrm{op}\left(\mathrm{points}\left[i\right]\right),\mathrm{data}\left[i\right]\right],i=1..\mathrm{nops}\left(\mathrm{points}\right)\right)\right]\right):$
 > $\mathrm{ptp}$ Create a Kriging object.

 > $k≔\mathrm{Kriging}\left(\mathrm{points},\mathrm{data}\right)$
 ${k}{≔}\left(\begin{array}{c}{Kriging intⅇrpolation obȷⅇct with 8 samplⅇ points}\\ {Variogram: Sphⅇrical\left(4.35,32.49,2.236067977\right)}\end{array}\right)$ (3)

This uses an estimate to set the variogram used. This is often useful if we do not have a model for the variogram, but if we do, we can set the variogram manually.

 > $\mathrm{SetVariogram}\left(k,\mathrm{Spherical}\left(1,40,4\right)\right)$
 $\left(\begin{array}{c}{Kriging intⅇrpolation obȷⅇct with 8 samplⅇ points}\\ {Variogram: Sphⅇrical\left(1,40,4\right)}\end{array}\right)$ (4)

If we evaluate $k$ at one of the input points, we get the corresponding value back.

 > $k\left(3,0\right)$
 ${11.4000000000000004}$ (5)

The value at other points is interpolated.

 > $k\left(2,0\right)$
 ${7.96736181702214896}$ (6)

We can visualize the interpolated surface as follows; or we can include the data points, too.

 > $\mathrm{pk}≔\mathrm{plot3d}\left(k\left(x,y\right),x=0..3,y=0..3\right):$
 > $\mathrm{pk}$ > $\mathrm{plots}:-\mathrm{display}\left(\mathrm{ptp},\mathrm{pk}\right)$ We can also find out what the modeled variance is at various points.

 > $k\left(3,0,\mathrm{output}=\mathrm{variance}\right)$
 ${0.}$ (7)
 > $k\left(2,0,\mathrm{output}=\mathrm{variance}\right)$
 ${14.8894610336107771}$ (8)

We can also display this variance, or use the variance to color the visualization of the interpolated surface.

 > $\mathrm{plot3d}\left(k\left(x,y,\mathrm{output}=\mathrm{variance}\right),x=0..3,y=0..3\right)$ > $\mathrm{pk2}≔\mathrm{plot3d}\left(k\left(x,y\right),x=0..3,y=0..3,\mathrm{color}=\left[\frac{k\left(x,y,\mathrm{output}=\mathrm{variance}\right)}{25},0.8,0.8,\mathrm{colortype}=\mathrm{HSV}\right]\right):$
 > $\mathrm{plots}:-\mathrm{display}\left(\mathrm{ptp},\mathrm{pk2}\right)$ Maple also contains functionality for generating data that is spatially correlated according to a given variogram.

 > $\mathrm{points},\mathrm{data}≔\mathrm{Kriging}\left[\mathrm{GenerateSpatialData}\right]\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}$ (9)

Create a Kriging object:

 > $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.25259453854482,13.6487615617247,.5525536774\right)}\end{array}\right)$ (10)

Use the Kriging object to interpolate at a given point:

 > $k\left(0.2,0.3\right)$
 ${-2.75173577049670337}$ (11) Compatibility

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