Let $t_i$ be drawn i.i.d from a Student t distribution with $n$ degrees of freedom, for moderately sized $n$ (say less than 100). Define
$$T = \sum_{1\le i \le k} t_i^2$$
Is $T$ distributed nearly as a chi-square with $k$ degrees of freedom? Is there something like the Central Limit Theorem for the sum of squared random variables?
Central Limit Theorem – What is the Sum of Squared T Variates?
central limit theoremchi-squared-distributionsums-of-squarest-distribution
Related Solutions
If $a, d\sim\chi^2_{2M}$ are independent, then $X=a+d$ will have $\chi^2_{4M}$ distribution. Since $X$ is non-negative, CDF of $Y=a^2+2ad+d^2=(a+d)^2=X^2$ can be found by noting $$F_Y(y)=P(Y\leq y)=P(X^2\leq y)=P(X\leq \sqrt{y})=F_X(\sqrt{y}).$$ Therefore, $$f_Y(y)=\frac{1}{2\sqrt{y}}f_X(\sqrt{y})=\frac{1}{2^{2M+1}\Gamma(2M)}y^{M-1}e^{-\sqrt{y}/2}.$$
If $a$ and $d$ are correlated then things are much more intricate. See for example N. H. Gordon & P. F. Ramig's Cumulative distribution function of the sum of correlated chi-squared random variables (1983) for a definition of multivariate chi-squared and distribution of its sum.
If $\mu\neq 2M$ then you are dealing with non-central chi-squared so the above will no longer be valid. This post may provide some insight.
EDIT: Based on the new information it seems $a$ and $d$ are formed by summing up normal r.v. with non-unit variance. Recall if $Z\sim N(0, 1)$ then $\sqrt{c}Z\sim N(0, c)$. Since now $$a=c\sum_{i=1}^{2M}Z_i^2=d,$$ both $a,d$ will have chi-squared distribution scaled by $c$, i.e. $\Gamma(M, 2c)$ distribution. In this case $X=a+d$ will be $\Gamma(2M, 2c)$ distributed. As a result, for $Y=X^2$ we have $$f_Y(y)=\frac{1}{2(2c)^{2M}\Gamma(2M)}y^{M-1}e^{-\sqrt{y}/2c}.$$
Multivariate Gaussian – Distribution of Magnitude of Samples from Multivariate Gaussian Distribution
This is not a complete answer so far, I will come back completing it when time. Using results and notation from What is the moment generating function of the generalized (multivariate) chi-square distribution?, we can write $$ \| Y \|^2 = Y^T Y $$ which we can write as a sum of $n$ independent scaled chisquare random variables (here it is central chisquare since the expectation of $Y$ is zero) $Y^T Y = \sum_1^n \lambda_j U_j^2$ with the following definitions taken from the link above. Use the spectral theorem to write $\Sigma ^{1/2} A \Sigma^{1/2} = P^T \Lambda P$ with $P$ orthogonal and $\Lambda$ diagonal with diagonal elements $\lambda_j$, $U=P Y$ then have independent standard normal components. Then we find the mgf of $Y^T Y$ as $$ M_{Y^T Y}(t) = \exp\left(-\frac12 \sum_1^n \log(1-2\lambda_j t) \right) $$ Then one can continue finding the expectation using the method from the link in comments. The expectation of $\sqrt{Y^T Y}$ is given by $$ \DeclareMathOperator{\E}{\mathbb{E}} D^{1/2} M (0) = \Gamma(1/2)^{-1}\int_{-\infty}^0 |z|^{-1/2} M'(z) \; dz $$ where $M(t)$ is the mgf above and $'$ denotes differentiation. Using maple we can calculate
M := (t,lambda1,lambda2,lambda3) -> exp( -(1/2)*( log(1-2*t*lambda1)+log(1-2*t*lambda2)+log(1-2*t*lambda3) ) )
which is the case with $n=3$. As an example, if the covariance matrix $\Sigma$ is the equicorrelation matrix with offdiagonal elements $1/2$, that is, $$ \Sigma=\begin{pmatrix} 1 & 1/2 & 1/2 \\ 1/2 & 1 & 1/2 \\ 1/2 & 1/2 & 1 \end{pmatrix} $$ then the eigenvalues $\lambda_j$ can be calculated as $2, 1/2, 1/2$. Then we can calculate
int( diff(M(z,2,1/2,1/2),z)/sqrt(abs(z)),z=-infinity..0 )/GAMMA(1/2)
obtaining the result.
$$
1/3\,{\frac {\sqrt {3}{\rm arctanh} \left(\sqrt {3}/2\right)+6}{
\sqrt {\pi}}}
$$
It is probably better to just use the option numeric=true
, we will not find some simple general symbolic answer. An example with other eigenvalues gives another symbolic form of the result:
int( diff(M(z,5,1,1/2),z)/sqrt(abs(z)),z=-infinity..0 )/GAMMA(1/2)
$$ -1/15\,{\frac {\sqrt {5} \left( 10\,i\sqrt {5}{\it EllipticF} \left( 3 \,i,1/3 \right) -9\,i\sqrt {5}{\it EllipticE} \left( 3\,i,1/3 \right) -30 \right) }{\sqrt {\pi}}} $$ (I now also suspect that at least one of this results returned by maple is in error, see https://www.mapleprimes.com/questions/223567-Error-In-A-Complicated-Integralcomplex?sq=223567)
Now I will turn to numerical methods, programmed in R. First, one idea is to use the saddlepoint approximation or one of the other methods from the answer here: Generic sum of Gamma random variables combined with the relation $f_{\text{chi}}(x)=2xf_{\text{chi}^2}(x^2)$, but first I will look into use of the R package CompQuadForm
, which implements several methods for the cumulative distribution function, and then numerical differentiation with the package numDeriv
, code follows:
library(CompQuadForm)
library(numDeriv)
make_pchi2 <- function(lambda, h=rep(1, length(lambda)), delta=rep(0, length(lambda)), sigma=0, ...) {
function(q) {
vals <- rep(0, length(q))
warning_indicator <- 0
for (j in seq(along=q)) {
res <- davies(q[j], lambda=lambda, h=h, delta=delta, sigma=sigma, ...)
if (res$ifault > 0) warning_indicator <- warning_indicator+1
vals[j] <- res$Qq
}
if (warning_indicator > 0) warning("warnings reported", warning_indicator)
vals <- 1-vals # converting to cumulative probabilities
return(vals)
}
}
pchi2 <- make_pchi2(c(2, 0.5), c(1, 2))
# Construction a density function via numerical differentiation:
make_dchi <- function(pchi) {
function(x, method="simple") {
side <- ifelse(x==0, +1, NA)
vals <- rep(0, length(x))
for (j in seq(along=x)) {
vals[j] <- grad(pchi, x[j]^2, method=method, side=side[j])
}
vals <- 2*x*vals
return(vals)
}
}
dchi <- make_dchi(pchi2)
plot( function(x) dchi(x, method="Richardson"), from=0, to=7, main="density of generalized chi distribution", xlab="x", ylab="density", col="blue")
which gives this result:
and we can test with:
integrate(function(x) dchi(x, method="Richardson"), lower=0, upper=Inf)
0.9999565 with absolute error < 0.00011
Back to (approximation) for the expected value. I will try to get some approximation for the moment generating function of $Y^T Y $ for large $n$. Start with the expression for the mgf $$ M_{Y^T Y}(t) = \exp\left(-\frac12 \sum_1^n \log(1-2\lambda_j t) \right) $$ found above. We concentrate on its logarithm, the cumulant generating function (cgf). Assume that when $n$ increases, then the eigenvalues will approximatly come from some distribution with density $g(\lambda)$ on $(0,\infty)$ (in the numerical examples we will just use the uniform distribution on $(0,1)$). Then the sum above divided into $n$ will be a Riemann sum for the integral $$ I(t) = \int_0^\infty g(\lambda) \log(1-2\lambda t)\; d\lambda $$ for the uniform distribution example we will find $$ I(t) = \frac{2t\ln(1-2t)-\ln(1-2t)-2t}{2t} $$ Then the mgf will be (approximately) $M_n(t)=e^{-\frac{n}2 I(t)}$ and the expected value of $\| Y \|$ is $$ \Gamma(1/2)^{-1} \int_{-\infty}^0 |z|^{-1/2} M_n'(z) \; dz $$ This seems to be a difficult integral, some work seems to show that the integrand has a vertical asymptote at zero, for instance maple refuses to do a numerical integration (but uses abnormally long time). So it might be that a better strategy is to use numerical integration using the density approximations above. Nevertheless, this approach seems to indicate that the dependence on $n$ should not be very dependent on the eigenvalue distribution.
Going for numerical integration in R, that also shows to be difficult. First some code:
E <- function(lambda, h=rep(1, length(lambda)), lower, upper, ...) {
pchi2 <- make_pchi2(lambda, h, acc=0.001, lim=50000)
dchi <- make_dchi(pchi2)
val <- integrate(function(x) x*dchi(x), lower=lower, upper=upper, subdivisions=10000L, stop.on.error=FALSE)$value
return(val)
}
Some experimentation with this code, using the integration limits lower=-Inf, upper=0
, shows that for a large number of eigenvalues, the result is 0! The reason is that the integrand is zero "almost everywhere", and the integration routine misses the dump. But plotting the integrand first, and choosing a sensible interval, we can get reasonable results. For the example I am using uniformly distributed eigenvalues between 1 and 5, with varying $n$. So for $n=5000$ the following code:
E(seq(from=1, to=5, length.out=5000), lower=-130, upper=-110)
works. This way we can compute the following results:
n Expected value Approximation
[1,] 5 3.656979 3.890758
[2,] 15 6.581486 6.738991
[3,] 25 8.559964 8.700000
[4,] 35 10.161615 10.293979
[5,] 45 11.544113 11.672275
[6,] 55 12.777101 12.904185
[7,] 65 13.901465 14.028328
[8,] 75 14.941275 15.068842
[9,] 85 15.915722 16.042007
[10,] 95 16.830085 16.959422
[11,] 105 17.697715 17.829694
[12,] 500 38.702620 38.907583
[13,] 1000 54.749000 55.023631
[14,] 5000 122.449200 123.036580
Where the last column is calculated as $1.74 \sqrt{n}$, and is found by regression analysis. We show this as a plot:
The fit is quite good, indicating that a reasonable guess is that the expectation grows with the square root of $n$, with a prefactor which probably depends on the eigenvalue distribution.
Best Answer
Answering the first question.
We could start from the fact noted by mpiktas, that $t^2 \sim F(1, n)$. And then try a more simple step at first - search for the distribution of a sum of two random variables distributed by $F(1,n)$. This could be done either by calculating the convolution of two random variables, or calculating the product of their characteristic functions.
The article by P.C.B. Phillips shows that my first guess about "[confluent] hypergeometric functions involved" was indeed true. It means that the solution will be not trivial, and the brute-force is complicated, but necessary condition to answer your question. So since $n$ is fixed and you sum up t-distributions, we can't say for sure what the final result will be. Unless someone has a good skill playing with products of confluent hypergeometric functions.