Example 8. Use the
linear least squares method to find the polynomial curve fit of
degree = 3 for the points
.
Solution 8.
Enter the n points.
Enter the degree of the polynomial.
Construct the matrices
,
and the vector ![]()
Solve the linear system
.
Construct the polynomial.
We are done.
Aside. We can compare
this with the result obtained by using Mathematica's procedure
"Fit" to find the polynomial.
(c) John H. Mathews 2004