#### Abstract

This post shows how to derive the closed form solution of least square estimation for linear regression. After that, we will show how to derive the variance of the coefficient from the closed form solution.

#### Variance of $\theta$

To derive variance of $\theta$, we need a few useful identities:

With the assumption that all labels are independent with variance $\sigma^2$, we have:

With above identities, we can calculate the variance of $\theta$