# What is the distribution of this nearly-Hotelling statistic?

Let $X$ be an $n \times l$ matrix, and $F$ an $n \times p$ matrix, with the rows of $X$ and $F$ drawn i.i.d. from multivariate Gaussians. (The independence applies to rows: the $X$ and $F$ may be correlated.) Let $\Sigma_X, \Sigma_F, \Sigma_{XF}$ be the covariances of the two Gaussians and the covariance of the two Gaussians with each other. (It may be simpler to think of a single multivariate Gaussian which I have partitioned into two parts.) Given $p$-variate vector $v$, I would like to compute the distribution of $$v^{\top}(F^{\top}F)^{-1}F^{\top}X\left(X^{\top}X - X^{\top}F(F^{\top}F)^{-1}F^{\top}X\right)^{-1}X^{\top}F(F^{\top}F)^{-1}v$$

I am usually looking at the case where one of the columns of $F$ is all ones (which we can model as a Gaussian with a very small variance, if need be). In the case where $p = 1$ and $F$ is all ones, then we recover Hotelling's $T^2$ (up to scaling of $v$, which I ignore here). In fact I arrived at this monster by asking the question: given $l$-variate vector $w$, letting $y=Xw$, then regressing $y$ against $F$ to get $\hat{\beta}$, and computing the t-statistics associated with $v$ (i.e. $(\hat{\beta}^{\top}v)/(\hat{\sigma}\sqrt{v^{\top}(F^{\top}F)^{-1}v})$), what is the maximal value of the t-statistic over all $w$?