Use a least squares approximation to find the best linear fit (i.e., the best line) ????(????)=????+????????,L(t)=C+Dt, which is closest, in the sense of least squares, to passing through the through the following data points:

(t1, b1) = (-2, 12)
(t2, b2) = (0,9).
(t3, b3) = (2, 0)
(t4, b4) = (4, -5)

What are the y-intercept and the slope D of this line?

Respuesta :

Answer:

The y-intercept is C=7 and the slope is D=-3

Step-by-step explanation:

Let  [tex]L(t)=C+Dt[/tex] be the best linear fit.

This is the best straight line that passes through [tex](t_1,b_1)=(-2,12)\\(t_2,b_2)=(0,9)\\(t_3,b_3)=(2,0)\\(t_4,b_4)=(4,-5)[/tex]

The resulting linear system is  

[tex]C-2D=12\\C+0D=9\\C+2D=0\\C+4D=-5[/tex]

The corresponding matrices form [tex]Ax=b[/tex], has [tex]A=\left[\begin{array}{cc}1&-2\\1&0\\1&2\\1&4\end{array}\right][/tex]  and [tex]b=\left[\begin{array}{c}1&\\9&\\0&\\-5\end{array}\right][/tex]

The components of the normal equations are:

[tex]A^TA=\left[\begin{array}{cccc}1&1&1&1\\-2&0&2&4\end{array}\right] \left[\begin{array}{cc}1&-2\\1&0\\1&2\\1&4\end{array}\right]=\left[\begin{array}{cc}4&4\\4&24\end{array}\right][/tex]

and

[tex]A^Tb=\left[\begin{array}{cccc}1&1&1&1\\-2&0&2&4\end{array}\right] \left[\begin{array}{c}12\\9\\0\\-5\end{array}\right]=\left[\begin{array}{c}16\\4\end{array}\right][/tex]

We now obtain, the normal equations:

[tex]\left[\begin{array}{cc}4&4\\4&24\end{array}\right]\left[\begin{array}{c}C\\D\end{array}\right] =\left[\begin{array}{c}16\\-44\end{array}\right][/tex]

We use row operation to obtain

[tex]\left[\begin{array}{cc}1&0\\0&1\end{array}\right]\left[\begin{array}{c}C\\D\end{array}\right] =\left[\begin{array}{c}7\\-3\end{array}\right][/tex]

This implies C=7, and D=-3

Therefore the best fit line is [tex]L(t)=7-3t[/tex]