
\section{ Problem 2}
\subsection{Statement of the Problem}
The following data shows the age of seven children, in months, and their score on a particular developmental test. 

\begin{center}
\begin{tabular}{|c|c|}
\hline
\textbf{Age (Months)} & \textbf{Score}\\\hline
20 & 95\\
27 & 90\\
30 & 98\\
35 & 103\\
41 & 112\\
44 & 109\\
46 & 115\\
\hline
\end{tabular}
\end{center} 
\subsection{Fitting $y=mx$}
To try to fit $y=mx$ model to this data, we can set the objective function to be $V_2(m)=\sqrt{(95-20m)^2+(90-27m)^2+\cdots+(109-44m)^2+(115-46m)^2}$, finding the minimum of this function is attained when $m=\ldots\ldots\ldots$ (fill in this answer from the lecture). When we plot the data together with $y=x$ the Mathematica output is 
\begin{center}
\includegraphics[width=0.75\textwidth]{Problem2/linear_model.eps}
\end{center}
Clearly this is a poor fit, so all models of the form $y=mx$ are invalid. We need to use a different type of model. 

\subsection{Fitting $y=mx+b$}
For this data no value of $m$ can make $y=mx$ fit the data well. The next simplest model is one of the form $y=mx+b$. The figure below shows the vertical, horizontal and perpendicular residuals.
\begin{center}
\includegraphics[width=0.4\textwidth]{Problem2/figures.1}\hfill
\includegraphics[width=0.4\textwidth]{Problem2/figures.2}\\
\includegraphics[width=0.4\textwidth]{Problem2/figures.3}
\end{center}
\begin{footnotesize}
Hence, the list of objective functions, we have to choice from, is:
\begin{align*}
V_p(m,b) & = \left[(95-20m-b)^p+(90-27m-b)^p+
\cdots+
		 (109-44m-b)^p+(115-46m-b)^p\right]^{\frac{1}{p}} \\
H_p(m,b) & = \left[\left(20-\frac{95-b}{m}\right)^p+
		 \left(27-\frac{90-b}{m}\right)^p+
\cdots+
		 \left(44-\frac{109-b}{m}\right)^p+
		 \left(46-\frac{115-b}{m}\right)^p\right]^{\frac{1}{p}}\\
P_p(m,b) & = \left[\left(\frac{95-20m-b }{\sqrt{m^2+1}}\right)^p+
		 \left(\frac{90-27m-b}{\sqrt{m^2+1}}\right)^p+
\cdots +
		 \left(\frac{109-44m-b}{\sqrt{m^2+1}}\right)^p+
		 \left(\frac{115-46m-b}{\sqrt{m^2+1}}\right)^p\right]^{\frac{1}{p}}
\end{align*}
\end{footnotesize}
Their values will change with both $m$ and $b$. Their graphs are surfaces. Below is the graph of $V_2(m,b)$:
\begin{center}
\includegraphics[width=0.5\textwidth]{Problem2/v2surface.eps}
\end{center}
It is hard to see that this function does have a minimum value. However we can try to solve the two of simultaneous equations $\dps\pdif{V_2}{m}=0$ and $\dps \pdif{V_2}{b}=0$. This will give us points, if any exist, where both rate of change in the $m$-direction is zero, and the rate of change in the $b$-direction is zero.