A randomized trapezoidal quadrature

A randomized trapezoidal quadrature rule is proposed for continuous functions which enjoy less regularity than commonly required. Indeed, we consider functions in some fractional Sobolev space. Various error bounds for the randomized rule are established while an error bound for classical trapezoidal quadrature is obtained for comparison. The randomized trapezoidal quadrature rule is shown to improve the order of convergence by half.


Introduction
It is well known that the trapezoidal quadrature in classical numerical analysis is a technique for approximating R d -valued definite integral when the integrand is at least twice differentiable. It has been well-studied by Goodwin [7], Schwartz [9] and Stenger [10]. The case of a rough integrand was investigated in [3]. More recently, a stochastic version of the trapezoidal quadrature was proposed for approximating the Itô integral where the integrator is a Brownian motion [5].
Without loss of generality, we consider the time interval [0, T] and let g ∈ C 2 ([0, T]) to be the integrand of interest, where C 2 ([0, T]) := C 2 ([0, T]; R d ) is the space of R d -valued continuous functions that have continuous first two derivatives, endowed with the uniform norm topology. The trapezoidal quadrature is proven to achieve a order of convergence as high as 2 for evaluating the integral I[g] := T 0 g(t) dt with finite many point evaluations [4]. To implement this, we first partition the interval [0, T] into N equidistant intervals with stepsize h N = T N , i.e.
where the subscription N is suppressed in h for the sake of notational simplicity but assumed implicitly in all of the quantities introduced involving h. Define When g has less regularity, the trapezoidal quadrature shows a slower convergence with a sharp bound [3]. To accelerate the convergence when g is 'rougher', we consider a randomized trapezoidal quadrature, which is inspired by the randomized version of mid-point Runge-Kutta quadrature rule [8] and stochastic version of trapezoidal quadrature for Itô integral [5]. In this paper, the R d -valued integrand g is assumed to be in fractional Sobolev space W σ ,p (0, T) under Sobolev-Slobodeckij norm: for σ ∈ (1, 2) and p ∈ [2, ∞). We may write g W σ ,p (0,T) as g W σ ,p for short. Let us define a randomized trapezoidal quadrature as follows: where {τ i } N−1 i=0 is a sequence of independent and identically (i.i.d.) uniformly distributed random variables on a probability space ( , F, P),τ i := 1 − τ i and [N] := {1, . . . , N}. The main result, Theorem 3.2, shows that the convergence rate can be improved to O(N −σ − 1 2 ) compared to O(N −σ ) achieved by the classical trapezoidal quadrature (Theorem 3.1) when g ∈ W σ ,p .
The paper is organized as follows. In Section 2, we present some prerequisites from probability theory. In Section 3, we give the error estimates for both the classical trapezoidal quadrature and the randomized trapezoidal quadrature. In addition, we also investigate the error estimate in almost sure sense for the randomized trapezoidal quadrature in Theorem 3.3, which is proven still superior to the classical one. In the last section, we verify the results through several numerical experiments.

Preliminaries
This section is devoted to a brief review of essential probability results for audience who are not familiar with probability theory. Most of the contents are repeated material from Section 2 in [8].
One may refer to [2] for a more detailed introduction.
Recall that a probability space ( , F, P) consists of a measurable space ( , F) endowed with a finite measure P satisfying P( ) = 1. A random variable X : Then, the expectation of X is defined as where μ X is distribution of X on its image space. We write X ∈ L p ( ; We will write X L p ( ;R) as X L p ( ) for short. We say that a family of R d -valued random variables (X m ) m∈N is a discrete-time stochastic process if we interpret the index m as a time parameter. A crucial concept in our main proof is martingales, which is a special case of the discrete-time stochastic process with many nice properties. If (X m ) m∈N is an independent family of integrable random variables satisfying E[X m ] = 0 for each m ∈ N, then the stochastic process defined by the partial sums is a discrete-time martingale. One of the most important inequalities for martingales is the Burkholder-Davis-Gundy inequality. In this paper, we need its discrete-time version.
where [X] n = |X 1 | 2 + n k=2 |X k − X k−1 | 2 denotes the quadratic variation of (X n ) n∈N up to n.

Trapezoidal quadratures for a rougher integrand
This section investigates the errors from trapezoidal rules for approximating integral of g ∈ W σ ,p . The error bound from the classical trapezoidal rule is obtained in Section 3.1 and the ones from the randomized trapezoidal rule is in Section 3.2.

Classical trapezoidal quadrature for g ∈ W σ ,p
where C is a constant that only depends on p.
Proof: To show Equation (5), we follow [5] to rewrite where t i+ 1 2 := 1 2 (t i + t i+1 ). Then, the LHS of Equation (5) can be rewritten as and Regarding E i,i+1 1 , first note that where the second line is deduced by applying Hölder's inequality twice, and 1 q := 1 − 1 p . For the case σ = 1 and any p ≥ 2, we may directly apply the discrete Hölder's inequality to the last term above: For the case σ ∈ (1, 2) and any p ≥ 2, we may first make use of the definition of W σ ,p and then apply the discrete Hölder's inequality: For term E i,i+1 2 , we can follow a similar argument in [5] to show that Indeed, note that If defining a new process Thus applying a similar argument as for N−1 i=0 E i,i+1 1 , we can show that Finally, we can conclude that For the classical trapezoidal quadrature (CTQ), Theorem 3.1 claims that its order of convergence would be the same as the regularity of the integrand. For the boundary case, when g ∈ W 1,p , the order is 1.

Randomized trapezoidal rules for g ∈ W σ ,p
For the randomized trapezoidal quadrature (4), the proof follows a similar argument as in Theorem 4.2 [8].
where C p is a constant that depends only on p.
Proof: First, due to g ∈ W σ ,p we have is unbiased, we need to examine each term in RHS of Equation (4) through spelling out the expectation and changing variable, i.e.
Summing these terms up gives that RQ τ ,n h [g] is unbiased for I n [g]. Furthermore, if define the error term like then each summand is a mean-zero random variable, i.e.
Note that the summands are mutually independent due to the independence of {τ i } N−1 i=0 . In addition, it is easy to show E n ∈ L p ( ; R d ). Therefore, E n is a L p -martingale. Then applying the discrete version of the Burkholder-Davis-Gundy inequality leads to where in the second line we substitute the quadratic variation [E n ] N . Due to symmetric property, it is easy to see we only need to handle the first term on the RHS of Equation (15). Note that Then we have that When p = 2, the term on the right-hand side above can be directly bounded by where 1 q + 1 p = 1. For p > 2, we may apply discrete Hölder inequality and get Now, we have shown Bound (13) when σ = 1. For Bound (13) under σ > 1, we first note that Equation (6) remains true if replacing t i by t i + τ i h and t i+1 by t i +τ i h, i.e.
Thus, the second line of Equation (15) can be further split as the follows: Similar as in the proof of Theorem 3.1, we introduce E i,i+1 1 defined in Equation (7) and As in the proof of Theorem 3.1, E i,i+1 1 can be handled through the equivalent form Equation (9) and E i,i+1 2 (τ ) can be treated in a similar way as Equation (11) by replacing t i by t i + τ i h and t i+1 by t i +τ i h in the inner integral of Equation (11), i.e.
where the first term on the right-hand side from Equation (9) and the second term is due to Equation (21). Let us now deal with the first term, the second term can be handled in the same way. Following a similar argument in (16), we have that where we apply Hölder's inequality in Line 4 and 5. Similarly as in (17), for p = 2 we have that Applying discrete Hölder inequality for p > 2 as in (18), we have that Altogether we have achieved Bound (13).
For a fixed integrand, the randomized quadrature rule (RTQ) improves the order of convergence by 1 2 through incorporating randomness compared to Theorem 3.1. One may also be interested in the almost sure convergence of RTQ. Indeed, the argument from [8,Theorem 3.2] can be directly adapted here: where N h m := T h m , i.e. the integer part of T h m .
Theorem 3.3 ensures that RTQ can achieve a slightly better order of pathwise convergence in the almost sure sense compared to CTQ when stepsize is adequately small.

Numerical experiments
In this section, we assessed the proposed method via different experiments. For simplicity, we fix T = 1.
The results of our simulations are shown in Figure 2 and Table 1. Across all different values of γ , RTQ gave the higher order of convergence compared to CTQ. When γ increased from 5 4 to 7 4 , the order of convergence for RTQ increased eventually to a number very close to 2.5. Note that the order of convergence for CTQ are not beyond 2 for all γ values. All the performances were superior to theoretical order of convergences shown in Theorems 3.1 and 3.2. We also examined the computational   efficiency of both methods (lower right in Figure 2). Though incorporating randomness increased computational expense, RTQ quickly offsetted its cost with its higher accuracy.

Example 2
Consider the function: where B(s) is a realization of standard Brownian motion (BM) (cf. Section 3.1 in [6]). It is well known that B ∈ C 1 2 − for arbitrary small > 0, therefore g B ∈ W 3 2 − ,p for p > 1. Figure 3 illustrates how one BM path looks like and the curve of its g B .We are interested in approximating I[g B ].
Due to the nature of BM, it is not easy to obtain the exact value of g B . To approximating terms g B (t n ), one simply applies the Euler method, i.e. For CTQ, for a fixed stepsize h ∈ [0, 1], we have that

Disclosure statement
No potential conflict of interest was reported by the author(s).

Funding
This work was supported by the Alan Turing Institute under the Engineering and Physical Sciences Research Council (EPSRC) grant EP/N510129/1 and by EPSRC though the project EP/S026347/1, titled 'Unparameterized multi-modal data, high order signatures, and the mathematics of data science'.