STAT 306 - Module 03
Suppose we fitted a model \(\widehat{Y} = \widehat{\beta}_0 + \widehat{\beta}_1 x\), and now \(\widehat{\beta}_0\) and \(\widehat{\beta}_1\) are known. For \(x=3\), what would be our prediction for \(Y\)?
Suppose we fitted a model \(\widehat{Y} = \widehat{\beta}_0 + \widehat{\beta}_1 x\), and now \(\widehat{\beta}_0\) and \(\widehat{\beta}_1\) are known. For \(x=3\), what would be our prediction for \(Y\)?
For any two random variables \(X\) and \(Y\), we have that \[ \begin{align*} \text{Cov}(X,Y) &= \mathbb{E}[(X - \mathbb{E}[X])(Y - \mathbb{E}[Y])]\\ &= \mathbb{E}[XY] - \mathbb{E}[X]\mathbb{E}[Y] \;. \end{align*}\]
For any random variables \(X, Y, Z\) and constants \(a, b, c, d\), we have that
Estimators are statistics, therefore random variables (because they depend on a random sample): \[ \widehat{\beta}_1 = \frac{\sum_{i=1}^n(x_i-\bar{x})(Y_i-\bar{Y})}{\sum_{i=1}^n(x_i-\bar{x})^2}\qquad\quad \widehat{\beta}_0 = \bar{Y} - \widehat{\beta}_1\bar{x} \; \]
We want to interpret them, but how can we interpret and make decisions based on quantities that can change from sample to sample?
We need to understand how they behave, i.e., what is their sampling distribution.
We want to derive the distributions of \(\widehat{\beta}_0\) and \(\widehat{\beta}_1\).
That’s all we want to do for now!
Consider the least squares estimators
\[ \begin{align*} \widehat{\beta}_1 &= \frac{\sum_{i=1}^nx_iY_i - n\bar{x}\bar{Y}}{\sum_{i=1}^nx_i^2-n\bar{x}^2} \;, & \widehat{\beta}_0 &= \bar{Y} - \widehat{\beta}_1\bar{x} \;. \end{align*} \]
Explain why \(\widehat{\beta}_1\) and \(\widehat{\beta}_0\) are normal random variables.
Solution
Because both \(\widehat{\beta}_1\) and \(\widehat{\beta}_0\) are linear combinations of independent normal random variables \(Y_1, \dots, Y_n\), they are also normally distributed.
We now know that both \(\widehat{\beta}_1\) and \(\widehat{\beta}_0\) are normal random variables.
All that is left is to find their means and variances, i.e., \(\mathbb{E}[\widehat{\beta}_1]\), \(\text{Var}(\widehat{\beta}_1)\), \(\mathbb{E}[\widehat{\beta}_0]\) and \(\text{Var}(\widehat{\beta}_0)\).
With these quantities, we will be able to write down the distributions of \(\widehat{\beta}_1\) and \(\widehat{\beta}_0\).
Compute \(\mathbb{E}[\widehat{\beta}_1]\).
\[ \begin{align} \widehat{\beta}_1 &= r_{XY}\frac{S_Y}{S_X} = \frac{\sum_{i=1}^n(x_i-\bar{x})(Y_i-\bar{Y})}{\sum_{i=1}^n(x_i-\bar{x})^2} = \frac{\sum_{i=1}^nx_iY_i - n\bar{x}\bar{Y}}{\sum_{i=1}^nx_i^2-n\bar{x}^2} \; \end{align} \]
Solution
\[ \begin{align} \mathbb{E}[\widehat{\beta}_1] &= \mathbb{E}\left[\frac{\sum_{i=1}^n(x_i-\bar{x})(Y_i-\bar{Y})}{\sum_{i=1}^n(x_i-\bar{x})^2}\right] \\ &= \frac{\sum_{i=1}^n(x_i-\bar{x})\left(\mathbb{E}\left[Y_i\right]-\mathbb{E}\left[\bar{Y}\right]\right)}{\sum_{i=1}^n(x_i-\bar{x})^2} \\ &= \frac{\sum_{i=1}^n(x_i-\bar{x})\left[\left(\beta_0+\beta_1x_i\right)-\left(\beta_0+\beta_1\bar{x}\right)\right]}{\sum_{i=1}^n(x_i-\bar{x})^2} \\ &= \frac{\beta_1\sum_{i=1}^n(x_i-\bar{x})\left(x_i-\bar{x}\right)}{\sum_{i=1}^n(x_i-\bar{x})^2} \\ &= \beta_1 \\ \end{align} \]
Compute \(\text{Var}(\widehat{\beta}_1)\).
\[ \begin{align} \widehat{\beta}_1 &= r_{XY}\frac{S_Y}{S_X} = \frac{\sum_{i=1}^n(x_i-\bar{x})(Y_i-\bar{Y})}{\sum_{i=1}^n(x_i-\bar{x})^2} = \frac{\sum_{i=1}^nx_iY_i - n\bar{x}\bar{Y}}{\sum_{i=1}^nx_i^2-n\bar{x}^2} \; \end{align} \]
Solution \[ \begin{align} \text{Var}(\widehat{\beta}_1) &= \text{Var}\left[\frac{\sum_{i=1}^n(x_i-\bar{x})(Y_i-\bar{Y})}{\sum_{i=1}^n(x_i-\bar{x})^2}\right] \\ &= \text{Var}\left[\frac{\sum_{i=1}^n(x_i-\bar{x})Y_i}{\sum_{i=1}^n(x_i-\bar{x})^2}-\frac{\bar{Y}\sum_{i=1}^n(x_i-\bar{x})}{\sum_{i=1}^n(x_i-\bar{x})^2}\right] \\ &= \text{Var}\left[\frac{\sum_{i=1}^n(x_i-\bar{x})Y_i}{\sum_{i=1}^n(x_i-\bar{x})^2}\right] \quad \left(\text{since } \sum_{i=1}^n(x_i-\bar{x}) = 0\right)\\ &= \frac{\sum_{i=1}^n(x_i-\bar{x})^2\text{Var}\left[Y_i\right]}{\left(\sum_{i=1}^n(x_i-\bar{x})^2\right)^2} \quad \left(\text{since } Y_1, \dots, Y_n \text{ are independent}\right)\\ &= \frac{\sigma^2}{\sum_{i=1}^n(x_i-\bar{x})^2} \\ \end{align} \]
Solution \[ \begin{align} \mathbb{E}[\widehat{\beta}_0] &= \mathbb{E}[\bar{Y}] - \mathbb{E}[\widehat{\beta}_1]\bar{x} \\ &= (\beta_0 + \beta_1\bar{x}) - \beta_1\bar{x} \\ &= \beta_0 \;. \end{align} \]
Solution
\[ \begin{align} \text{Var}(\widehat{\beta}_0) &= \text{Var}\left[\bar{Y} - \widehat{\beta}_1\bar{x}\right] \\ &= \text{Var}[\bar{Y}] + \text{Var}[\widehat{\beta}_1]\bar{x}^2 - 2\bar{x}\text{Cov}[\bar{Y},\widehat{\beta}_1] \\ &= \frac{\sigma^2}{n} + \frac{\sigma^2}{\sum_{i=1}^n(x_i-\bar{x})^2}\bar{x}^2 - 2\bar{x}\text{Cov}\left[\bar{Y},\frac{\sum_{i=1}^n(x_i-\bar{x})Y_i}{\sum_{i=1}^n(x_i-\bar{x})^2}\right] \\ &= \frac{\sigma^2}{n} + \frac{\sigma^2\bar{x}^2}{\sum_{i=1}^n(x_i-\bar{x})^2} \\ &= \sigma^2\left(\frac{1}{n} + \frac{\bar{x}^2}{\sum_{i=1}^n(x_i-\bar{x})^2}\right) \; \end{align} \]
\[ \begin{align*} \text{Cov}[\bar{Y}, \widehat{\beta}_1] &= \text{Cov}\left[ \bar{Y}, \frac{\sum_{j=1}^{n} (x_j - \bar{x})Y_j}{\sum_{k=1}^{n} (x_k - \bar{x})^2} \right] \\\\ &= \frac{\sum_{j=1}^{n} (x_j - \bar{x})\text{Cov}\left[ \bar{Y}, Y_j \right]}{\sum_{k=1}^{n} (x_k - \bar{x})^2} \\\\ &= \frac{\sigma^2}{n}\frac{\sum_{j=1}^{n} (x_j - \bar{x})}{\sum_{k=1}^{n} (x_k - \bar{x})^2} \\\\ &= \frac{\sigma^2}{n}\frac{0}{\sum_{k=1}^{n} (x_k - \bar{x})^2} \\\\ &= 0 \end{align*} \]
Are \(\widehat{\beta}_0\) and \(\widehat{\beta}_1\) unbiased estimators of \(\beta_0\) and \(\beta_1\), respectively?
Are \(\widehat{\beta}_0\) and \(\widehat{\beta}_1\) unbiased estimators of \(\beta_0\) and \(\beta_1\), respectively?
What is \(\text{Var}[\widehat{\beta}_1]\)?
What is \(\text{Var}[\widehat{\beta}_1]\)?
What is \(\text{Cov}(\bar{Y}, \widehat{\beta}_1)\)?
What is \(\text{Cov}(\bar{Y}, \widehat{\beta}_1)\)?
What is \(\text{Var}[\widehat{\beta}_0]\)?
What is \(\text{Var}[\widehat{\beta}_0]\)?
Recall that \(\text{Var}(\widehat{\beta}_1) = \frac{\sigma^2}{\sum_{i=1}^n (x_i - \bar{x})^2}\). Which of the following will decrease the variance (increase precision) of \(\widehat{\beta}_1\)?
Recall that \(\text{Var}(\widehat{\beta}_1) = \frac{\sigma^2}{\sum_{i=1}^n (x_i - \bar{x})^2}\). Which of the following will decrease the variance (increase precision) of \(\widehat{\beta}_1\)?
\(\widehat{\beta}_1=\frac{\sum_{i=1}^n(x_i-\bar{x})Y_i}{\sum_{i=1}^n(x_i-\bar{x})^2}\) is a linear combination of normal random variables; hence, also normally distributed.
We have that \(\mathbb{E}[\widehat{\beta}_1] = \beta_1\) and \(\text{Var}(\widehat{\beta}_1) = \frac{\sigma^2}{\sum_{i=1}^n(x_i-\bar{x})^2}\).
Therefore, \(\widehat{\beta}_1 \sim N\left(\beta_1,\:\frac{\sigma^2}{\sum_{i=1}^n(x_i-\bar{x})^2}\right)\).
We have that \(\mathbb{E}[\widehat{\beta}_0] = \beta_0\) and \(\text{Var}(\widehat{\beta}_0) = \frac{\sigma^2}{n} + \frac{\sigma^2\bar{x}^2}{\sum_{i=1}^n(x_i-\bar{x})^2}\).
Additionally, \(\widehat{\beta}_0 = \bar{Y} - \widehat{\beta}_1\bar{x}\) is a linear combination of normal random variables.
Therefore, \(\widehat{\beta}_0 \sim N\left(\beta_0,\:\sigma^2\left(\frac{1}{n} + \frac{\bar{x}^2}{\sum_{i=1}^n(x_i-\bar{x})^2}\right)\right)\).
Let us verify our theoretical results with a simulation.
We fix the ground truth: \(\beta_0 = 10\), \(\beta_1 = 2\), \(\sigma = 3\).
The steps are:
lm() to each;| Property | Slope Estimator (\(\widehat{\beta}_1\)) | Intercept Estimator (\(\widehat{\beta}_0\)) |
|---|---|---|
| Mean | \(\mathbb{E}[\widehat{\beta}_1] = \beta_1\) (unbiased) | \(\mathbb{E}[\widehat{\beta}_0] = \beta_0\) (unbiased) |
| Variance | \(\text{Var}(\widehat{\beta}_1) = \frac{\sigma^2}{\sum_{i=1}^n (x_i - \bar{x})^2}\) | \(\text{Var}(\widehat{\beta}_0) = \sigma^2 \left(\frac{1}{n} + \frac{\bar{x}^2}{\sum_{i=1}^n (x_i - \bar{x})^2}\right)\) |
| Distribution | \(N\left(\beta_1, \frac{\sigma^2}{\sum_{i=1}^n (x_i - \bar{x})^2}\right)\) | \(N\left(\beta_0, \sigma^2 \left(\frac{1}{n} + \frac{\bar{x}^2}{\sum_{i=1}^n (x_i - \bar{x})^2}\right)\right)\) |
We have derived the exact sampling distributions of \(\widehat{\beta}_0\) and \(\widehat{\beta}_1\).
Notice that both variances depend on \(\sigma^2\), which is unknown in practice.
Next module:
© 2025 Rodolfo Lourenzutti – Material Licensed under CC By-SA 4.0