Abstract
This paper is concerned with developing an efficient numerical algorithm for the fast implementation of the sparse grid method for computing the d-dimensional integral of a given function. The new algorithm, called the MDI-SG (multilevel dimension iteration sparse grid) method, implements the sparse grid method based on a dimension iteration/reduction procedure. It does not need to store the integration points, nor does it compute the function values independently at each integration point; instead, it reuses the computation for function evaluations as much as possible by performing the function evaluations at all integration points in a cluster and iteratively along coordinate directions. It is shown numerically that the computational complexity (in terms of CPU time) of the proposed MDI-SG method is of polynomial order or better, compared to the exponential order for the standard sparse grid method, where N denotes the maximum number of integration points in each coordinate direction. As a result, the proposed MDI-SG method effectively circumvents the curse of dimensionality suffered by the standard sparse grid method for high-dimensional numerical integration.
Keywords:
sparse grid (SG) method; multilevel dimension iteration (MDI); high-dimensional integration; numerical quadrature rules; curse of dimensionality MSC:
65D30; 65D40; 65C05; 65N99
1. Introduction
With rapid developments in nontraditional applied sciences such as mathematical finance [1], image processing [2], economics [3], and data science [4], there is an ever-increasing demand for efficient numerical methods for computing high-dimensional integration, which also becomes crucial for solving some challenging problems. Numerical methods (or quadrature rules) mostly stem from approximating the Riemann sum in the definition of integrals; hence, they are grid-based. The simplest and most natural approach for constructing numerical quadrature rules in high dimensions is to apply the same 1-d rule in each coordinate direction. This then leads to tensor-product (TP) quadrature rules. It is well known (and easy to check) that the number of integration points (and function evaluations) grows exponentially in the dimension d; such a phenomenon is known as the curse of dimensionality (CoD). Mitigating or circumventing the CoD is the primary goal when it comes to constructing efficient high-dimensional numerical quadrature rules. A lot of progress has been made in this direction in the past 50 years, including sparse grid (SG) methods [1,5,6,7], Monte Carlo (MC) methods [8,9], quasi-Monte Carlo (QMC) methods [10,11,12,13,14], and deep neural network (DNN) methods [15,16,17,18,19]. To some certain extent, these methods are effective for computing integrals in low and medium dimensions (i.e., ), but it is still a challenge for them to compute integrals in very high dimensions (i.e., ).
This is the second installment in a sequence [20] that aims at developing fast numerical algorithms for high-dimensional numerical integration (see [21] for fast algorithms for other applications). As mentioned above, the straightforward implementation of the TP method will evidently run into the CoD dilemma. To circumvent the difficulty, we proposed in [20] a multilevel dimension iteration algorithm (called MDI-TP) for accelerating the TP method. The ideas of the MDI-TP algorithm are to reuse the computation of function evaluation as much as possible in the tensor product method by clustering computations, which allows efficient and fast function evaluations at integration points together, and to perform clustering using a simple dimension iteration/reduction strategy, which is possible because of the lattice structure of the TP integration points. Since the idea of the MDI strategy can essentially be applied to any numerical integration rule whose integration points have a lattice-like structure, the work in this paper was motivated by applying the MDI idea to accelerate the sparse grid method. We recall that, unlike the existing numerical integration methods, the MDI algorithm does not aim to provide a new numerical integration method per se; instead, it is an acceleration algorithm for an efficient implementation of any tensor product-like existing method. Thus, the MDI is not a “discretization" method but a “solver" (borrowing numerical PDE terminologies). A well suited analogy would be high order polynomial evaluations, that is, to compute for a given real number input . It is well known that such a high order polynomial evaluation on a computer is notoriously unstable, inaccurate (due to roundoff errors), and expensive; however, those difficulties can be easily overcome by a simple nested iteration (or Horner’s algorithm. cf. [22]), namely, set and for , set . From the cost saving and efficiency point view, the reason for the nested iteration to be efficient and fast is that it reuses many multiplications involving compared to the direct evaluations of each term in . Conceptually, this is exactly the main idea of the MDI algorithm, i.e., to reuse computations of the function evaluations in an existing method as much as possible to save the computational cost and, thus, to make it efficient and fast.
The sparse grid (SG) method, which was first proposed by Smolyak in [23], only uses a (small) subset of the TP integration points while still maintaining a comparable accuracy to the TP method. As mentioned earlier, the SG method was one of few successful numerical methods that could mitigate the CoD in high-dimensional computation, including computing high-dimensional integration and solving high-dimensional PDEs [1,5,6,7]. Recently, in [24], Maruri-Aguilar and Wynn proposed using polynomial interpolator models in sparse grids. Their method uses Betti numbers to reduce the number of terms in the inclusion-exclusion while achieving the same result as with exhaustive formulas. In [25], Deluzet et al. proposed a tailored sparse grid reconstruction to introduce a particle-in-cell method to improve efficiency. In [26], Wu et al. developed a rotational sparse grid (R-SPGR) method for statistical moment evaluation and structural reliability analysis with enhanced accuracy and efficiency. The basic idea in application to high-dimensional numerical integration stems from Smolyak’s general method for multivariate extensions of univariate operators. Based on this construction, the midpoint rule [27], the rectangle rule [28], the trapezoidal rule [29], the Clenshaw-Curtis rule [30,31], and the Gaussian-Legendre rule [32,33] have been used as a one-dimensional numerical integration method. A multivariate quadrature rule is then constructed by forming the TP method of each of these one-dimensional rules on the underlying sparse grid. Like the TP method, the SG method is quite general and easy to implement. But, unlike the TP method, its computational cost is much lower because the number of its required function evaluations grows exponentially with a smaller base. A key observation is that the function evaluations of the SG method involve a lot of computation in each coordinate direction, which can be shared because each coordinate of every integration point is shared by many other integration points due to their tensor product structure. This observation motivated us to compute the required function evaluations in cluster and iteratively in each coordinate direction instead of computing them at the integration points independently.
The goal and main contribution of this paper is to develop a fast algorithm for the efficient implementation of the SG method based on the MDI approach. The resulting algorithm is called the MDI-SG algorithm. The MDI-SG method incorporates the MDI nested iteration idea into the sparse grid method, which allows the reuse of the computation in the function evaluations at the integration points as much as possible. This saving significantly reduces the overall computational cost for implementing the sparse grid method from an exponential growth to a low-order polynomial growth.
The rest of this paper is organized as follows. In Section 2, we first briefly recall the formulation of the sparse grid method and some known facts. In Section 3, we introduce our MDI-SG algorithm: first in two and three dimensions to explain the main ideas of the algorithm, and then we generalize it to arbitrary dimensions. In Section 4 and Section 5, we present various numerical experiments to test the performance of the proposed MDI-SG algorithm and compare its performances to the standard SG method and the classical MC method. These numerical tests show that the MDI-SG algorithm is much faster in low and medium dimensions (i.e., ) and in very high dimensions (i.e., ). It still works even when the MC method fails to compute. We also provide numerical tests to measure the influence of parameters in the proposed MDI-SG algorithm, including dependencies on the choice of the underlying 1-d quadrature rule, and the choice of the iteration step size. In Section 6, we numerically estimate the computational complexity of the MDI-SG algorithm. This was done by using standard regression technique to discover the relationship between the CPU time and dimension. It is shown that the CPU time grows at most in a polynomial order , where d and N stand for the dimension of the integration domain and the maximum number of integration points in each coordinate direction, respectively. As a result, the proposed MDI-SG method effectively circumvents the curse of dimensionality. Finally, the paper is concluded with some concluding remarks given in Section 7.
2. Preliminaries
In this paper, denote a given continuous function on for , and then has pointwise values at every Without loss of the generality, we set and consider the basic and fundamental problem of computing the integral
As mentioned in Section 1, the goal of this paper was to develop a fast algorithm for computing the above integral based on the sparse grid methodology. To that end, below, we briefly recall the necessary elements of sparse grid methods.
2.1. The Sparse Grid Method
We now recall the formulation of the sparse grid method for approximating (1) and its tensor product reformulation formula, which will be crucially used later in the formulation of our fast MDI-SG algorithm.
For each positive integer index , let be a positive integer, which denotes the number of grid points at level l and
denote a sequence of the level l grid points in . The grid set is said to be nested provided that . The best known example of the nested grids is the following dyadic grids:
For a given positive integer q, the tensor product then yields a standard tensor product grid on . Notice that here the qth level is used in each coordinate direction. To reduce the number of grid points in , the sparse grid idea is to restrict the total level to be q in the sense that , where is the level used in the ith coordinate direction. Its corresponding tensor product grid is . Obviously, the decomposition is not unique, so all such decomposition must be considered. The union
then yields the famous Smolyak sparse grid (embedded) on (cf. [5]). We remark that the underlying idea of going from to is exactly the same as going from to , where denotes the set of polynomials whose degrees in all coordinate directions do not exceed q and denotes the set of polynomials whose total degrees do not exceed q.
After having introduced the concept of sparse grids, we can then define the sparse grid quadrature rule. For a univariate function g on , we consider d, i.e., the one-dimensional quadrature formula
where and denote the integration points/nodes and weights of the quadrature rule, respectively, and denotes the number of integration points in the ith coordinate direction in . In addition, define the following:
For example, .
Then, the sparse grid quadrature rule with accuracy level for d-dimensional integration (1) on is defined as (cf. [1])
where
We note that each term in (7) is the tensor product quadrature rule, which uses integration points in the ith coordinate direction. To write more compactly, we set
which denotes the total number of integration points in . Let denote the corresponding weights and define the bijective mapping
We also note that some weights may become negative even though the one-dimensional weights are positive. Therefore, it is no longer possible to interpret as a discrete probability measure. Moreover, the existence of negative weights in (8) may cause numerical cancellation, and hence, the loss of significant digits. Circumventing such a potential cancellation, it is recommended in [6] that the summation is carried out by coordinates, this then leads to the following tensor product reformulation of :
where the upper limits are defined recursively as
In the nested mesh case (i.e., is nested), nested integration points are selected to form the sparse grid. We remark that different 1-d quadrature rules in (5) will lead to different sparse grid methods in (6). We also note that the tensor product reformulation (9) will play a crucial role later in the construction of our MD-SG algorithm.
Figure 1 demonstrates the construction of a sparse grid according to the Smolyak rule when and . The meshes are nested, namely, . The 1-d integration-point sequence (, and ) and (, and ) are shown at the top and left of the figure, and the tensor product points are shown in the upper right corner. From (6), we see that the sparse grid rule is a combination of the low-order tensor product rule on with . The point sets of these products and the resulting sparse grid are shown in the lower half of the figure. We notice that some points in the sparse grid are repeatedly used in with . Consequently, we would avoid the repeated points (i.e., only using the red points in Figure 1) and use the reformulation (9), which does not involve repetition in the summation.
Figure 1.
Construction of a nested sparse grid in two dimensions.
2.2. Examples of Sparse Grid Methods
As mentioned earlier, different 1-d quadrature rules in (5) lead to different sparse grid quadrature rules in (9). Below, we introduce four widely used sparse grid quadrature rules, which will be the focus of this paper.
Example 1
(The classical trapezoidal rule). The 1-d trapezoidal rule is defined by (cf. [29])
with and ; where the indicates that the first and last terms in the sum are halved. The following theorem gives the error estimate; its proof can be found in [6] (pages 3–5).
Theorem 1.
Suppose , then there holds
Example 2
(The classical Clenshaw-Curtis rule). This quadrature rule reads as follows (cf. [30,31]):
with and the weights
for ; where indicates that the last term in the summation is halved.
The following error estimate holds and see [31] (Theorem 1) for its proof.
Theorem 2.
Suppose , then there holds
Example 3
(The Gauss-Patterson rule). This quadrature rule is defined by (cf. [32,33])
with , and being the union of the zeroes of the polynomial and , where is the n-th order Legendre polynomial, is the -th order Stieltjes polynomial, and is orthogonal to all polynomials of degree less than with respect to the weight function . is defined similarly to the Gauss-Legendre case, see [32] for details. Gauss-Patterson rules are a sequence of nested quadrature formulas with the maximal order of exactness. Its error estimate is given by the following theorem, see [30,33] (Theorem 1).
Theorem 3.
Suppose , then there holds
Example 4
(The classical Gauss-Legendre rule). This classical quadrature rule is defined by
with for . are the zeroes of the th order Legendre polynomial , and are the corresponding weights.
The following theorem gives the error estimate; its proof can be found in [6] (pages 3–5).
Theorem 4.
Suppose , then there holds
Figure 2 and Figure 3 show the resulting sparse grids of the above four examples in both 2-d and 3-d cases with and , respectively. We note that these four sparse grids have different structures.
Figure 2.
Sparse grids corresponding to the trapezoidal rule (a), Clenshaw-Curtis rule (b), Gauss-Patterson rule (c), and Gauss-Legendre rule (d) when .
Figure 3.
Sparse grids corresponding to the trapezoidal rule (a), Clenshaw-Curtis rule (b), Gauss-Patterson rule (c), and Gauss-Legendre rule (d) when .
We conclude this section by remarking that the error estimates of the above quadrature rules can be easily translated to error estimates for the sparse grid method (9). For example, in the case of the Clenshaw-Curtis, Gauss-Patterson, and Gauss-Legendre quadrature rule, there holds (cf. [31] (Corollary 1))
where
We note that the above estimate indicates that the error of the sparse grid method still deteriorates exponentially in the dimension d, but with a smaller base .
3. The MDI-SG Algorithm
The goal of this section is to present an efficient and fast implementation algorithm (or solver), called the MDI-SG algorithm, for evaluating the sparse grid quadrature rule (6) via its reformulation (9) in order to circumvent the curse of dimensionality, which hampers the usage of the sparse grid method (6) in high dimensions. To better understand the main idea of the MDI-SG method, we first consider the simple two- and three-dimensional cases and then formulate the algorithm in arbitrary dimensions.
Recall that denotes a continuous function on ; we assume that f has a known expression.
3.1. Formulation of the MDI-SG Algorithm in Two Dimensions
Let , , and . Using Fubini’s theorem, we have
Then, the two-dimensional SG quadrature rule (9) takes the form
where . Motivated by (and mimicking) Fubini’s Formula (19), we rewrite (20) as
where
We note that the evaluation of amounts to applying the 1-d Formula (5) to approximate the integral However, the values of will not be computed by the 1-d quadrature rule in our MDI-SG algorithm; instead, is formed as a symbolic function, so the 1-d quadrature rule can be called on . Therefore, we still use the SG method to select the integration points, and then use our MDI-SG algorithm to perform function evaluations at the integration points collectively to save computation, which is the main idea of the MDI-SG method.
Let W and X denote the weight and node vectors of the 1-d quadrature rule on . In addition, represents the number of integration points in the direction and we use a parameter to indicate one of the four quadrature rule. The following algorithm implements the sparse grid quadrature Formula (21).
We note that the first do-loop forms the symbolic function , which encodes all computations involving the -components at all integration points. The second do-loop evaluates the 1-d quadrature rule for the function . As mentioned above, in this paper, we only focus on the four well-known 1-d quadrature rules: (i) the trapezoidal rule; (ii) the Clenshaw-Curtis rule; (iii) the Gauss-Patterson rule; (iv) the Gauss-Legendre rule. They will be represented respectively by .
Below, we use a simple 2-d example to explain the mechanism of above 2d-MDI-SG algorithm. It is clear that to directly compute the SD sum
it is necessary to compute the function values of at points, which is often performed independently. On the other hand, the 2d-MDI-SD algorithm is based on rewriting the sum as
where denotes the symbolic function obtained in the first do-loop. Hence, the algorithm performs two separate do-loops. In the first d-loop, symbolic computations are performed to obtain the symbolic function , which is saved. In the second do-loop, the single sum is calculated. When computing the symbolic function , a lot of computations have been reused for computing the coefficients in , and those coefficients are constants in the second do-loop. Efficiently generating the symbolic function and using it to compute the SG sum are the main reasons for saving computation and computer memory.
Take as a concrete example. The direct computation the SG sum in (22) requires to compute the function value at each node ; this, in turn, requires three multiplications and two additions. With a total of nodes, the computing the sum requires a total of multiplications and additions. On the other hand, when using the 2d-MDI-SD algorithm to compute the same sum, in the first do-loop, we compute the symbolic function , which requires “symbolic multiplications” of (no real multiplication is needed because of its linear dependence on and multiplications of , and additions. In the second do-loop, computing the requires multiplications of and multiplications of , and additions. Thus, the 2d-MDI-SD algorithm requires a total of multiplications and additions. Therefore, the 2d-MDI-SG algorithm computes the SD sum much more economically than the standard implementation, and this advantage will become more significant in high dimensions. See Section 3.2 and Section 3.3 for details.
3.2. Formulation of the MDI-SG Algorithm in Three Dimensions
In the subsection, we extend the formulation of the above 2d-MDI-SGI algorithm to the 3-d case by highlighting its main steps, in particular, how the above 2-d algorithm is utilized. First, recall that Fubini’s theorem is given by
where .
Second, notice that the SG quadrature rule (9) in 3-d takes the form
where . Mimicking Fubini’s formula above, we rewrite (25) as
where
We note that is formed as a symbolic function in our MDI-SG algorithm and the right-hand side of (26) is viewed as a 2-d sparse grid quadrature formula for ; it can be computed either directly or recursively by using Algorithm 1. The following algorithm implements the SG quadrature Formula (26).
| Algorithm 1: 2d-MDI-SG (f, ) |
|
Where denotes the orthogonal projection (or natural embedding): , and W and X stand for the weight and node vectors of the underlying 1-d quadrature rule, respectively.
From Algorithm 2 we can see the mechanism of the MDI-SG algorithm. It is based on two main ideas: (i) Using the sparse grid approach to select integration points; (ii) using the discrete Fubini formula to efficiently compute the total sparse grid sum by reducing it to the calculation of a low-dimensional (i.e., 2-d) sparse grid sum, which allows us to recursively call the low-dimensional MDI-SG algorithm.
| Algorithm 2: 3d-MDI-SG(f, ) |
|
3.3. Formulation of the MDI-SG Algorithm in Arbitrary d-Dimensions
The goal of this subsection is to extend the 2-d and 3-d MDI-SG algorithms to arbitrary d-dimensions. We again start by recalling the d-dimensional Fubini’s theorem
where , and in which and denote the orthogonal projections (or natural embeddings): and , respectively. The integer m denotes the dimension reduction step length in our algorithm.
Mimicking Fubini’s theorem above, we rewrite the d-dimensional SG quadrature rule (9) as follows:
where
We note that, in our MDI-SG algorithm, defined by (30) is a symbolic function and the right-hand side of (29) is a -order multisummation, which itself can be evaluated by employing the dimension reduction strategy. Dimensionality can be reduced by iterating times until . To implement this process, we introduce the following conventions:
- If , set MDI-SG, which is computed by using the one-dimensional quadrature rule (5);
- If , set MDI-SG 2d-MDI-SG;
- If , set MDI-SG 3d-MDI-SG.
We note that when , the parameter m becomes a dummy variable and can be given any value. Recall that denotes the natural embedding from to by deleting the first m components of vectors in . The following algorithm implements the sparse grid quadrature via (29) with
Algorithm 3 recursively generates a sequence of symbolic functions ; each function has m fewer arguments than its predecessor. As mentioned earlier, our MDI-SG algorithm does not perform the function evaluations at all integration points independently, but rather iteratively along m-coordinate directions; hence, the function evaluation at any integration point is not completed until the last step of the algorithm is executed. As a result, many computations are reused in each iteration, which is the main reason for the computational savings and achieving a faster algorithm.
| Algorithm 3: MDI-SG |
Remark 1.
We note that as a solver-type algorithm, the proposed MDI-SG algorithm provides an efficient and fast way to implement the widely used sparse grid methods reviewed in Section 2.2; it does not improve or reduce the theoretical convergence rate of the underlying sparse grid method. As a result, the numerical results obtained by our MDI-SG algorithm also obey the same theoretical error bounds stated in Theorems 1–4 depending on the choice of the underlying sparse grid method.
4. Numerical Performance Tests
In this section, we present extensive numerical tests to gauge the performance of the proposed MDI-SG algorithm and to compare it with the standard sparse grid (SG) and classical Monte Carlo (MC) methods. All numerical tests show that MDI-SG algorithm outperforms both the SG and MC methods in low and medium/high dimensions (i.e., ), and can compute very high-dimensional (i.e., ) integrals while others fail.
All our numerical experiments were performed in Matlab 9.4.0.813654(R2018a) on a desktop PC with Intel(R) Xeon(R) Gold 6226R CPU 2.90GHz and 32GB RAM.
4.1. Two- and Three-Dimensional Tests
We first tested our MDI-SG algorithm on simple 2-d and 3-d examples and compared its performance (in terms of CPU time) with the SG methods.
Test 1. Let and consider the following 2-d integrands:
Let q denote the accuracy level of the sparse grid. The larger q is, the more integration points we need for the 1-d quadrature rule, and the higher the accuracy of the MDI-SG quadrature. The base 1-d quadrature rule was chosen to be the Gauss-Patterson rule; hence, parameter in the algorithm.
Table 1 and Table 2 present the computational results (errors and CPU times) of the MDI-SG and SG methods for approximating and , respectively.
Table 1.
Relative errors and CPU times of MDI-SG and SG tests with for approximating .
Table 2.
Relative errors and CPU times of MDI-SG and SG tests with for approximating ).
From Table 1 and Table 2, we can see that these two methods used very little CPU time; however, despite the SG method outperforming the MDI-SG method in both tests, the difference was almost negligible, so both methods performed well in 2-d case.
Test 2. Let and we consider the following 3-d integrands:
We computed the integral of these two functions over using the MDI-SG and SG methods. Similarly, let q denote the accuracy level of the sparse grid. In addition, we chose parameters and in the algorithm.
The test results are given in Table 3 and Table 4. We again can see that both methods used very little CPU time; although the SG method again slightly outperformed the other method in both tests. However, as q increased, the number of integration points increased, and the CPU times used by these two methods became closer. We would like to point out that both methods were very efficient and their difference was negligible in the 3-d case.
Table 3.
Relative errors and CPU times of MDI-SG and SG tests with for approximating .
Table 4.
Relative errors and CPU times of MDI-SG and SG tests with for approximating .
4.2. High-Dimensional Tests
In this section, we evaluate the performance of the MDI-SG method for . First, we tested and compared the performance of the MDI-SG and SG methods in computing Gaussian integrals for dimensions because is the highest dimension that the SG method is able to compute on our computer. We then provide a performance comparison (in terms of CPU time) of the MDI-SG and classical Monte Carlo (MC) methods in computing high-dimensional integrals.
Test 3. Let for and consider the following Gaussian integrand:
where stands for the Euclidean norm of the vector .
We computed the integral by using the MDI-SG and SG methods, as was done in Tests 1 and 2. Both methods were based on the same 1-d Gauss-Patterson rule (i.e., the parameter ). We also set in the MDI-SG method and used two accuracy levels: .
Table 5 gives the relative error and CPU time for approximating using the MDI-SG and SG methods with the accuracy level , and Table 6 gives the corresponding results for . As can be observed, the errors were the same for both methods (since they used the same integration points), but their CPU times were quite different. The SG method was more efficient for when and for when , but the MDI-SG method excelled for and the winning margin became significant as d and q increased (also see Figure 4). For example, when and , the CPU time required by the SG method was about 6167 s, which is about 2 h, but the CPU time of the MDI-SG method was less than 1 s. Also, when and , the SG method failed to compute the integral due to running out of computer memory. This is because the large number of integration points need to be saved and function evaluations must be performed. The MDI-SG method only needed about 2 s to complete the computation.
Table 5.
Relative errors and CPU times of MDI-SG and SG tests with , and for approximating .
Table 6.
Relative errors and CPU times of MDI-SG and SG tests with , and for approximating .
Figure 4.
CPU time comparison of MDI-SG and SG tests: (left); (middle); (right).
The classical (and quasi) Monte Carlo (MC) method is often the preferred/default method for computing high-dimensional integrals. However, due to its low order of convergence, to achieve the accuracy, a large number of function evaluations are required at randomly sampled integration points, and the number grows rapidly as dimension d increases (due to the rapid growth of variance). Below, we compare the performance of the MDI-SG (with parameters ) and classical MC method. In the test, when , we used the iteration step length to iterate faster until to reach stage 2 of the iteration. We refer the reader to Section 5.2 for a detailed analysis.
Test 4. Let and choose the following integrands:
We used relative error as a criterion for comparison, that is, we determined a required (minimum) number of random sampling points for the MC method so that it produced a relative error comparable to that of the MDI-SG method. The computed results for and are given in Table 7 and Table 8, respectively.
Table 7.
CPU times of the MDI-SG and MC tests with comparable relative errors for approximating .
Table 8.
CPU times of the MDI-SG and MC tests with comparable relative errors for approximating .
From Table 7 and Table 8, we clearly see that there was a significant difference in the CPU time of these two methods for computing and . When , the classical MC method failed to produce a computed result with a relative error of order . As explained in [20], the MC method requires more than randomly sampled integration points and then needs to independently compute their function values, which is a tall order on a regular workstation.
Next, we come to address a natural question: how high a dimension d can be handled by the MDI-SG method. Obviously, the answer is computer-dependent, and the result given below was obtained using the workstation at our disposal.
Test 5. Let and consider the following integrands:
We then computed and using the MDI-SG algorithm for an increasing sequence of d up to 1000 with parameters . The computed results are shown in Table 9. We stopped the computation at since it was already quite high and used to minimize the computation in each iteration. This test demonstrates the promise and capability of the MDI-SG algorithm for efficiently computing high-dimensional integrals. When computing the integral of a 1000-dimensional function using the SG method, the SG sum contained function evaluations, but the MDI-SG algorithm did not compute them one by one. Instead, the symbolic functions were efficiently degenerated through dimension iterations by reusing/sharing many calculations. It should be noted that the MDI-SG algorithm uses of a lot of computer memory when computing high-dimensional integrals.
Table 9.
Computed results for and from the MDI-SG algorithm.
5. Influence of Parameters
There are four parameters in the d-dimensional MDI-SG algorithm; they are , and q, respectively, where represents the choice of one-dimensional numerical quadrature rule, namely, the (composite) trapezoidal rule (), Clenshaw-Curtis rule (), Gauss-Patterson rule (), and Gauss-Legendre rule (). The parameter m stands for the multidimensional iteration step size in the first stage of the algorithm so the dimension of the integration domain is reduced by m in each iteration. In practice, , and it is preferred to be close to q. In this section, we shall evaluate the performance of the MDI-SG algorithm when . It should be noted that after iterations, the algorithm enters its second stage and the iteration step size is changed to s. Because after the first stage the remaining dimension is small, . It should be noted that after iterations, the residual dimension satisfies . Then, in case or 3, one has two options to complete the algorithm. One either just continues the dimension reduction by calling 3d-MDI-SG or 2d-MDI-SG as explained in the definition of Algorithm 3 or computes the remaining two- or three-dimensional integral directly. The effect of these two choices will be tested in this section. Finally, the parameter q represents the precision level of the sparse grid method. Obviously, the larger q is, the higher the accuracy of the computed results. The trade-off comprises more integration points being used, and hence, more cost. In this section, we test the impact of the q value on the MDI-SG algorithm.
5.1. Influence of Parameter r
We first examined the impact of one-dimensional quadrature rules, which are indicated by , in the MDI-SG algorithm.
Test 6. Let and choose the integrand f as
Below, we compare the performance of the MDI-SG algorithm with different r in computing and with the accuracy level and step size .
Figure 5a shows the computed results of from the MDI-SG algorithm. We observed that the choice of one-dimensional quadrature rules had a significant impact on the accuracy and efficiency of the MDI-SG algorithm. The trapezoidal rule () had the lowest precision and used the most integration points, the Clenshaw-Curtis rule () was the second lowest, and the Gauss-Patterson () and Gauss-Legendre rule () had the highest precision. Both the Clenshaw-Curtis and Gauss-Patterson rule use the nested grids, that is, the integration points of the th level contain those of the qth level. Although they used the same number of integration points, the Gauss-Patterson rule was more efficient than the Clenshaw-Curtis rule. Moreover, the Gauss-Patterson rule was more efficient than the Gauss-Legendre rule (), which used the most CPU time and produced the most accurate solution. This comparison suggests that the Gauss-Patterson rule is the superior among these four rules when they are used as the building blocks in the MDI-SG algorithm for high-dimensional integration.
Figure 5.
Performance comparison of the MDI-SG algorithm with , and . (a) Approximate . (b) Approximate .
Figure 5b shows the computational results of from the MDI-SG algorithm. Similarly, the choice of one-dimensional quadrature rules had a significant impact on the accuracy and efficiency of the MDI-SG algorithm. Because the integrand is simple, the MDI-SG algorithm with all four 1-d quadrature rules computed this integral very fast. Again, the trapezoidal rule was least accurate and the other three rules all performed very well; however, a closer look shows that the Gauss-Patterson rule was again the best performer.
5.2. Influence of Parameter m
From the Table 5 and Table 6 and Figure 6 and Figure 7, we can observe that when is fixed, as the dimension d increased, the number of iterations of the MDI-SG algorithm also increased, and the computational efficiency decreased rapidly. In practice, the step size m of the MDI-SG algorithm in the first stage iteration should not be too large or too small. One strategy is to use variable step sizes. After selecting an appropriate initial step size m, this can be decreased during the dimension iteration. The next test presents a performance comparison of the MDI-SG algorithm for .
Figure 6.
(a) Efficiency comparison of the MDI-SG algorithm with , and for approximating . (b) Accuracy comparison of the MDI-SG algorithm with , and different parameters m for approximating .
Figure 7.
(a) Efficiency comparison of the MDI-SG algorithm with , and for approximating . (b) Accuracy comparison of the MDI-SG algorithm with , and different parameters m for approximating .
Test 7. Let , f and be the same as in (35).
We computed these integrals using the MDI-SG algorithm with (Gauss-Patterson rule), and .
Figure 6 presents the computed results of integral in Test 7 from the MDI-SG algorithm. It is easy to see that the accuracy and efficiency of the MDI-SG algorithm with different m were different; this is because the step size m affects the number of iterations in the first stage. It shows that the larger step size m, the smaller the number of iterations and the number of symbolic functions that need to be saved, and the less CPU time used; however, this is at the expense of decreasing the accuracy and a higher truncation error. On the other hand, the smaller step size m, the more accurate the computed results, but at the expense of CPU time. To explain this observation, we notice that when the step size m was large, each iteration reduced more dimensions, and the number of symbolic functions that needed to be saved was less; however, the truncation error generated by the system was larger, although the CPU time used was small. The increase in the system truncation error was due to the augmentation of the iteration step size. This was because, when the iteration step size became large while keeping q fixed, the shared computation in evaluating the sparse grid summation deceased, consequently causing the integration points to become overly sparse. When the step size was small, however, more symbolic functions needed to be saved. This was because each iteration reduced a small number of dimensions, and the error of computed result was smaller, but the CPU time used was larger. We also observed that the MDI-SG algorithm with step size achieved a good balance between CPU time and accuracy.
Figure 7 shows the computed results of in Test 7 for the MDI-SG algorithm. As expected, choosing different parameters m had a significant impact on the accuracy and efficiency of the MDI-SG algorithm. Since function evaluation of the integrand was more complicated, the influence of different parameters m on the MDI-SG algorithm was dramatic. Again, the MDI-SG algorithm with step size struck a balance between CPU time and accuracy.
5.3. Influence of the Parameter s
In this subsection, we tested the impact of the step size s used in the second stage of the MDI-SG algorithm. Recall that the step size works well in the first stage. After iterations, the dimension of the integration domain was reduced to , which is relatively small; hence, s should be small. In practice, we have . The goal of the next test was to provide a performance comparison of the MDI-SG algorithm with .
Test 8. Let , and choose the integrand f as
We computed this integral using the MDI-SG algorithm with (Gauss-Patterson rule), and . Figure 8 displays the computed results. We observed that the same accuracy was achieved in all cases , which was expected. Moreover, the choice of s had little effect on the efficiency of the algorithm. An explanation of this observation is that, because became small after the first stage iterations, the number of the second stage iterations was small, and the special way of performing function evaluations in the MDI-SG algorithm was not sensitive to the small variations in the choice of .
Figure 8.
Efficiency comparison of the MDI-SG algorithm with and .
5.4. Influence of the Parameter q or N
Finally, we examine the impact of the accuracy level q on the MDI-SG algorithm. Recall that the parameter q in the SG method is related to the number of integration points N in one coordinate direction on the boundary. It is easy to check that for the trapezoidal () and Clenshaw-Curtis () quadrature rules, correspond to , for the Gauss-Patterson quadrature rule (), correspond to , and for the Gauss-Legendre quadrature rule (), correspond to . Therefore, we only needed to examine the impact of the parameter N on the MDI-SG algorithm. To the end, we consider the case , and (Gauss-Legendre rule) in the next test.
Test 8. Let and choose the following integrands:
Table 10, Table 11 and Table 12 present the computed results for and , respectively. We observed that the quality of approximations also depends on the behavior of the integrand. For very oscillatory and rapidly growing functions, more integration points must be used to achieve good accuracy.
Table 10.
Performance comparison of the MDI-SG algorithm with for computing .
Table 11.
Performance comparison of the MDI-SG algorithm with for computing .
Table 12.
Performance comparison of the MDI-SG algorithm with for computing .
6. Computational Complexity
6.1. The Relationship between the CPU Time and N
In this subsection, we examine the relationship between the CPU time and parameter N using the regression technique based on the test data.
Test 9. Let , and be the same as in Test 8.
Figure 9 and Figure 10 show the CPU time as a function of N obtained by the least square method and the fitting functions are given in Table 13. All the results indicate that the CPU time grew at most in the polynomial order .
Figure 9.
The relationship between the CPU time and parameter N when for computing (left), (middle), and (right).
Figure 10.
The relationship between the CPU time and parameter N when for computing (left), (middle), and (right).
Table 13.
The relationship between the CPU time and parameter N.
6.2. The Relationship between the CPU Time and the Dimension d
Recall that the computational complexity of the sparse grid method is of the order for computing , which grew exponentially in d with base . The numerical tests presented above overwhelmingly and consistently indicate that the MDI-SG algorithm has hidden capability to overcome the curse of dimensionality, which hampers the sparse grid method. The goal of this subsection is to find out the computational complexity of the MDI-SG algorithm (in terms of CPU time as a function of d) using the regression technique based on numerical test data.
Test 10. Let and consider the following five integrands:
Figure 11 displays the CPU time as functions of d obtained by the least square regression method, whose analytical expressions are given in Table 14. We note that the parameters of the MDI-SG algorithm only affect the coefficients of the fitting functions, but not their orders in d.

Figure 11.
The relationship between the CPU time and dimension d.
Table 14.
The relationship between CPU time as a function of the dimension d.
We also quantitatively characterized the performance of the fitted curve by the R-square in Matlab, which is defined as R-; where represents a test data output, refers to the predicted value, and indicates the mean value of . Table 14 also shows that the R-square of all fitting functions is very close to 1, which indicates that the fitting functions are quite accurate. These results suggest that the CPU time grows at most cubically in d. Combining the results of Test 9 in Section 6.1, we conclude that the CPU time required by the proposed MDI-SG algorithm grows at most in the polynomial order .
7. Conclusions
This paper presents an efficient and fast implementation algorithm (or solver), called the MDI-SG algorithm, for high-dimensional numerical integration using the sparse grid method. It is based on combining the idea of dimension iteration/reduction combined with the idea of computing the function evaluations at all integration points in cluster so many computations can be reused. It was shown numerically that the computational complexity (in terms of the CPU time) of the MDI-SG algorithm grows at most cubically in the dimension d, and overall in the order , where N denotes the maximum number of integration points in each coordinate direction. This shows that the MDI-SG algorithm could effectively circumvent the curse of dimensionality in high-dimensional numerical integration; hence, this shows that sparse grid methods are not only competitive but can excel in the job. Extensive numerical tests were conducted to examine the performance of the MDI-SG algorithm and to carry out performance comparisons with the standard sparse grid method and with the Monte Carlo (MC) method. It was shown that the MDI-SG algorithm (regardless of the choice of the 1-d base sparse grid quadrature rules) is faster than the MC method in low and medium dimensions (i.e., ), much faster in very high dimensions (i.e., ), and succeeds even when the MC method fails. An immediate application of the proposed MDI-SG algorithm is to solve high-dimensional linear PDEs based on the integral equation formulation, which will be reported in a forthcoming work.
Author Contributions
Conceptualization, X.F.; methodology, H.Z. and X.F.; code and simulation, H.Z.; writing—original draft preparation, H.Z.; writing—revision and editing, X.F. All authors have read and agreed to the published version of the manuscript.
Funding
The work of X.F. was partially supported by the NSF grants: DMS-2012414 and DMS-2309626.
Data Availability Statement
All datasets generated during the current study are available from the corresponding author upon reasonable request.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Griebel, M.; Holtz, M. Dimension-wise integration of high-dimensional functions with applications to finance. J. Complex. 2010, 26, 455–489. [Google Scholar] [CrossRef]
- LaValle, S.M.; Moroney, K.J.; Hutchinson, S.A. Methods for numerical integration of high-dimensional posterior densities with application to statistical image models. IEEE Trans. Image Process. 1997, 6, 1659–1672. [Google Scholar] [CrossRef] [PubMed]
- Barraquand, J.; Martineau, D. Numerical valuation of high dimensional multivariate American securities. J. Financ. Quant. Anal. 1995, 30, 383–405. [Google Scholar] [CrossRef]
- Quackenbush, J. Extracting biology from high-dimensional biological data. J. Exp. Biol. 2007, 210, 1507–1517. [Google Scholar] [CrossRef] [PubMed]
- Azevedo, J.D.S.; Oliveira, S.P. A numerical comparison between quasi-Monte Carlo and sparse grid stochastic collocation methods. Commun. Comput. Phys. 2012, 12, 1051–1069. [Google Scholar] [CrossRef]
- Gerstner, T.; Griebel, M. Numerical integration using sparse grids. Numer. Algorithms 1998, 18, 209–232. [Google Scholar] [CrossRef]
- Bungartz, H.-J.; Griebel, M. Sparse grids. Acta Numer. 2014, 13, 147–269. [Google Scholar] [CrossRef]
- Caflisch, R.E. Monte Carlo and quasi-Monte Carlo methods. Acta Numer. 1998, 7, 1–49. [Google Scholar] [CrossRef]
- Ogata, Y. A Monte Carlo method for high dimensional integration. Numer. Math. 1989, 55, 137–157. [Google Scholar] [CrossRef]
- Dick, J.; Kuo, F.Y.; Sloan, I.H. High-dimensional integration: The quasi-Monte Carlo way. Acta Numer. 2013, 22, 133–288. [Google Scholar] [CrossRef]
- Hickernell, F.J.; Müller-Gronbach, T.; Niu, B.; Ritter, K. Multi-level Monte Carlo algorithms for infinite-dimensional integration on RN. J. Complexity 2010, 26, 229–254. [Google Scholar] [CrossRef][Green Version]
- Kuo, F.Y.; Schwab, C.; Sloan, I.H. Quasi-Monte Carlo methods for high-dimensional integration: The standard (weighted Hilbert space) setting and beyond. ANZIAM J. 2011, 53, 1–37. [Google Scholar] [CrossRef]
- Lu, J.; Darmofal, L. Higher-dimensional integration with Gaussian weight for applications in probabilistic design. SIAM J. Sci. Comput. 2004, 26, 613–624. [Google Scholar] [CrossRef]
- Wipf, A. High-Dimensional Integrals. In Statistical Approach to Quantum Field Theory; Springer Lecture Notes in Physics; Springer: Berlin/Heidelberg, Germany, 2013; Volume 100, pp. 25–46. [Google Scholar]
- E, W.; Yu, B. The deep Ritz method: A deep learning-based numerical algorithm for solving variational problems. Commun. Math. Stat. 2018, 6, 1–12. [Google Scholar] [CrossRef]
- Lu, L.; Meng, X.; Mao, Z.; Karniadakis, G.E. DeepXDE: A deep learning library for solving differential equations. SIAM Rev. 2021, 63, 208–228. [Google Scholar] [CrossRef]
- Sirignano, J.; Spiliopoulos, K. DGM: A deep learning algorithm for solving partial differential equations. J. Comput. Phys. 2018, 375, 1339–1364. [Google Scholar] [CrossRef]
- Han, J.; Jentzen, A.E.W. Solving high-dimensional partial differential equations using deep learning. Proc. Natl. Acad. Sci. USA 2018, 115, 8505–8510. [Google Scholar] [CrossRef]
- Xu, J. Finite neuron method and convergence analysis. Commun. Comput. Phys. 2020, 28, 1707–1745. [Google Scholar] [CrossRef]
- Feng, X.; Zhong, H. A fast multilevel dimension iteration algorithm for high dimensional numerical integration. arXiv 2022, arXiv:2210.13658. [Google Scholar]
- Yang, X.; Wu, L.; Zhang, H. A space-time spectral order sinc-collocation method for the fourth-order nonlocal heat model arising in viscoelasticity. Appl. Math. Comput. 2023, 457, 128192. [Google Scholar] [CrossRef]
- Burden, R.L.; Faires, J.D. Numerical Analysis, 10th ed.; Cengage Learning: Boston, MA, USA, 2015. [Google Scholar]
- Smolyak, S.A. Quadrature and Interpolation Formulas for Tensor Products of Certain Classes of Functions; Russian Academy of Sciences: Saint Petersburg, Russia, 1963; Volume 148, pp. 1042–1045. [Google Scholar]
- Maruri-Aguilar, H.; Wynn, H. Sparse polynomial prediction. Stat. Pap. 2023, 64, 1233–1249. [Google Scholar] [CrossRef]
- Deluzet, F.; Fubiani, G.; Garrigues, L.; Guillet, C.; Narski, J. Sparse grid reconstructions for Particle-In-Cell methods. ESAIM: Math. Model. Numer. Anal. 2022, 56, 1809–1841. [Google Scholar] [CrossRef]
- Wu, J.; Zhang, D.; Jiang, C. On reliability analysis method through rotational sparse grid nodes. Mech. Sys. Signal Process. 2021, 147, 107106. [Google Scholar] [CrossRef]
- Baszenki, G.; Delvos, F.-J. Multivariate Boolean Midpoint Rules, Numerical Integration IV; Birkhäuser: Basel, Switzerland, 1993; pp. 1–11. [Google Scholar]
- Paskov, S.H. Average case complexity of multivariate integration for smooth functions. J. Complex. 1993, 9, 291–312. [Google Scholar] [CrossRef]
- Bonk, T. A new algorithm for multi-dimensional adaptive numerical quadrature. In Adaptive Methods—Algorithms, Theory and Applications; Vieweg/Teubner Verlag: Wiesbaden, Germany, 1994; pp. 54–68. [Google Scholar]
- Novak, E.; Ritter, K. The curse of dimension and a universal method for numerical integration. In Multivariate Approximation and Splines; Birkhäuser: Basel, Switzerland, 1997; pp. 177–187. [Google Scholar]
- Novak, E.; Ritter, K. High dimensional integration of smooth functions over cubes. Numer. Math. 1996, 75, 79–97. [Google Scholar] [CrossRef]
- Patterson, T.N.L. The optimum addition of points to quadrature formulae. Math. Comp. 1968, 22, 847–856. [Google Scholar] [CrossRef]
- Novak, E.; Ritter, K. Simple Cubature Formulas for d-Dimensional Integrals with High Polynomial Exactness and Small Error; Report; Institut für Mathematik, Universität Erlangen–Nürnberg: Nürnberg, Germany, 1997. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).