Consider the problem described at the end of Section $2-6$, running a regression and only estimating
an intercept.
i. Given a sample $\left\{y_{i}: i=1,2, \ldots, n\right\},$ let $\tilde{\beta}_{0}$ be the solution to
$$\min _{b_{0}} \sum_{i=1}^{n}\left(y_{i}-b_{0}\right)^{2}$$
Show that $\tilde{\beta}_{0}=\bar{y},$ that is, the sample average minimizes the sum of squared residuals. (Hint:
You may use one-variable calculus or you can show the result directly by adding and subtracting $\bar{y}$ inside the squared residual and then doing a little algebra.)
ii. Define residuals $\tilde{u}_{i}=y_{i}-\bar{y} .$ Argue that these residuals always sum to zero.