Example 7. Find the
least squares polynomial fits of degree n = 2, 3, 4, 5 for the points
.
Solution 7.
Use Mathematica to find the least squares polynomial of degree n = 2.
![[Graphics:../Images/LeastSqPolyMod_gr_88.gif]](../Images/LeastSqPolyMod_gr_88.gif)
Use Mathematica to find the least squares polynomial of degree n = 3.
![[Graphics:../Images/LeastSqPolyMod_gr_91.gif]](../Images/LeastSqPolyMod_gr_91.gif)
Use Mathematica to find the least squares polynomial of degree n = 4.
![[Graphics:../Images/LeastSqPolyMod_gr_94.gif]](../Images/LeastSqPolyMod_gr_94.gif)
Use Mathematica to find the least squares polynomial of degree n = 5.
![[Graphics:../Images/LeastSqPolyMod_gr_97.gif]](../Images/LeastSqPolyMod_gr_97.gif)
Remark. The points
were obtained from
which
is not polynomial.
![[Graphics:../Images/LeastSqPolyMod_gr_101.gif]](../Images/LeastSqPolyMod_gr_101.gif)
Graph all the curves, just for a comparison.
![[Graphics:../Images/LeastSqPolyMod_gr_102.gif]](../Images/LeastSqPolyMod_gr_102.gif)
![[Graphics:../Images/LeastSqPolyMod_gr_103.gif]](../Images/LeastSqPolyMod_gr_103.gif)
(c) John H. Mathews 2004