We want to find \(\beta_0\) and \(\beta_1\) such that we minimise the RSS. This occurs when we set the partial derivative with respect to both \(\beta_0\) and \(\beta_1\) to zero.
Now we have a closed-form expression for both \(\beta_0\)Equation C.3 and \(\beta_1\)Equation C.4.
Note
This can extend to more than simple linear regression but would involve an expression in matrix notation. For more complex regression models, other methods are used such as maximum likelihood estimation (MLE). This is beyond the scope of this course.
Let’s try to manually verify this by calculating the regression coefficients by hand. We can compare this to the R output in Section 3.1.