# Estimating the variance of the GLS estimator

Consider the linear regression model where $$y = XB + u$$. Assume that $$\mathrm{E}[u \mid X] = 0$$. Assume that $$\mathrm{V}[u \mid X] = \sigma^2I$$. This is the simple linear model. Now relax the homoskedasticity assumption so that $$\mathrm{V}[u \mid X] = \sigma^2 \Delta$$. Assume that $$\Delta$$ is known but $$\sigma^2$$ is not known.

Question 1: Can the GLS estimator be used? The GLS estimator is given by $$\hat{\beta}_{GLS} = [X^{\top}(\sigma^2\Delta)^{-1}X]^{-1}X^{\top}(\sigma^2\Delta)^{-1}y = [X^{\top}\Delta^{-1}X]^{-1}X^{\top}\Delta^{-1}y$$. So the unknown $$\sigma^2$$ drops and $$\Delta$$ is known. So the GLS estimator can be used. We do not need the FGLS estimator.

Question 2: Can the variance of the GLS estimator be used? The variance of the GLS estimator is given by $$\hat{\beta}_{GLS}$$ given by $$\mathrm{Var}[\hat{\beta}_{GLS} \mid X] = \sigma^2 (X'\Omega^{-1}X)^{-1}$$. $$\Delta$$ is known but $$\sigma^2$$ is not known. So we have to estimate $$\sigma^2$$ first and use it to estimate $$\mathrm{Var}[\hat{\beta}_{GLS} \mid X]$$. $$\sigma^2$$ can be consistently estimated by $$\frac{1}{N-K}\sum{\hat{u}_i}^2$$ where $$\hat{u}_i$$ is the residual from the OLS estimation of $$y = XB +u$$.

Are these answers all correct? Especially the answer of the second question?

Assume that $$\Delta$$ is known, everything is simple.
Original Model $$Y=X\beta + u$$ can be convert to $$Y_n=X_n\beta + \epsilon$$ where $$Y_n=\Delta^{-1/2}Y$$, $$X_n=\Delta^{-1/2}X$$, and $$\epsilon = \Delta^{-1/2}u$$. Obviously, $$\epsilon \sim N(0, \sigma^2 I)$$. Then the new model met the general linear model requirements. From here you can estimate $$\beta$$s and $$\sigma^2$$ following the linear model. $$\hat \beta_{GLS}$$ in your question is correct. But the estimate of $$\sigma^2$$ should come from the residual of $$Y_n$$, i.e., $$Y_n-X_n\hat \beta_{GLS}$$.