⚠️ Estimation is the first hurdle for most students, so let me take you through the logic STEP-BY-STEP and hopefully you will know intuitively what the equations are doing and derive the equations yourself

  1. We have our equation

    $$ y_i = \beta_0 + \beta_1 x_i + u_i $$

  2. [IMPORTANT] Next question is: Can we find out $\{\beta_0, \beta_1\}$?

  3. How are we going to estimate the parameters — find $\{\hat{\beta_0}, \hat{\beta_1}\}$

    image.png

    image.png




    Expand and rearrange to get normal equations - Eq 1 and Eq 2

    $$ \begin{aligned}\sum_{i=1}^n y_i &= n\,\beta_0 + \beta_1 \sum_{i=1}^n x_i, \\\sum_{i=1}^n x_i y_i &= \beta_0 \sum_{i=1}^n x_i + \beta_1 \sum_{i=1}^n x_i^2\end{aligned} $$

    From Eq1

    $$ \beta_0 = \bar y - \beta_1 \bar x $$

    Substitute $\beta_0$ equation into Eq 2

    $$ \begin{aligned} \sum x_i y_i &= (\bar y-\beta_1\bar x)\sum x_i + \beta_1 \sum x_i^2 \\&= n\bar x\,\bar y - \beta_1 n\bar x^2 + \beta_1 \sum x_i^2\\ \sum x_i y_i - n\bar x\,\bar y &= \beta_1\Big(\sum x_i^2 - n\bar x^2\Big)\\ \hat \beta_1 &= \frac{\sum x_i y_i - n\bar x\,\bar y}{\sum x_i^2 - n\bar x^2} \end{aligned}\\ $$

    Now recognised that, ask ChatGPT if you cannot proof it

    $$ \sum (x_i-\bar x)^2 = \sum x_i^2 - n\bar x^2 \\ \sum (x_i-\bar x)(y_i-\bar y) = \sum x_i y_i - n\bar x\,\bar y $$

    We have

    $$ \begin{aligned} \hat\beta_1 &= \frac{\sum (x_i-\bar x)(y_i-\bar y)}{\sum (x_i-\bar x)^2}\\ \text{Equivalent to:}\\ \hat\beta_1 &= \frac{Cov(x,y)}{Var(x)} \end{aligned} $$

    Plugging $\hat \beta_1$ to $\beta_0$equation

    $$ \hat \beta_0 = \bar y = \hat \beta_1 \bar x $$

    That is the full chain: FOC → normal equations → $\beta_0$ equation → solve for $\hat \beta_1$ → back-substitute for $\hat \beta_0$