This breaks down into two major cases according to whether the data is from experimental measurements and therefore limited in accuracy or represents exact values of a function at several sample points.
Experimental data
With experimental data, which may include measurement errors or limited of precision, it may be best to first plot the data points to see if they look like they follow a straight line or some other curve.
If it looks like they approximate to a straight line, use linear regression to find the line of best fit.
If it looks like they follow an exponential curve, take logarithms of the
Otherwise you may need to do something a little more complicated.
Exact function values
Suppose your data points are:
#(x_1, y_1)# ,#(x_2, y_2)# ,...,#(x_n, y_n)#
You can match a polynomial function to these points as follows:
Consider the function:
#f_k(x) = prod_(j!=k) (x-x_j)/(x_k-x_j)#
This is a polynomial taking the value
So we can define:
#f(x) = sum_(k=1)^n (y_k f_k(x)) = sum_(k=1)^n (y_k prod_(j!=k) (x-x_j)/(x_k-x_j))#
This is a polynomial of degree at most