naginterfaces.library.sum.fast_​gauss

naginterfaces.library.sum.fast_gauss(srcs, trgs, q, p1, p2, k, hin, tol)[source]

fast_gauss calculates the multidimensional fast Gauss transform.

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

https://support.nag.com/numeric/nl/nagdoc_30/flhtml/c06/c06saf.html

Parameters
srcsfloat, array-like, shape

, the locations of the Gaussian sources.

trgsfloat, array-like, shape

, the locations of the target points at which the FGT will be evaluated.

qfloat, array-like, shape

, the weights of the Gaussian sources.

p1int

, the number of terms of the first Taylor series to be evaluated.

p2int

, the number of terms of the second Taylor series to be evaluated.

kint

, the number of clusters into which the source points will be aggregated.

hinfloat, array-like, shape

, the standard deviations of the Gaussian sources. If , the array will be expanded automatically by repeating until it is of length . See the G01 Introduction for further information.

tolfloat

, the desired accuracy of the FGT approximation of the DGT. Determines the radius of the source clusters: the contribution of a source point to the FGT approximation at a target point is disregarded if the source is outside the corresponding cluster radius.

Returns
p1int

is unchanged.

p2int

is unchanged.

kint

is unchanged.

vfloat, ndarray, shape

, the value of the FGT evaluated at .

termfloat, ndarray, shape

contains the absolute value of the final Taylor series term that is largest, relative to the size of the sum of the corresponding series, across all clusters that contribute to the FGT at target point .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: , for .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

Warns
NagAlgorithmicWarning
(errno )

On exit, , and .

, or may have been too small to calculate to the required accuracy .

Notes

fast_gauss calculates the -dimensional fast Gauss transform (FGT), , that approximates the discrete Gauss transform (DGT), , evaluated at a set of target points , for . The DGT is defined as:

where , for , are the Gaussian source points, , for , are the source weights and , for , are the source standard deviations (alternatively source scales or source bandwidths).

This function implements the improved FGT algorithm presented in Raykar and Duraiswami (2005). The algorithm clusters the sources into distinct clusters and then computes two Taylor series approximations per cluster with and terms respectively. You must provide , and when calling the function. See Accuracy below for a further discussion on accuracy when choosing their values.

The input array of this function is designed to allow maximum flexibility in the supply of the standard deviation arguments by reusing, in a cyclic manner, elements of the array when it is less than elements long. For example, if all Gaussian sources have the same standard deviation then it is only necessary to set to and to provide the value of the standard deviation in ; the function will then automatically expand to be of length . For further details please see the G01 Introduction.

References

Greengard, L and Strain, J, 1991, The Fast Gauss Transform, SIAM J. Sci. Statist. Comput. (12(1)), 79–94

Raykar, V C and Duraiswami, R, 2005, Improved Fast Gauss Transform With Variable Source Scales, University of Maryland Technical Report CS-TR-4727/UMIACS-TR-2005-34