What is Sigma in the Gibbons Ross Shanken (GRS) test?

I am trying to figure out what $\Sigma$ means in this GRS formula:

$$F_{GRS} = \frac{T - K - N}{N} \frac{\hat{\alpha}^T \hat{\Sigma}^{-1} \hat{\alpha}} {1 + \hat{\mu}_{K}^T \hat{\Sigma}_{K}^{-1} \hat{\mu}_{K}}$$

The goal is to determine whether the alphas are statistically different from 0.

First, we start with a matrix of factors and a matrix of test assets. We regress each excess returns of each test asset on the factors:

$$r_t^e = \hat{\alpha} + \hat{B} r_{Kt}^{e} + \hat{e_t}$$

• The alphas from the above regression are the $\hat{\alpha}$.
• $T$ is the number of observations in each factor (or test asset).
• $K$ is the number of factors.
• $N$ is the number of test assets.
• $\hat{\Sigma}_{K}^{-1}$ is the covariance matrix of all the factors,which is $K \times K$
• $\hat{\mu}_{K}$ is the means of each factor, which is $K \times 1$.

I think I have the above right, but I am not sure what $\hat{\Sigma}$ is. I think it is either a covariance matrix of test asset returns or covariance matrix of residuals associated with each test asset from the regression equation above. I tried to convince myself that those are the same thing, but I believe that this is the case only when the coefficients on all factors are 0.

I looked at this thread and it seems that $\hat{\Sigma}$ is a covariance matrix of test asset returns, but I am not sure whether I am reading that code properly.

-

I just had a glance at the original paper, "Gibbons, Ross, Shanken (GRS) (1989) "A Test of the Efficiency of a Given Portfolio" and it seems to me that $\Sigma$ is the covariance matrix of the idiosyncratic component of asset returns, not the covariance matrix of the asset returns themselves.
For example, let $r_p$ denote the return on the portfolio you are testing, and let $r_j$ denote the return on the jth asset. GRS consider linear models of the form: $$r_{j,t} = \alpha_{j,p} + \beta_{j,p} r_{p,t} + e_{j,t} .$$ Let $\mathbf{e}_t = (e_{1,t}, ..., e_{j,t}, ..., e_{J,t})^\prime$, (assume $J$ assets) then typically $\Sigma = \mathbb{E} \mathbf{e}_t \mathbf{e}_t^\prime$, where $\Sigma$ is assumed to not depend on $t$.
To obtain an estimator for $\Sigma$, ie $\hat{\Sigma}$, Campbell, Lo, Mackinlay (1990) "The Econometrics of Financial Markets", suggest obtaining the residuals $\hat{e}_{j,t}$ from OLS regressions of the above model for $j = 1, ..., J$, and then just using the sample covariance formula (multivariate version) on these OLS residuals. ie: $T^{-1} \sum_t \hat{\mathbf{e}}_t \hat{\mathbf{e}}_t^\prime$. Obviously for this to be a half decent estimator you will need $T$ (the number of observations) to be much larger than $J$, the number of assets.