# Different formulas for $\hat{\sigma}^2$

My book introduces $$\hat{\sigma}^2 = \frac{1}{n} \sum_{i=1}^n \hat{e}_i^2$$, which makes sense to me since to my understanding $$\hat{\sigma}^2$$ is the error variance estimator. However, I have also seen $$\hat{\sigma}^2 = \frac{1}{n} \sum_{i=1}^n (X_i - \overline{X})^2$$ such as in this problem (Asymptotic distribution of $\sqrt{n}\left(\hat{\sigma_{1}^{2}}-\sigma^2\right)$) that I was working on initially and $$\hat{\sigma}^2 = \frac{1}{n} \sum_{i=1}^n (Y_i - \overline{Y})^2$$ ( https://math.stackexchange.com/questions/688035/properties-of-hat-sigma2-bias-and-variance). Are these all referring to the same thing? If so, can anyone point me in the direction of proving their equality?

Thank you all very much.

No, assuming typical regression notation is used, $$\hat{\sigma}^2 = \frac{1}{n} \sum_{i=1}^n \hat{e}_i^2$$ is an estimate for residual variance (since $$\bar e = 0$$), $$\hat{\sigma}^2 = \frac{1}{n} \sum_{i=1}^n (X_i - \overline{X})^2$$ is an estimate for feature/independent variable variance, and $$\hat{\sigma}^2 = \frac{1}{n} \sum_{i=1}^n (Y_i - \overline{Y})^2$$ is an estimate for the target variable's variance.
• Ok, thank you! So if a problem asks me to find the asymptotic distribution of $\sqrt{n}(\hat{\sigma}^2 - \sigma^2)$ in a regression context, do I assume it to be the residual variance? Mar 28, 2021 at 21:20