naginterfaces.library.interp.dimn_​scat_​shep

naginterfaces.library.interp.dimn_scat_shep(x, f, nw=- 1, nq=- 1)[source]

dimn_scat_shep generates a multidimensional interpolant to a set of scattered data points, using a modified Shepard method. When the number of dimensions is no more than five, there are corresponding functions in submodule interp which are specific to the given dimensionality. dim2_scat_shep() generates the two-dimensional interpolant, while dim3_scat_shep(), dim4_scat_shep() and dim5_scat_shep() generate the three-, four - and five-dimensional interpolants respectively.

For full information please refer to the NAG Library document for e01zm

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/e01/e01zmf.html

Parameters
xfloat, array-like, shape

The components of the first data point must be stored in elements of . The second data point must be stored in elements of , and so on. In general, the data points must be stored in , for , for .

ffloat, array-like, shape

must be set to the data value , for .

nwint, optional

The number of data points that determines each radius of influence , appearing in the definition of each of the weights , for (see Notes). Note that is different for each weight. If the default value is used instead.

nqint, optional

The number of data points to be used in the least squares fit for coefficients defining the quadratic functions (see Notes). If the default value is used instead.

Returns
iqint, ndarray, shape

Integer data defining the interpolant .

rqfloat, ndarray, shape

Real data defining the interpolant .

Raises
NagValueError
(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: or .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, exceeds the largest machine integer.

and .

(errno )

On entry, .

Constraint: .

(errno )

There are duplicate nodes in the dataset. , for , and . The interpolant cannot be derived.

(errno )

On entry, all the data points lie on the same hypersurface. No unique solution exists.

Notes

dimn_scat_shep constructs a smooth function , which interpolates a set of scattered data points , for , using a modification of Shepard’s method. The surface is continuous and has continuous first partial derivatives.

The basic Shepard method, which is a generalization of the two-dimensional method described in Shepard (1968), interpolates the input data with the weighted mean

where , .

The basic method is global in that the interpolated value at any point depends on all the data, but dimn_scat_shep uses a modification (see Franke and Nielson (1980) and Renka (1988a)), whereby the method becomes local by adjusting each to be zero outside a hypersphere with centre and some radius . Also, to improve the performance of the basic method, each above is replaced by a function , which is a quadratic fitted by weighted least squares to data local to and forced to interpolate . In this context, a point is defined to be local to another point if it lies within some distance of it.

The efficiency of dimn_scat_shep is enhanced by using a cell method for nearest neighbour searching due to Bentley and Friedman (1979) with a cell density of .

The radii and are chosen to be just large enough to include and data points, respectively, for user-supplied constants and . Default values of these parameters are provided, and advice on alternatives is given in Further Comments.

dimn_scat_shep is derived from the new implementation of QSHEP3 described by Renka (1988b). It uses the modification for high-dimensional interpolation described by Berry and Minser (1999).

Values of the interpolant generated by dimn_scat_shep, and its first partial derivatives, can subsequently be evaluated for points in the domain of the data by a call to dimn_scat_shep_eval().

References

Bentley, J L and Friedman, J H, 1979, Data structures for range searching, ACM Comput. Surv. (11), 397–409

Berry, M W, Minser, K S, 1999, Algorithm 798: high-dimensional interpolation using the modified Shepard method, ACM Trans. Math. Software (25), 353–366

Franke, R and Nielson, G, 1980, Smooth interpolation of large sets of scattered data, Internat. J. Num. Methods Engrg. (15), 1691–1704

Renka, R J, 1988, Multivariate interpolation of large sets of scattered data, ACM Trans. Math. Software (14), 139–148

Renka, R J, 1988, Algorithm 661: QSHEP3D: Quadratic Shepard method for trivariate interpolation of scattered data, ACM Trans. Math. Software (14), 151–152

Shepard, D, 1968, A two-dimensional interpolation function for irregularly spaced data, Proc. 23rd Nat. Conf. ACM, 517–523, Brandon/Systems Press Inc., Princeton