# How to get equation given many (x,y) points?

This topic is 3123 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Let's say you have a thousand (x,y) points. You want to get an equation, such that: f(x) = y How to get f(x)? (Assuming value of x is always unique)

##### Share on other sites
What you are looking for is probably Curve Fitting. Hope this helps.

##### Share on other sites

Hi Omid, thanks for the link!

I looked into it, if i use that, then if I have a thousand (x,y) points, my final equation would have a degree of 999 right? (a long equation, but it'll work)

Is there another method, where it does the same thing, but gives a shorter equation?

or is there a way to make an equation of degree 999 into something shorter that people can write?

thanks! :)

##### Share on other sites
Quote:
 Original post by helloworld123Is there another method, where it does the same thing, but gives a shorter equation? or is there a way to make an equation of degree 999 into something shorter that people can write?
Are your points random, or do you have some information/educated intuition about the type of curve they form?

##### Share on other sites
Quote:
Original post by swiftcoder
Quote:
 Original post by helloworld123Is there another method, where it does the same thing, but gives a shorter equation? or is there a way to make an equation of degree 999 into something shorter that people can write?
Are your points random, or do you have some information/educated intuition about the type of curve they form?

Hi,

yes the points are random, and all x-values in all (x,y) are non-repeating (unique).

I'm not really interested with the curve, or the interpolation/extrapolation data that could be derived, i'm only interested in getting y, given x, using an equation.

is there a way to simplify an equation of degree 999?

##### Share on other sites
If I understood you correctly and your points are randomly distributed then you can't find a function f(x)=y. But of course you could use a lookup-table. But maybe you could give some more information about your points.

##### Share on other sites
Quote:
 Original post by __MosteM__If I understood you correctly and your points are randomly distributed then you can't find a function f(x)=y. But of course you could use a lookup-table. But maybe you could give some more information about your points.

actually you can, the points are random and are unique (let's say x-values are guaranteed to be unique).

i looked into lagrange interpolation, which does exactly this, it takes many control points (unique points), and give you an equation too.

but problem is, what about for 1000 control points, it'll give a polynomial of degree 999.

i'm just wondering if there is an alternative that gives another equation or some sort, something shorter than an equation of degree 999.

(or is there a way to represent an equation of degree 999 into something shorter? by shorter i mean something you could even write down on a small piece of paper)

thanks!

##### Share on other sites
Fundamentally that is not a useful thing to be doing.

Whilst it is true that for an arbitrary number of points you can find an equation which will satisfy all points it isn't going to be useful for anything.

The point of an equation is that you can put in an input and get an output.

Making up an arbitrary number of random points and finding an equation to fit them is only going to give you more random points.

Summary:
random input -> random output

##### Share on other sites
Subdivide the entire domain in N equal intervals. Build an approximation curve for each of the intervals. If your 1000 points are uniformly distributed, each of the curves will have the degree (1000 / N - 1).

##### Share on other sites
The way of fitting many points to a much smaller equation is known as least-squares regression.

However, I think there may be confusion about your statement "They are random points."
If the x values are "random" then we are talking, and you may be able to fit an equation...
BUT if the y values are ALSO "random" then you are saying there is NO implicit structure to the point distribution, and thus no equation can fit that structure.

It would be very helpful if you could post an example "plot"of some of the points you want to fit.

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 10
• 11
• 14
• 10
• 25
• ### Forum Statistics

• Total Topics
632648
• Total Posts
3007642
• ### Who's Online (See full list)

There are no registered users currently online

×