This post has been taken from: Weisstein, Eric W. "Least Squares Fitting--Polynomial." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html
Kindly acknowledge the above source and not this blog. The material has been presented here to serve as learning material for my students. No commercial activity is involved.
Generalizing from a straight line (i.e., first degree polynomial) to a th degree polynomial
Kindly acknowledge the above source and not this blog. The material has been presented here to serve as learning material for my students. No commercial activity is involved.
Generalizing from a straight line (i.e., first degree polynomial) to a th degree polynomial
(1)
|
the residual is given by
(2)
|
The partial derivatives (again dropping superscripts) are
(3)
| |||
(4)
| |||
(5)
|
These lead to the equations
(6)
| |||
(7)
| |||
(8)
|
or, in matrix form
(9)
|
This is a Vandermonde matrix. We can also obtain the matrix for a least squares fit by writing
(10)
|
(11)
|
so
(12)
|
As before, given points and fitting with polynomial coefficients , ..., gives
(13)
|
In matrix notation, the equation for a polynomial fit is given by
(14)
|
This can be solved by premultiplying by the transpose ,
(15)
|
This matrix equation can be solved numerically, or can be inverted directly if it is well formed, to yield the solution vector
(16)
|
Setting in the above equations reproduces the linear solution.
No comments:
Post a Comment