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.
To derive variance of
With the assumption that all labels are independent with variance
With above identities, we can calculate the variance of