Example 6. Find the
"least squares parabola" that for the four data
points
.
Solution 6.
(a). Write down the linear system AC = B to be solved.
(b). Solve the linear system
for the coefficients
using our LUfactor[n] and SolveLU[n] subroutines.
(c). Construct the
polynomial p[x]. The
coefficients are stored in the array c and
the elements are
.
Of course we could do all this work in two lines by using
Mathematica's built in
procedure.
We are done.
We can graph the polynomial, this is just for fun !
![[Graphics:../Images/LUFactorMod_gr_208.gif]](../Images/LUFactorMod_gr_208.gif)
(c) John H. Mathews 2004