## Unit4.1.1Fitting the best line

A classic problem is to fit the "best" line through a given set of points: Given

\begin{equation*} \{ ( \chi_i , \psi_i ) \}_{i=0}^{m-1}, \end{equation*}

we wish to fit the line $f( \chi ) = \gamma_0 + \gamma_1 \chi$ to these points, meaning that the coefficients $\gamma_0$ and $\gamma_1$ are to be determined. Now, in the end we want to formulate this as approximately solving $A x = b$ and for that reason, we change the labels we use: Starting with points

\begin{equation*} \{ ( \alpha_i , \beta_i ) \}_{i=0}^{m-1}, \end{equation*}

we wish to fit the line $f( \alpha ) = \chi_0 + \chi_1 \alpha$ through these points so that

\begin{equation*} \begin{array}{ l c l} \chi_0 + \chi_1 \alpha_0 \amp \approx \amp \beta_0 \\ \chi_0 + \chi_1 \alpha_1 \amp \approx \amp \beta_1 \\ ~~~~~~~~~\vdots \amp \vdots \amp ~\vdots \\ \chi_0 + \chi_1 \alpha_{m-1} \amp \approx \amp \beta_{m-1} , \end{array} \end{equation*}

which we can instead write as

\begin{equation*} A x \approx b, \end{equation*}

where

\begin{equation*} A = \left( \begin{array}{c c} 1 \amp \alpha_0 \\ 1 \amp \alpha_1 \\ \vdots \amp \vdots \\ 1 \amp \alpha_{m-1} \end{array} \right), x = \left( \begin{array}{c} \chi_0 \\ \chi_1 \end{array} \right), \mbox{ and } b = \left( \begin{array}{c} \beta_0 \\ \beta_1 \\ \vdots \\ \beta_{m-1} \end{array} \right). \end{equation*}
###### Ponder This4.1.1.2.

Rewrite the script for Homework 4.1.1.1 to be a bit more engaging...)