Quantifying Errors: Approximate Error
|
In this segment we'll talk about
approximate errors. So, in a numerical method, the error can come from
truncation error or from, or/and from round off error. Truncation error is
where you’re approximating a procedure –for example you're trying to find the
value of a series sum of a series and you're only taking a finite number of
terms. That is a type of truncation error. And round off error is coming from
approximating numbers. So, in any numerical method which you're going to use
to be able to solve a problem what you'll have to do is you'll have to
identify where the error is coming from. You’ll have to then quantify that
error, and then of course minimize that error as per your needs. So in this segment we are going to basically concentrate
on the quantifying of the error and the error which we are going to talk
about here is approximate error. And in a numerical method you won't be privy
to the true value because that's why you're using numerical method in the
first place, so in an approximate error mean will mean that hey maybe you're
using some kind of iterative procedure what you have some kind of uh
approximation, and you had a previous approximation and what you're trying to
do is, you’re trying to, based on that, you might be able to define what the
important approximate error is so let's go and define approximate data and
then we'll go through an example which would be a better way of figuring out
what this all about. So, the approximate error which is donated by E sub a is
equal to present approximation minus the previous approximation. That’s what
we call it. So, e sub a is the is the symbol by
which it is donated and denoted and then we have defined as present
approximation previous approximation. So,
you got to have two approximations to be able to find out what the
approximate error is. And it will be
clear once we do an example so let's go ahead and do that. So, let's go and
take an example of the approximate error so here we are given that we are
defining the derivative of a function by this approximate formula. And then
we want to find out the derivative of this function here at x equal to 2 but
what we're doing is we're using two different step sizes of h = 0.3 and h =
0.15. And this is what is going to give us the current and previous
approximation. So, we're going to say that hey this one will give us the
previous one because a larger step size, and this one is going to give us the
present approximation. So that's how we are going to be able to find the
approximate error. So, let's go and see how do we go
about doing that. So, we are given that f’(x) is approximately given as this
formula right here, and what we're going to do is we're going to start with
our previous approximation which will be obtained by using a step size of
0.3, x is of course 2 so that gives us f prime of 2 equal
to this quantity right here. So, what this implies is that we have to calculate the value of the function at these two
different points, so this number would be 7 * e^(0.5*2.3) – 7*e^(0.5*2)
divided by 0.3 right here. And this number will here turn out to be 10.263.
So, this number here is my previous approximation of f prime 2 because this
is the largest step size. Now let's go and redo this calculation exactly the same calculation but with a step size of 0.15.
So again, we have f prime of x which
is approximately equal to this quantity right. And f prime of 2 so x is 2 and
h is 0.15, based on that, will be this quantity right here. So, what this
implies is that we are calculating the value of the function at two different
points and 2.15 and 2 so it would be as follows. And this value here will
turn out to be 9.8800. So, this is our current approximation. So we have a previous approximation a current approximate,
so we should be able to calculate whatever absolute relative approximate
sorry our approximate. So, let's see what our approximate error is now: Approximate
error e sub a will be equal to current approximation minus the previous
approximation. And the current approximation is what we obtained with the
h=0.15, which is 9.8800 and what did we obtain with the previous approximation—10.263.
And this number here turns out to be equal to -0.38300. So that is the
approximate error. Now, if somebody asked you that hey does this approximate
error looks small or large that might be something which just by looking at
the number itself, may not give you a good glimpse. So, for example if we the
same example which we just did, we had 7 * e^(0.5*x). So, let's suppose
somebody changed the only one, one thing in the whole problem and said hey, your function is this they just instead of 7 they put
7 times 10 to the power -6, do you know what's going to happen to the
absolute sorry the approximate error? The approximate error is going 0.38300
times 10 to the power -6. So just by doing a slightly different problem you
may think that hey this number is so small, so the approximate error is small.
So that's why in order to get a good glimpse of how
much really the approximate error is, what we do is we talk about something
called the relative approximate error. So, the relative approximate error
which is denoted by epsilon a, and that is defined as hey what is the
approximate error divided by the current approximation. That's it. So, what that will give you is a relative
sense of how much error do you really have. Let's go and take the same
example and say hey let's go and calculate the relative approximate for the
same example as we had before and see that hey is it any different, what do
we gather from there. So, this is the example which we had taken previously
uh the only difference is that we have we have we're calculating the relative
approximate error. The function is still the same, what are we calculating
the derivative, what step sizes we're using is exactly the
same. So, let's go and see how we can calculate the relative
approximate error. So, from the previous example we have that the approximate
error, that's e sub a, is equal to the present approximation, which we had
calculated in the previous uh example, which was these quantities so this
this is a present approximation previous approximation, and we get 0.38300. So
now the question is that hey what is the absolute what is the relative
approximate error? What is the relative approximate error? So, the relative approximate error will be
equal to the approximate error which we're getting divided by the current
approximation. So, we just found out that the approximate error is this, and
this was done also in the previous example, the current approximation is this,
so we get an approximate relative approximate error of -0.038765. And so now
we have a good sense of what the approximate error relatively is, and many
times you may be asked to write down epsilon a as a percentage, so it'll be
just multiplying this number here by 100. So, you will get 3.8765%. Many times,
they may ask you to calculate the absolute relative approximate error, then
in that case it is just the magnitude of the numbers. So, we have either this
or this if you're writing in terms of percentages and that's the that's how
we calculate the relative approximate error. Later on,
you will see that these approximate relative approximate errors which we have
calculated like here and here these are bearing or how many significant
digits will be at least correct in our answer. So, it's all uh related to
each other so don't uh look at this as a as an isolated case. And you are going
to be talking about true errors relative, true errors approximate errors, and
relative approximate errors throughout the course. So, grabbing the concept
is extremely important. And that is the end of this segment. |