finding equation from a set of points

3.1k Views Asked by At

If we have a set of points could plot a freehand graph like in the picture below:

enter image description here

If we have a set of infinite points then the function would presumably be smoother. How do we find the equation of the curve based on the set of points? Is this possible?
For example: For a straight line, we use the two-point form, or the point slope, is there a general way to define an n th degree curve?

1

There are 1 best solutions below

4
On BEST ANSWER

Yes this is possible. You first need to assume a form for the equation. That is to say for example that \begin{equation} y = f(x, \theta) \end{equation} in which $f$ is some polynomial with fixed order for example. The parameter vector $\theta$ contains the coefficients of the polynomial. This is what we are after. To evaluate $\theta$ you can use the least squares method. You will need number of points more than or equal to the number of unknown coefficients of the function $f$.

The least squares method minimizes the sum \begin{equation} \sum_{k=1}^K (y_k - f(x_k, \theta))^2 \end{equation} over $\theta$. Here $K$ is the total number of available points.

Check the wikipedia page: Least Squares