Register to reply

How to derive a function from an irregular table of values?

by alext180
Tags: derive, function, irregular, table, values
Share this thread:
alext180
#1
Mar12-14, 10:22 PM
P: 5
It's easy to get a function from a table that follows a clear pattern, but what if the values for y (or x) don't follow a pattern? For example;

x = 1 , y = 13
x = 2 , y = 9
x = 3 , y = 3
x = 4 , y = 8
x = 5 , y = 1
x = 6 , y = 5
x = 7 , y = 12

If you look at these points on a graph, they don't make any normal line.
Phys.Org News Partner Mathematics news on Phys.org
Heat distributions help researchers to understand curved space
Professor quantifies how 'one thing leads to another'
Team announces construction of a formal computer-verified proof of the Kepler conjecture
paisiello2
#2
Mar12-14, 10:53 PM
P: 558
You should be able to fit a 6th degree polynomial that goes through all those points. You can do this using the LINEST function in Excel.
alext180
#3
Mar12-14, 11:21 PM
P: 5
I put the values into excel and did =LINEST(A2:A8,B2:B8,,FALSE) and it gave me -0.464285714 as the slope and 9.142857 as the y-intercept but that can't be right, so I must have done something wrong... I'm not great with excel.

paisiello2
#4
Mar12-14, 11:57 PM
P: 558
How to derive a function from an irregular table of values?

Yes, you want a 6th degree polynomial not a one degree polynomial:

ax^6 + bx^5 + cx^4 + dx^3 + ex^2 + fx + g

You will probably need to research to figure out how to get Excel to do this for you.
MarneMath
#5
Mar13-14, 03:43 AM
P: 439
http://spreadsheetpage.com/index.php...line_formulas/

Excel can do up to 16th power. After that you're on your own :)
jbriggs444
#6
Mar13-14, 05:55 AM
P: 963
Quote Quote by alext180 View Post
It's easy to get a function from a table that follows a clear pattern, but what if the values for y (or x) don't follow a pattern?
If the points do not have a pattern then a function that you determine by fitting it to match those seven points will not have much pattern either. Getting Excel to give you a degree six polynomial that passes through seven points will not give you a reasonable prediction for the eighth...

...unless you have reason to believe that the underlying data is not random and actually came from a sixth degree polynomial in the first place.
alext180
#7
Mar14-14, 06:44 AM
P: 5
Quote Quote by jbriggs444 View Post
If the points do not have a pattern then a function that you determine by fitting it to match those seven points will not have much pattern either. Getting Excel to give you a degree six polynomial that passes through seven points will not give you a reasonable prediction for the eighth...

...unless you have reason to believe that the underlying data is not random and actually came from a sixth degree polynomial in the first place.
You're right, but I think what I'm looking for is an equation that will equal the values of y when you plug in the corresponding values of x. Plugging in 1 will give you 13, 2 will give you 9, and so on :P.
MarneMath
#8
Mar14-14, 07:05 AM
P: 439
So what you're looking for is this right?
$$
-\frac{53}{240}x^6+\frac{1277}{240}x^5-\frac{2419}{48}x^4+\frac{3801}{16}x^3-\frac{34733}{60}x^2+\frac{40477}{60}x-275
$$
Have you tried Lagrange Interpolation?
http://mathworld.wolfram.com/Lagrang...olynomial.html
alext180
#9
Mar14-14, 10:45 PM
P: 5
Quote Quote by MarneMath View Post
So what you're looking for is this right?
$$
-\frac{53}{240}x^6+\frac{1277}{240}x^5-\frac{2419}{48}x^4+\frac{3801}{16}x^3-\frac{34733}{60}x^2+\frac{40477}{60}x-275
$$
Have you tried Lagrange Interpolation?
http://mathworld.wolfram.com/Lagrang...olynomial.html
Wow! That's exactly what I was looking for... Although I don't quite understand Lagrange Interpolation. Thanks!
jbriggs444
#10
Mar15-14, 06:49 AM
P: 963
Quote Quote by alext180 View Post
Wow! That's exactly what I was looking for... Although I don't quite understand Lagrange Interpolation. Thanks!
One way to think about it is that you have seven known values -- your data points. Now find seven different functions that have values at each of those data points. You need to pick functions that are linearly independent. That is, no one function can turn out to match any sum of multiples of the other functions.

Call the functions f1, f2, f3, f4, f5, f6 and f7.

You want to put together a combination k1f1 + k2f2 + k3f3 + k4f4 + k5f5 + k6f6 + k7f7 such that the combination has the right values at each of your seven data points. You can find the right combination by solving a set of seven simultaneous equations in seven unknowns. Say your data points are (x1,y1) through (x7,y7)

Then the equations are:

y1 = k1f1(x1) + k2f2(x1) + ... + k7f7(x1)
y2 = k1f1(x2) + k2f2(x2) + ... + k7f7(x2)
[...]
y7 = k1f1(x7) + k2f2(x7) + ... + k7f7(x7)

You know all the x's and y's. Those are your data points. You know the values for each of the functions at each of the x's. That's just a matter of evaluating each function at each point. The k values are the unknowns. Solve for for k1 through k7

Lagrange Interpolation is what you get if you take f1 through f7 to be:

f1(x) = 1
f2(x) = x
f3(x) = x2
...
fn(x) = xn-1

[Edit, fixed error on the final exponent above]

Obviously this will work for any number of data points, not just seven.
paisiello2
#11
Mar15-14, 02:30 PM
P: 558
That is what the excel function is doing except it does a least squares approach for the case where the number of data points exceeds the degree of the polynomial by one or more.


Register to reply

Related Discussions
Is it possible to find values not presented in a table? General Math 1
Normal distribution table values Precalculus Mathematics Homework 2
Trying to derive this but has multiple absolute values Calculus & Beyond Homework 1
Fourier representation of aperiodic irregular function Advanced Physics Homework 1
Chain rule with table of values Calculus & Beyond Homework 16