The Richardson extrapolation can also be applied to
improve numerical integration (with resulting method
called Romberg Method). Recall the composite trapezoidal
rule in Eq. (71):
where . In theory, taking the limit
we get
, becomes the true integral
:
|
(138) |
Of course this approach is not practical computationally.
However, we can apply the Richardson extrapolation to increase
the order of the error terms and improve the accuracy.
Specifically, we introduce another variable such that
,
. We further
define
and get
|
(139) |
Now , , and
become ,
, and , respectively, and the composite
trapezoidal method above becomes
Comparing this to the
Euler-Maclaurin Formula:
|
(141) |
we get
where denotes the method of the composite trapezoidal
rule
|
(143) |
with a step size and an error term , and
|
(144) |
Now we can use the Richardson extrapolation to improve
the accuracy of this method , by replacing in
Eq. (142) by :
|
(145) |
and then Subtract Eq. (98) from 4 times this equation to get
|
(146) |
where
|
(147) |
is a new method with a step size and an error term .
The accuracy can be further improved by the same process. Again
replacing in by and repeating the same steps
we get
|
(148) |
where we defined a new method:
|
(149) |
with a step size and an error term .
Example:
Find the integral of the Gaussian function with zero mean and
unit standard deviation:
|
(150) |
Initially, we set ,
, and approximate
the integral by the trapezoidal rule:
|
(151) |
We proceed with and
and approximate
the integral by
|
(152) |
We can now obtain a new method by Richardson's extrapolation to
generate a more accurate result:
|
(153) |
This process is carried out further recursively to generate the
results shown in the table below. Every time the row index
is increased by 1, the step size is halved; and every
time the column index is increased by 1, a new method is
obtained by more more level of recursion. All results in the nth
column are generated by the same method but based on different
step sizes; all results in the mth row are generated by different
methods but all based the same step size . Each element
in the table is obtained based on its left neighbor
and its top-left neighbor
by the recursion:
|
(154) |
The most accurate result at each recursion level is on the diagonal
of the table. In this specific case,
is the
most accurate result achieved after levels of recursion using
a step size
.
The last row shows the relative errors of the five methods
along the diagonal.
The Matlab code used to generate this table is shown below:
h=b-a; % initial step size
n=5; % number of recursions
m=n;
I=zeros(n); % initializing array I
for i=1:m % for all rows
n=2^(i-1);
I(i,1)=(f(a)+f(b))/2;
for k=1:n-1
I(i,1)=I(i,1)+f(a+k*h);
end
I(i,1)=h*I(i,1); % composite trapezoidal rule
for j=2:i % for all columns (Richardson extrapolation)
I(i,j)=(4^(j-1)*I(i,j-1)-I(i-1,j-1))/(4^(j-1)-1);
end
h=h/2;
end