# Distribution sum of squared correlated normal random variables

Assume we have $$n$$ non-iid standard normal random variables $$X_i$$. I'm interested in the distribution of $$Z=\sum X_i^2$$. It is clear to me, that the sum of independent $$n$$ squared standard normal variables will follow a chi-squared distribution with n degrees of freedom. However, as said above, we assume the $$X_i$$ to be pairwise correlated. To be more precise:

Assume we have $$n$$ non-iid standard normal random variables $$X_i (i=1,...n)$$ with mean vector $$\vec{\mu}= \vec 0$$ and covariance matrix $$\Sigma$$. Is it possible to calculate the distibution of $$Z$$ in dependence of $$\sigma_{ij}$$? Or $$\rho_{ij}$$ (as pairwise correlation coefficient)?

The distribution of $$Z$$ will depend on the full joint distribution of $$X = (X_1,X_2,...,X_n)^T$$. If you assume for example that $$X$$ has a multivariate normal distribution with covariance matrix $$\Sigma$$, then by performing a unitary transformation that diagonalizes the covariance matrix you can express $$Z$$ as a weighted sum of independent $$\chi^2_1$$ random variables :
$$Z = X^TX = \lambda_1 u_1^2 + \lambda_2 u_2^2 + ... + \lambda_n u_n^2$$ $$u_i^2 \overset{\mathrm{iid}}{\sim} \chi^2_1$$
where $$\lambda_i$$ are the eigenvalues of $$\Sigma$$.
For $$n=2$$ you can find a closed form for the distribution of $$Z$$, but not for the general case (see e.g. here). You can however find the moments of $$Z$$, for example:
$$Var(Z) = \sum_i \lambda_i^2 Var(u_i^2) = 2 \sum_i \lambda_i^2$$