
> 
> Suppose that $X\_1,\ldots,X\_n$ are iid $N(0,1)$ random variables. Consider the random variable given by
> $$
> \xi\_n
> =\Bigl|\frac1{\sqrt{n}}\sum\_{t=1}^nX\_t\Bigr|^2-\frac1n\sum\_{t=1}^nX\_t^2
> =\frac1n\sum\_{s\ne t}X\_sX\_t.
> $$
> What is the distribution of $\xi\_n$?
> 
> 
> 


My observations are as follow.


1. We have that $n^{-1/2}\sum\_{t=1}^nX\_t\sim N(0,1)$ and $|n^{-1/2}\sum\_{t=1}^nX\_t|^2\sim\chi^2(1)$, where $\chi^2(k)$ is the chi-square distribution with $k$ degrees of freedom.
2. $\sum\_{t=1}^nX\_t^2\sim\chi^2(n)$ and $n^{-1}\sum\_{t=1}^nX\_t^2\sim\Gamma(k=n/2,\theta = 2n^{-1})$ (see [here](https://en.wikipedia.org/wiki/Chi-square_distribution#Related_distributions)).
3. $|n^{-1/2}\sum\_{t=1}^nX\_t|^2$ and $n^{-1}\sum\_{t=1}^nX\_t^2$ are not independent since the covariance between them is equal to $2/n$ (although the covariance goes to $0$ as $n\to\infty$).
4. $n^{-1}\sum\_{t=1}^nX\_t^2\to 1$ in probability as $n\to\infty$ using the law of large numbers and hence it follows that $\xi\_n\to \chi^2(1)-1$ in distribution as $n\to\infty$ using Slutsky's theorem. However, I am interested if the exact distribution has some manageable form when $n$ is some fixed positive integer.


If $|n^{-1/2}\sum\_{t=1}^nX\_t|^2$ and $n^{-1}\sum\_{t=1}^nX\_t^2$ were independent, then we could try to use the answers to [this question](https://stats.stackexchange.com/q/48378/46220) to derive the exact distribution. But they are not independent. Maybe [Cochran's theorem](https://en.wikipedia.org/wiki/Cochran%27s_theorem) might be of use here.


Does the exact distribution of $\xi\_n$ have some manageable expression?


Any help is much appreciated!



Distribution of a certain functional of iid $N(0,1)$ random variables
For $X\_1,\dots, X\_n$ Gaussian random variables with variance-covariance matrix $M$, and $L$ a $m \times n$ matrix, the variables $Y\_1,\dots, Y\_m$ given by $Y\_i = \sum\_{j=1}^n L\_{ij} X\_j$ have variance-covariance matrix $L M L^T$.


This follows immediately from writing the covariance as an expectation of products of sums, exchanging the sum and product, and then exchanging the sum and expectation.


In particular, if $M$ is the identity matrix, and $L$ is an $n \times n$ orthogonal matrix, then the $Y\_i$ have variance-covariance matrix the identity, hence are independent standard Gaussians (because Gaussians are determined by their variance-covariance matrix (and mean, which is zero throughout this discussion and hence can be ignored)).


Given any quadratic function $\sum\_{i=1}^n \sum\_{j=1}^n C\_{ij} X\_i X\_j$ of the $n$ Gaussian random variables, determined by a matrix $C$, which without loss of generality we can assume is symmetric, we can understand the distribution of $C$ by changing variables from the $X\_i$ to the $Y\_i$. This has the effect of sending $C$ to $ L^{-1} C L^{-T}$, which if $L$ is orthogonal is $L^T C L$.


Since every symmetric matrix can be diagonalized, we can make $C$ a diagonal matrix by this approach.


In your case $C$ is the matrix with off-diagonal entries $\frac{1}{n}$ and diagonal entries $0$. By viewing this as the all-$\frac{1}{n}$s matrix minus a diaogonal matrix, we see it has eigenvalues $\frac{n-1}{n}, \frac{-1}{n},\dots, \frac{-1}{n}$, and thus diagonalizing it turns it into a diagonal matrix with entries $\frac{n-1}{n}, \frac{-1}{n},\dots, \frac{-1}{n}$.


To be explicit we can find a specific orthonormal basis on which the matrix diagoanlizes, of which one vector must be $\frac{1}{\sqrt{n}},\dots, \frac{1}{\sqrt{n}}$ and the rest can be any orthonormal basis orthogonal to it - one of which I wrote down in the comment.


