The Richardson extrapolation can be applied to improve
numerical differentiation. Recall that the derivative
can be approximated by the central difference
based on two neighboring points and with step
size and a truncation error term , as shown in
Eq. (6):
where
|
(126) |
The accuracy of this method can be improved by the
Richardson extrapolation considered previously. We first
replace in the equation above by :
|
(127) |
and then we get
|
(128) |
where
is a new method based on the four points
and 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:
|
(130) |
where we defined a new method:
based on six points
, with a step
size and an error term . Note that and
are actually the same methods previously derived by
the undetermined coefficients approach. However, we now realize
that by the process discussed above can be recursively carried
out to obtain methods , , etc., with progressively more
accurate results.
The process of the Richardson extrapolation can be repeatedly
carried out to improve the accuracy.
Example:
Find the derivative of the Gaussian function
at
. Initially, we set and use the divided difference
method with a step size :
|
(132) |
We proceed with for the same method but for a smaller
step side
:
|
(133) |
We now obtain a new method by Richardson's extrapolation to
generate a more accurate result:
|
(134) |
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 one 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:
|
(135) |
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 compared with the ground truth
|
(136) |
The Matlab code used to generate this table is shown below:
h=1; % inital step size
n=5; % number of recursions
m=n;
D=zeros(n); % initializing array D
for i=1:m % for all rows
n=2^(i-1);
D(i,1)=(f(x+h)-f(x-h))/2/h;
for j=2:i % for all columns
D(i,j)=(4^(j-1)*D(i,j-1)-D(i-1,j-1))/(4^(j-1)-1);
end
h=h/2;
end