Let the pairs of the dataset (xᵢ, yᵢ)
contain error.
We want to be able to approximate this dataset via a polynomial.
Two things are needed to establish this polynomial:
- the order of the polynomial (linear, quadratic and so on);
- a metric/criterion measuring the viability of the polynomial.
Let E = y - (a₀ + a₁x + a₂x² + ...)
be the error, y
be the data vector and (a₀ + a₁x + a₂x² + ...)
be the approximating polynomial.
By this metric, the more appropriate polynomial would be the one to yield E
smallest in value.
Popular criteria:
min(L1(E))
(L1-Norm of Error Vector);min(L2(E))
(Euclidean Norm ofE
);min(L∞(E))
(Maximum Component ofE
).
In Least Squares Fitting, the best fit polynomial is the one satisfying the criterion of the L2-Norm.
Equaling to zero (for the minimum/minima) should yield the following system of equations:
The following linear system is equivalent to the above:
The procedure is similar for finding other best fit polynomials. The matrix form can be generalized as:
It being a positive-definite matrix, the solution is unique.