Calculating the relative error of an interpolation polynomial

Click For Summary

Homework Help Overview

The discussion revolves around calculating the relative error of interpolation polynomials, specifically comparing a first-degree polynomial, ##p_1##, and a second-degree polynomial, ##p_2##, at a given point, ##x=2##. Participants are exploring how to define and calculate absolute and relative errors based on the values produced by these polynomials.

Discussion Character

  • Exploratory, Assumption checking, Conceptual clarification

Approaches and Questions Raised

  • Participants discuss whether to use ##p_2(2)## as the "true value" for relative error calculations and question the correctness of their proposed formulas for absolute and relative errors. There is also uncertainty about the interpretation of the term 'errors' in the context of the problem.

Discussion Status

Some participants have provided insights into the relationship between the two polynomials and their respective data points, while others express confusion regarding the implications of the problem's wording and the potential for division by zero in the relative error calculation. The discussion is ongoing, with various interpretations being explored.

Contextual Notes

It is noted that both polynomials are based on the same set of data points, with ##p_2## likely using three points due to its degree. Participants are also considering the implications of ##p_2(a) = 0## on the calculations.

bremenfallturm
Messages
81
Reaction score
13
Homework Statement
You have created two interpolation polynomials, ##p_1## of degree ##1## and ##p_2## of degree ##2##. At the point ##x=2##, you get the following values
$$
\begin{cases}
p_1(2)=16.52848966 \\
p_2(2)=14.1764705
\end{cases}
$$
Approximate the absolute and relative errors in y at ##x=2##.
Relevant Equations
Interpolation absolute error can be approximated as
##|p_{n}(a)-p_{n+1}(a)|## where ##p_{n}## represents a polynomial of degree n and ##a## the point where the absolute error is to be calculated.
Hi!

It's been a while since I've done this and I am unsure about the relative error. Should I use ##p_2(2)## as the "true value" for the relative error, that is, be in the denominator?

Or in other words, is this correct?

Absolute error : ##|p_1(2)-p_2(2)|=|16.52848966−14.01764705|##
Relative error: ##\frac{|16.52848966−14.01764705|}{|14.01764705|}##
 
Physics news on Phys.org
Hi,

bremenfallturm said:
Homework Statement: You have created two interpolation polynomials, ##p_1## of degree ##1## and ##p_2## of degree ##2##. At the point ##x=2##, you get the following values
$$
\begin{cases}
p_1(2)=16.52848966 \\
p_2(2)=14.1764705
\end{cases}
$$
Approximate the absolute and relative errors in y at ##x=2##.
Relevant Equations: Interpolation absolute error can be approximated as
##|p_{n}(a)-p_{n+1}(a)|## where ##p_{n}## represents a polynomial of degree n and ##a## the point where the absolute error is to be calculated.

It's been a while since I've done this and I am unsure about the relative error. Should I use ##p_2(2)## as the "true value" for the relative error, that is, be in the denominator?

Or in other words, is this correct?

Absolute error : ##|p_1(2)-p_2(2)|=|16.52848966−14.01764705|##
Relative error: ##\frac{|16.52848966−14.01764705|}{|14.01764705|}##

The question confuses me, since it says 'errors'
bremenfallturm said:
Approximate the absolute and relative errors in y at ##x=2##.
You only give an estimate of the error in ##p_1##, which may well be what the exercise composer intended. But he/she could just as well be asking for expressions in terms of derivatives...

And: what are ##p_1## and ##p_2## based on ? The same set of data points ? Or does ##p_2## have twice as many ?

Finally: what if ##p_2(a) = 0## ?

##\ ##
 
Last edited:
BvU said:
Hi,



The question confuses me, since it says 'errors'

You only give an estimate of the error in ##p_1##, which may well be what the exercise composer intended. But he/she could just as well be asking for expressions in terms of derivatives...

And: what are ##p_1## and ##p_2## based on ? The same set of data points ? Or does ##p_2## have twice as many ?

Finally: what if ##p_2(a) = 0## ?

##\ ##
Sorry, the question is not in English so I translated it. It is supposed to say "error". It is also given that ##p_1## and ##p_2## are based on the same data points. Though I assume this means that ##p_2## are based on 3 datapoints since it is a 2nd degree polynomial and ##p_1## are based on 2 of those datapoints.

If ##p_2(a)=0##, then we do have a problem indeed as division by zero makes the quotient go to infinity. Actually I am not sure how that would be handled? I have been confused by taht in the past and never sorted it out.
 
bremenfallturm said:
It is also given that p1 and p2 are based on the same data points. Though I assume this means that p2 are based on 3 datapoints since it is a 2nd degree polynomial and p1 are based on 2 of those datapoints.
Possible: yes. Fair ? Hmmm... piecewise linear would be fairer

Suppose you have three points (I took ##e^x\ ##, x = 1, 2, 3) then a first attempt would be something like

1735856405399.png


with deviations from ##e^x## as follows:

1735857900280.png


So red is the absolute error for the linear interpolation.
| red minus green | would be the error estimate for the absolute error.
And yellowish is that divided by ##p_2## (The estimate for the relative error. No worry about 1/0)

The purple line is the actual relative error (i.e. |(red - ##e^x##)| / ##e^x##)

Draw your own conclusions ...

(but clearly there is no reason for 10 digit reporting :wink: )

##\ ##
 
BvU said:
(but clearly there is no reason for 10 digit reporting :wink: )
Oh yeah, definitely not. Thanks for the pointers in the right direction? Now I'm just left with a curious bonus question (feel free to fill in if you have time ;))
bremenfallturm said:
If , then we do have a problem indeed as division by zero makes the quotient go to infinity. Actually I am not sure how that would be handled? I have been confused by taht in the past and never sorted it out.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 65 ·
3
Replies
65
Views
8K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K