Kriging procedure call - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Interpolation[Kriging]

  

procedure_call

  

use the Kriging process to predict the value at one or more points

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

k(coordinates)

k(coordinates, outopt)

Parameters

k

-

a Kriging object

coordinates

-

sequence specifying the coordinates of the point at which the value will be predicted, or a Matrix where each row specifies the coordinates of one point

outopt

-

(optional) keyword option of the form output=format

Description

• 

A Kriging object can be used in a function call. Used in this way, the function call makes use of the data stored in the Kriging object to predict the value at the point of the given coordinates.

• 

The variogram set in the Kriging object is used to carry out the prediction. This can be set by using the SetVariogram procedure.

• 

By default, the predicted value is returned. This is equivalent to the behavior if output=value. If output=variance then the variance associated with the predicted value is returned, which can be used as a measure of the uncertainty in the prediction. If output=both, then the sequence val, var is returned, where val is the predicted value and var is the associated variance.

• 

coordinates can be an m-by-n dimensional matrix, where n is the dimensionality of the point data stored in the Kriging object. Each of the m rows is treated as the coordinates of a point where the Kriging interpolation will be performed. If output=both then an m-by-2 matrix will be returned, with the first column corresponding to the predicted values and the second column corresponding to the variances. Otherwise, a column vector will be returned containing either the predicted values or variances as specified.

Examples

> 

with⁡Interpolation:

We generate some data points according to the Spherical⁡1,10,1 variogram.

> 

points,data≔Kriging:-GenerateSpatialData⁡Spherical⁡1,10,1

points,data≔0.8147236863931790.7060460880196090.9057919370756190.03183284637742070.1269868162935060.2769229849608900.9133758561390190.04617139063115390.6323592462254100.09713178123584750.09754040499940950.8234578283272930.2784982188670480.6948286229758170.5468815192049840.3170994800608610.9575068354342980.9502220488383550.9648885351992770.0344460805029088⋮⋮30 × 2 Matrix,−1.313178883098403.78399452938772−4.079067475567432.810336570210773.071599080823360.128958765233152−3.217372722382440.7072451657106540.08778773037919770.937296621856632⋮30 element Vector[column]

(1)

The next step is to create the Kriging object.

> 

k≔Kriging⁡points,data

k≔Krⅈgⅈng ⅈntⅇrpolatⅈon obȷⅇct wⅈth 30 samplⅇ poⅈntsVarⅈogram: Sphⅇrⅈcal(1.25259453854473,13.6487615617241,.5525536774)

(2)

We can use this object as is with a variogram estimated purely from the data, but we should expect to get better results if we set the variogram that we know underlies these data.

> 

SetVariogram⁡k,Spherical⁡1,10,1

Krⅈgⅈng ⅈntⅇrpolatⅈon obȷⅇct wⅈth 30 samplⅇ poⅈntsVarⅈogram: Sphⅇrⅈcal(1,10,1)

(3)

We can now find the interpolated value for any point, and the variance at such points, as well.

> 

k⁡0.2,0.3

−2.65388575588639997

(4)
> 

k⁡0.2,0.3,output=variance

2.46857252864955568

(5)
> 

k⁡0.2,0.3,output=both

−2.65388575588639997,2.46857252864955568

(6)

Like any function of two variables, you can plot the interpolated surface with the plot3d command. One can also plot the variance.

> 

plot3d⁡k⁡x,y,x=0..1,y=0..1

> 

plot3d⁡k,0..1,0..1

> 

plot3d⁡k⁡x,y,output=variance,x=0..1,y=0..1

You can even plot the interpolated surface, and use the color to indicate the variance.

> 

plot3d⁡k⁡x,y,x=0..1,y=0..1,color=k⁡x,y,output=variance5,0.8,0.8,colortype=HSV

You can also approximate the area under the surface using numerical integration.

> 

int⁡k,0..1,0..1,numeric,ε=0.1,method=_CubaCuhre

−0.915288153662587

(7)

Compatibility

• 

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

• 

For more information on Maple 2018 changes, see Updates in Maple 2018.

See Also

ComputeGrid

Constructor

Kriging

SetVariogram