Register to reply 
Write an equation based on data 
Share this thread: 
#1
Oct2313, 08:58 PM

P: 180

Hi,
I am trying to understand what is the best way to solve problems like the one below. I have a few data points and I need to which function best describes that data. (x, y) = (3, 32) (2, 16) (1, 8) (0,4) (1,2) (2, 1) note that the y parameter in the first data point is 32 and not 32. Is there a process to solve such problems or do I have to guess the function? Thanks. 


#2
Oct2313, 11:56 PM

P: 746

put it on a graph and see what you get using excel



#3
Oct2413, 07:45 AM

Math
Emeritus
Sci Advisor
Thanks
PF Gold
P: 39,552

There are, of course, an infinite number of functions whose graphs go through those points. The unique fifth degree polynomial that fits is the Lagrange polynomial:
[tex]32\frac{(x+ 2)(x+ 1)(x)(x 1)(x 2)}{(3+2)(3+ 1)(3)(3 1)(32)}+ 16\frac{(x+ 3)(x+ 1)(x)(x 1)(x 2)}{(2+3)(2+ 1)(2)(2 1)(22)}+ 8\frac{(x+ 3)(x+ 2)(x)(x 1)(x 2)}{(1+3)(1+ 2)(3)(11)(12)}+ 4\frac{(x+ 3)(x+ 2)(x+1)(x 1)(x 2)}{(0+3)(0+2)(0+ 1)(0 1)(02)}+ 2\frac{(x+3)(x+ 2)(x+ 1)(x)(x 2)}{(1+ 3)(1+2)(1+ 1)(1)(12)}+ \frac{(x+ 3)(x+ 2)(x+ 1)(x)(x 1)}{(1+ 3)(1+2)(3+ 1)(3)(32)}[/tex] 


#4
Oct2513, 03:13 PM

P: 28

Write an equation based on data
There are several methods for example newton's forward difference interpolation which though quite difficult to do and limited in the fact that you have to have a constant difference between the terms it is very effective, because if the data points are from an arithmetic series it will give you an expression of the series. Above is an example of Lagrange's method which is far easier to do, less limited as the data points can be anything and returns a polynomial that works.



#5
Oct2613, 10:16 PM

P: 6

1. As you've emphasized that the first data is in fact not an error it may not be helpful to point out that the last five data points are in the function: y = (2^(2x)) , but if a piecewise function is an option than it's worth a thought.
2. Otherwise you can use excel as Woopydalan said. However adding a linear trend line will do you no good. If I remember correctly there is an option for fitting a polynomial of higher degrees. It may go up to a sixth degree polynomial. 3. The Lagrange polynomial method that HallsofIvy posted will definitely work.......so actually forget what I said and just copy and paste that into wolfram alpha 


Register to reply 
Related Discussions  
C++ compiler to write notverycomplex DOS/textbased programmes  Programming & Computer Science  20  
Write an exponential equation from this data (data table included)  Precalculus Mathematics Homework  2  
Good Ol' Seagulls and Clams  Creating an equation based on data  Precalculus Mathematics Homework  1  
C++ read/write data help  Engineering, Comp Sci, & Technology Homework  1  
Write data on any surface ?  Computing & Technology  13 