CURVE FITTING WITH LEAST SQUARE
METHOD
By :
Dewi Rachmatin
Least Squares Lines
The formulas for linear least squares fitting were independently derived by German
mathematician Johann Carl Friedrich Gauss (1777-1855) and the French mathematician Adrien-Marie Legendre (1752-1833).
Theorem
(Least Squares Line Fitting)
Given the n data points, the least squares line y=ax+b that fits the points
has coefficients a and b given by:
dan
Mathematica Subroutine
(Least Squares Line)
Example 1. Find the standard "least squares line“ for the data points
Use the subroutine Regression to find the line. Compare with the line obtained with Mathematica's Fit procedure.
Least Squares Polynomials
Theorem (Least-Squares Polynomial Curve Fitting).
Given the n data points
the least squares polynomial of degree m of the form
that fits the n data points is obtained by solving the following linear system
for the m+1 coefficients
These equations are referred to as the
"normal equations".
Mathematica Subroutine
(Least Squares Parabola).
Example 1. Find the standard "least squares parabola" a + b x + c x2
for the data points
Use the subroutine LSParabola to find the line. Compare with the line obtained with Mathematica's Fit procedure.