# Variance estimation in Random Effects model

I'm studying panel data models in my introductory econometrics class, especially random effects models.

Consider the model: $$y_{it}=x_{it}'\beta +c_i+u_{it}$$ with the assumptions $E[c_i]=0=E[u_{it}]$, $E[c_i^2]=\sigma^2_c$, $E[u_{it}]=\sigma_u^2$, $\text{Corr}(x_{it},c_i)=0$ and $\text{Corr}(x_{is},u_{it})=0$.

Denote composite error term $c_i+u_{it}=v_{it}$ and $\Omega=E[v_iv_i']$

We've learned that we can estimate $\beta$ consistently using feasible generalised least squares where we estimate $\Omega$ from $\Omega=\sigma_u^2 I+\sigma_c^2 \iota \iota'$ where $I$ is identity and $\iota$ is appropriate sized vector of ones. Using fixed effect residuals $\hat{e}$, with number of cross section observations $N$ and time observations $T$, we get an estimate: $$\hat{\sigma}_u^2=\frac{1}{N\cdot(T-1)}\sum_{i=1}^N \sum_{t=1}^T \hat{e}_{it}^2$$

Furthermore, estimating the between model and estimating error variance, we get and estimate of variance of $\eta=c_i+\bar{u}_i$. Now we can estimate $\hat{\sigma}_c^2$ from: $$\hat{\sigma}_c^2=\hat{\sigma}_{\eta}^2-\frac{1}{T}\hat{\sigma}_u^2$$

(I hope that was enough details, if not please let me know).

Now my question is, what happens if this is negative? Is it an indication of some error, or just something that can happen in finite samples? What should I do about it? Last, what is this estimation called, and are there other ways of estimating that variance?

I hope my question is well formulated and on the right Stack Exchange—I am by no means proficient in statistics/econometrics.

As to another way of estimating the variance, yes there is. First off, you need to correct for the number of estimated parameters in $\hat{\sigma}_u^2$, so the denominator becomes: $NT-N-K$ (I'm guessing this was a typo). Second of all, we want to estimate $\sigma_u^2$ and $\sigma_c^2$. You have already found $\hat\sigma_u^2$, so using: $$\sigma_v^2=\sigma_u^2+\sigma_c^2\Leftrightarrow \sigma_c^2=\sigma_v^2-\sigma_u^2,$$ we can find $\hat\sigma_c^2$ by running the Pooled OLS estimator on your sample (why? because this is consistent, although not efficient under you assumptions) and obtain $\hat\sigma_v^2$. Then it's just a matter of subtracting the two variance estimates from each other. Then you are ready to apply your FGLS-estimator.