Least squares method calculator: polynomial approximation
Calculator finds out coefficients of polynomial that fits best into series of (x, y) points.

Beta version#

BETA TEST VERSION OF THIS ITEM
This online calculator is currently under heavy development. It may or it may NOT work correctly.
You CAN try to use it. You CAN even get the proper results.
However, please VERIFY all results on your own, as the level of completion of this item is NOT CONFIRMED.
Feel free to send any ideas and comments !

Calculation data - measurement points#

Format of input data
x-values
y-values
Maximum polynomial degree
(polynomial with higher order will not be calculated)

Results - approximation of your dataset#

Regression typeApproximation formulaCoefficient of determination R2
Polynomial regression of 3-th degreeShow sourcey=x3y=x^{3}1
Polynomial regression of 2-th degreeShow sourcey=9 x21185 x+845y=9~x^{2}-\frac{118}{5}~x+\frac{84}{5}0.998614052
Polynomial regression of 1-th degreeShow sourcey=1525 x2315y=\frac{152}{5}~x-\frac{231}{5}0.889470645
Polynomial regression of 0-th degreeShow sourcey=45y=450

Summary - function best fitting to your data#

Measurement points
Number of points5
Points you entered(1, 1), (2, 8), (3, 27), (4, 64), (5, 125)
Approximation
Regression typePolynomial regression of 3-th degree
Function formulaShow sourcey=x3y=x^{3}
Coefficient of determination R21

Some facts#

  • ⓘ Hint: If you're not sure what type of regression this is, let us do the hard work for you and visit another calculator: Regression types.
  • Approximation of a function consists in finding a function formula that best matches to a set of points e.g. obtained as measurement data.
  • The least squares method is one of the methods for finding such a function.
  • The least squares method is the optimization method. As a result we get function that the sum of squares of deviations from the measured data is the smallest. Mathematically, we can write it as follows:
    i=1n[yif(xi)]2=min.\sum_{i=1}^{n} \left[y_i - f(x_i)\right]^2 = min.
    where:
    • (xi,yi)(x_i, y_i) - coordinations of the i-th measurement point, these are points that we know,
    • f(x)f(x) - the function we are searching for, we want this function to best match to the measurement points,
    • nn - number of measurement points.
  • If we limit the search to polynomial function only, then we say about polynomial regression or polynomial approximation.
    f(x)=Wn(x)=an xn+an1 xn1+a1 x+a0f(x) = W_n(x) = a_{n}\ x^n + a_{n-1}\ x^{n-1} \dots + a_1\ x + a_0
    • f(x) - function that best approximates the input data in the best way,
    • an - unknown polynomial coefficients, which we want to find,
    • n - the polynomial degree.
  • If the degree of the polynomial is zero (n=0), then we get an approximation by constant function, i.e. by one number, which stays closest to all measurement values.
    f(x)=Cf(x) = C
  • If the degree of the polynomial is one (n=1), then we get an approximation by linear function:
    f(x)=ax+bf(x) = ax + b
  • For polynomial degrees greater than one (n>1), polynomial regression becomes an example of nonlinear regression i.e. by function other than linear function.
  • Using the least squares method, we can adjust polynomial coefficients {a0,a1,,an}\{a_0, a_1, \dots, a_n\} so that the resulting polynomial fits best to the measured data. Because polynomial coefficients are numbers, the solution to this problem is equivalent to solve the algebraic equation.

Tags and links to this website#

What tags this calculator has#

Permalink#

This is permalink. Permalink is the link containing your input data. Just copy it and share your work with friends:

Links to external sites (leaving Calculla?)#

JavaScript failed !
So this is static version of this website.
This website works a lot better in JavaScript enabled browser.
Please enable JavaScript.