(a) | the value of a one-dimensional definite integral of the form
Some methods are specially designed for integrands of the form
|
||||
(b) | the value of a multidimensional definite integral of the form
The simplest form of is the -rectangle defined by
|
(5) |
(6) |
(a) | Single rule evaluation procedures
A fixed number of abscissae, , is used. This number and the particular rule chosen uniquely determine the weights and abscissae. No estimate is made of the accuracy of the result. |
||||
(b) | Automatic procedures
The number of abscissae, , within is gradually increased until consistency is achieved to within a level of accuracy (absolute or relative) you requested. There are essentially two ways of doing this; hybrid forms of these two methods are also possible:
|
(a) | Products of one-dimensional rules
Using a two-dimensional integral as an example, we have
A different one-dimensional rule may be used for each dimension, as appropriate to the range and any weight function present, and a different strategy may be used, as appropriate to the integrand behaviour as a function of each independent variable.
For a rule-evaluation strategy in all dimensions, the formula (8) is applied in a straightforward manner. For automatic strategies (i.e., attempting to attain a requested accuracy), there is a problem in deciding what accuracy must be requested in the inner integral(s). Reference to formula (7) shows that the presence of a limited but random error in the -integration for different values of can produce a ‘jagged’ function of , which may be difficult to integrate to the desired accuracy and for this reason products of automatic one-dimensional functions should be used with caution (see Lyness (1983)). |
||||
(b) | Monte–Carlo methods
These are based on estimating the mean value of the integrand sampled at points chosen from an appropriate statistical distribution function. Usually a variance reducing procedure is incorporated to combat the fundamentally slow rate of convergence of the rudimentary form of the technique. These methods can be effective by comparison with alternative methods when the integrand contains singularities or is erratic in some way, but they are of quite limited accuracy. |
||||
(c) | Number theoretic methods
These are based on the work of Korobov and Conroy and operate by exploiting implicitly the properties of the Fourier expansion of the integrand. Special rules, constructed from so-called optimal coefficients, give a particularly uniform distribution of the points throughout -dimensional space and from their number theoretic properties minimize the error on a prescribed class of integrals. The method can be combined with the Monte–Carlo procedure. |
||||
(d) | Sag–Szekeres method
By transformation this method seeks to induce properties into the integrand which make it accurately integrable by the trapezoidal rule. The transformation also allows effective control over the number of integrand evaluations. |
||||
(e) | Sparse grid methods
Given a set of one-dimensional quadrature rules of increasing levels of accuracy, the sparse grid method constructs an approximation to a multidimensional integral using -dimensional tensor products of the differences between rules of adjacent levels. This provides a lower theoretical accuracy than the methods in (a), the full grid approach, which is nonetheless still sufficient for various classes of sufficiently smooth integrands. Furthermore, it requries substantially fewer evaluations than the full grid approach. Specifically, if a one-dimensional quadrature rule has points, the full grid will require function evaluations, whereas the sparse grid of level will require . Hence a sparse grid approach is computationally feasible even for integrals over .
Sparse grid methods are deterministic, and may be viewed as automatic whole domain procedures if their level is allowed to increase. |
||||
(f) | Automatic adaptive procedures
An automatic adaptive strategy in several dimensions normally involves division of the region into subregions, concentrating the divisions in those parts of the region where the integrand is worst behaved. It is difficult to arrange with any generality for variable limits in the inner integral(s). For this reason, some methods use a region where all the limits are constants; this is called a hyper-rectangle. Integrals over regions defined by variable or infinite limits may be handled by transformation to a hyper-rectangle. Integrals over regions so irregular that such a transformation is not feasible may be handled by surrounding the region by an appropriate hyper-rectangle and defining the integrand to be zero outside the desired region. Such a technique should always be followed by a Monte–Carlo method for integration.
The method used locally in each subregion produced by the adaptive subdivision process is usually one of three types: Monte–Carlo, number theoretic or deterministic. Deterministic methods are usually the most rapidly convergent but are often expensive to use for high dimensionality and not as robust as the other techniques. |
(a) | Single abscissa interfaces
The algorithm will provide a single abscissa at which information is required. These are typically the most simple to use, although they may be significantly less efficient than a vectorized equivalent. Most of the algorithms in this chapter are of this type.
Examples of this include
nag_quad_md_gauss (d01fbc) and nag_1d_quad_gen_1 (d01sjc).
|
(b) | Vectorized abscissae interfaces
The algorithm will return a set of abscissae, at all of which information is required. While these are more complicated to use, they are typically more efficient than a non-vectorized equivalent. They reduce the overhead of function calls, allow the avoidance of repetition of computations common to each of the integrand evaluations, and offer greater scope for vectorization and parallelization of your code.
Examples include
nag_quad_1d_fin_gonnet_vec (d01rgc) and nag_quad_1d_gauss_vec (d01uac).
|
(c) | Multiple integral interfaces
These are functions which allow for multiple integrals to be estimated simultaneously. As with (b) above, these are more complicated to use than single integral functions, however they can provide higher efficiency, particularly if several integrals require the same subcalculations at the same abscissae. They are most efficient if integrals which are supplied together are expected to have similar behaviour over the domain, particularly when the algorithm is adaptive.
nag_quad_1d_gen_vec_multi_rcomm (d01rac) is an example.
|
(a) | Integrand defined at a set of points
If is defined numerically at four or more points, then the Gill–Miller finite difference method (nag_1d_quad_vals (d01gac)) should be used. The interval of integration is taken to coincide with the range of values of the points supplied. It is in the nature of this problem that any function may be unreliable. In order to check results independently and so as to provide an alternative technique you may fit the integrand by Chebyshev series using nag_1d_cheb_fit (e02adc) and then use function nag_1d_cheb_intg (e02ajc) to evaluate its integral (which need not be restricted to the range of the integration points, as is the case for nag_1d_quad_vals (d01gac)). A further alternative is to fit a cubic spline to the data using nag_1d_spline_fit_knots (e02bac) and then to evaluate its integral using nag_1d_spline_intg (e02bdc). |
||||||||||||||
(b) | Integrand defined as a function
If the functional form of is known, then one of the following approaches should be taken. They are arranged in the order from most specific to most general, hence the first applicable procedure in the list will be the most efficient.
However, if you do not wish to make any assumptions about the integrand, the most reliable functions to use will be
nag_quad_1d_gen_vec_multi_rcomm (d01rac), nag_quad_1d_fin_gonnet_vec (d01rgc), nag_1d_quad_gen_1 (d01sjc), nag_1d_quad_osc_1 (d01skc) and nag_1d_quad_brkpts_1 (d01slc), although these will in general be less efficient for simple integrals.
|
(a) | Integrand defined at a set of points
If is defined numerically at four or more points, and the portion of the integral lying outside the range of the points supplied may be neglected, then the Gill–Miller finite difference method, nag_1d_quad_vals (d01gac), should be used. |
||||||||||||||||||||
(b) | Integrand defined as a function
|
(a) | Products of one-dimensional rules (suitable for up to about dimensions)
If is known to be a sufficiently well behaved function of each variable , apart possibly from weight functions of the types provided, a product of Gaussian rules may be used. These are provided by
nag_quad_1d_gauss_wset (d01tbc) or nag_quad_1d_gauss_wgen (d01tcc)
with nag_quad_md_gauss (d01fbc). Rules for finite, semi-infinite and infinite ranges are included.
For two-dimensional integrals only, unless the integrand is very badly behaved, the automatic whole-interval product procedure of nag_quad_2d_fin (d01dac) may be used. The limits of the inner integral may be user-specified functions of the outer variable. Infinite limits may be handled by transformation (see Section 3.4); end point singularities introduced by transformation should not be troublesome, as the integrand value will not be required on the boundary of the region.
If none of these functions proves suitable and convenient, the one-dimensional functions may be used recursively. For example, the two-dimensional integral
From Mark 24 onwards, all direct communication functions may be called recursively. As such, you may use any function, including the same function, for each dimension. Note however, in previous releases,
some direct communication functions, specifically,
nag_quad_1d_fin_smooth (d01bdc), nag_quad_2d_fin (d01dac), nag_quad_md_gauss (d01fbc), nag_quad_md_sphere (d01fdc), nag_quad_md_numth_vec (d01gdc) and nag_quad_md_simplex (d01pac), could not be called recursively.
The reverse communication function nag_quad_1d_gen_vec_multi_rcomm (d01rac) may be used by itself in a pseudo-recursive manner, in that it may be called to evaluate an inner integral for the integrand value of an outer integral also being calculated by nag_quad_1d_gen_vec_multi_rcomm (d01rac). |
||||
(b) | Sag–Szekeres method
nag_quad_md_sphere (d01fdc) is particularly suitable for integrals of very large dimension although the accuracy is generally not high. It allows integration over either the general product region (with built-in transformation to the -cube) or the -sphere. Although no error estimate is provided, two adjustable arguments may be varied for checking purposes or may be used to tune the algorithm to particular integrals. |
||||
(c) | Number Theoretic method
Algorithms of this type carry out multidimensional integration using the Korobov–Conroy method over a product region with built-in transformation to the -cube. A stochastic modification of this method is incorporated into the functions in this library, hybridising the technique with the Monte–Carlo procedure. An error estimate is provided in terms of the statistical standard error. A number of pre-computed optimal coefficient rules for up to dimensions are provided; others can be computed using nag_quad_md_numth_coeff_prime (d01gyc) and nag_quad_md_numth_coeff_2prime (d01gzc). Like the Sag–Szekeres method it is suitable for large dimensional integrals although the accuracy is not high.
nag_quad_md_numth_vec (d01gdc) has a vectorized interface which can result in faster execution, especially on vector-processing machines. You are required to provide two functions, the first to return an array of values of the integrand at each of an array of points, and the second to evaluate the limits of integration at each of an array of points. This reduces the overhead of function calls, avoids repetitions of computations common to each of the evaluations of the integral and limits of integration, and offers greater scope for vectorization of your code. |
||||
(d) | A combinatorial extrapolation method
nag_quad_md_simplex (d01pac) computes a sequence of approximations and an error estimate to the integral of a function over a multidimensional simplex using a combinatorial method with extrapolation. |
||||
(e) | Sparse Grid method
nag_quad_md_sgq_multi_vec (d01esc) implements a sparse grid quadrature scheme for the integration of a vector of multidimensional integrals over the unit hypercube,
The function uses a vectorized interface, which returns a set of points at which the integrands must be evaluated in a sparse storage format for efficiency.
Other domains can be readily integrated over by using an appropriate mapping inside the provided function for evaluating the integrands. It is suitable for up to , although no upper bound on the number of dimensions is enforced. It will also evaluate one-dimensional integrals, although in this case the sparse grid used is in fact the full grid.
The function uses optional parameters, set and queried using the functions nag_quad_opt_set (d01zkc) and nag_quad_opt_get (d01zlc) respectively. Amongst other options, these allow the parallelization of the function to be controlled. |
||||
(f) | Automatic functions
(nag_multid_quad_adapt_1 (d01wcc) and nag_multid_quad_monte_carlo_1 (d01xbc))
Both functions are for integrals of the form
nag_multid_quad_monte_carlo_1 (d01xbc)
is an adaptive Monte–Carlo function. This function is usually slow and not recommended for high-accuracy work. It is a robust function that can often be used for low-accuracy results with highly irregular integrands or when is large.
nag_multid_quad_adapt_1 (d01wcc)
is an adaptive deterministic function. Convergence is fast for well behaved integrands. Highly accurate results can often be obtained for between and , using significantly fewer integrand evaluations than would be required by
the Monte–Carlo function nag_multid_quad_monte_carlo_1 (d01xbc).
The function will usually work when the integrand is mildly singular and for should be used before
nag_multid_quad_monte_carlo_1 (d01xbc).
If it is known in advance that the integrand is highly irregular, it is best to compare results from at least two different functions.
There are many problems for which one or both of the functions will require large amounts of computing time to obtain even moderately accurate results. The amount of computing time is controlled by the number of integrand evaluations you have allowed, and you should set this argument carefully, with reference to the time available and the accuracy desired. |
Is the functional form of the integrand known? | Do you require reverse communication? | d01rac | ||||||
yes | yes | |||||||
no | no | |||||||
Are you concerned with efficiency for simple integrals? | Is the integrand smooth (polynomial-like) apart from weight function or ? | d01uac, d01tbc or d01tcc and d01fbc or d01gdc | ||||||
yes | yes | |||||||
no | no | |||||||
Is the integrand reasonably smooth and the required accuracy not too great? | d01bdc, d01esc or d01uac | |||||||
yes | ||||||||
no | ||||||||
Are multiple integrands to be integrated simultaneously? | d01esc or d01rac | |||||||
yes | ||||||||
no | ||||||||
Has the integrand discontinuities, sharp peaks or singularities at known points other than the end points? | Split the range and begin again; or use d01rgc or d01slc | |||||||
yes | ||||||||
no | ||||||||
Is the integrand free of singularities, sharp peaks and violent oscillations apart from weight function ? | d01spc | |||||||
yes | ||||||||
no | ||||||||
Is the integrand free of singularities, sharp peaks and violent oscillations apart from weight function ? | d01sqc | |||||||
yes | ||||||||
no | ||||||||
Is the integrand free of violent oscillations apart from weight function or ? | d01snc | |||||||
yes | ||||||||
no | ||||||||
Is the integrand free of singularities? | d01esc, d01sjc, d01skc or d01uac | |||||||
yes | ||||||||
no | ||||||||
d01rac, d01rgc or d01sjc | ||||||||
d01rac, d01rgc or d01sjc | ||||||||
d01gac | ||||||||
Is the functional form of the integrand known? | Are you concerned with efficiency for simple integrands? | Is the integrand smooth (polynomial-like) with no exceptions? | d01bdc | |||||||
yes | yes | yes | ||||||||
no | no | no | ||||||||
Is the integrand of the form ? | d01ubc | |||||||||
yes | ||||||||||
no | ||||||||||
Is the integrand smooth (polynomial-like) apart from weight function (semi-infinite range) or (infinite range) or is the integrand polynomial-like in ? (semi-infinite range)? | d01uac, or d01tcc and d01fbc, or, d01tbc and d01fbc, or d01tdc and d01fbc (d01tdc may require use of d01tec) | |||||||||
yes | ||||||||||
no | ||||||||||
Has integrand discontinuities, sharp peaks or singularities at known points other than a finite limit? | Split range; begin again using finite or infinite range tree | |||||||||
yes | ||||||||||
no | ||||||||||
Does the integrand oscillate over the entire range? | Does the integrand decay rapidly towards an infinite limit? | Use d01smc; or set cutoff and use finite range tree | ||||||||
yes | yes | |||||||||
no | no | |||||||||
Is the integrand free of violent oscillations apart from weight function or (semi-infinite range)? | d01ssc | |||||||||
yes | ||||||||||
no | ||||||||||
Use finite-range integration between the zeros and extrapolate. | ||||||||||
d01smc | ||||||||||
d01smc | ||||||||||
d01gac (integrates over the range of the points supplied) | ||||||||||
Is dimension and product region? | d01dac | ||||||
yes | |||||||
no | |||||||
Is dimension | Is region an -sphere? | d01fbc with user transformation. | |||||
yes | yes | ||||||
no | no | ||||||
Is region a Simplex? | d01fbc with user transformation or d01pac | ||||||
yes | |||||||
no | |||||||
Is the integrand smooth (polynomial-like) in each dimension apart from weight function? | d01tbc and d01fbc or d01tcc and d01fbc | ||||||
yes | |||||||
no | |||||||
Is integrand free of extremely bad behaviour? | d01esc, d01fdc, d01gdc or d01wcc | ||||||
yes | |||||||
no | |||||||
Is bad behaviour on the boundary? | d01fdc or d01wcc | ||||||
yes | |||||||
no | |||||||
Compare results from at least two of d01esc, d01fdc, d01gdc, d01wcc and d01xbc and one-dimensional recursive application | |||||||
Is region an -sphere? | d01fdc | ||||||
yes | |||||||
no | |||||||
Is region a Simplex? | d01pac | ||||||
yes | |||||||
no | |||||||
Is high accuracy required? | d01fdc with argument tuning | ||||||
yes | |||||||
no | |||||||
Is dimension high? | d01esc, d01fdc or d01gdc | ||||||
yes | |||||||
no | |||||||
d01wcc | |||||||