0
$\begingroup$

I have this formula calculated by excel: $y = -0.0001x^3 + 0.0294x^2 - 0.0567x - 68$

This formula was calculated using this data:

Data1      Data2 0           -68 50          -11 75           47 100         111 

What I need to way to calculate the same 3rd degree polynomial, but using this data.

Data1      Data2 a           -68 b           -11 c            47 d           111 

I appreciate any tips or links that would help me to solve this.

Thanks in advance

  • 0
    You can't. When I solve y=-11, I get three values for x.2018-06-16

2 Answers 2

2

Given $n+1$ points, you can uniquely fit a degree $n$ polynomial (e.g. with the help of Lagrange polynomials).

For a degree one polynomial, a line, you need two points (makes sense, right?). The formula looks like $L(x) = \dfrac{x-x_0}{x_1-x_0}f(x_1) + \dfrac{x-x_1}{x_0-x_1}f(x_0),$

Where the points are $(x_0,f(x_0)), (x_1,f(x_1))$

Notice here what happens to the left summand when we plug in $x_0$: we get zero contribution from this term; whereas, when we plug in $x_1$, we recover the function $f(x_1)$ that we're trying to reach. Notice also that when we plugged in $x_0$ and $x_1$, the RHS went to $f(x_0)$ and $0$ respectively as well. Thus $L(x_1) = f(x_1)$ and $L(x_0) = f(x_0)$. We "constructed" a polynomial given two pairs of points that hits them with least degree needed.

For three points (quadratic), you want the similar cancellation effect:

$L(x) = \dfrac{x-x_0}{x_1-x_0}\dfrac{x-x_2}{x_1-x_2}f(x_1) +\dfrac{x-x_1}{x_0-x_1}\dfrac{x-x_2}{x_0-x_2}f(x_0) + \dfrac{x-x_1}{x_2-x_1}\dfrac{x-x_0}{x_2-x_0}f(x_2)$

See how the magic happens there? You should be able to construct the fourth degree polynomial from here. Hope this helps.

  • 0
    well done. I would only add that this is all done under the assumption that no two of the $n+1$ points lie on the same vertical line, which is to say no two of the numbers $x_0,x_1,\dots$ are equal.2011-07-01
2

Four points with distinct $x$-coordinates will yield a unique cubic going through them. However, this interpolation to other $x$-values could be completely irrelevent. What are you modeling?

  • 0
    +1: As other have pointed out, it is easy to find a polynomial matching a collection of data points, but that is surely a very wrong way of going about modeling. For example, it is hard to tell, how accurate the data is, so I would be very hesitant to start drawing conclusions. If there were a few dozen data points, and they would follow a cubic polynomial reasonably accurately, then there could be something there. Instead, try to come up with an educated guess of the type of function with a couple parameters, make a least square fitting, and see how well that predicts new data points2011-07-01