Given $X_i \sim \mathcal{N}(\mu_i,\sigma_i^2)$, for $i = 1,\dots,n$. How does one find the distribution of $D = \sum_{i=1}^n X_i^2$? In the case that all the standard deviations are the same (i.e. $\sigma_i = \sigma_1$ for all $i$), the random variable $D/\sigma_1^2$ has a noncentral chi-squared distribution. But when I don't have this simplifying assumption I don't know what to do. Is there a well known distribution for this?
2 Answers
All you could conceivably want to know about the subject (and many things you might not) are in Mathai + Provost, Quadratic Forms in Random Variables.
I can write a formula, but I doubt you will like it. Set
$$ \rho(x_1,\dotsc, x_n)=\frac{1}{(2\pi)^{\frac{n}{2}}\sigma_1\cdots\sigma_n} \exp\left(-\sum\frac{(x_i-\mu_i)^2}{2\sigma_i^2}\right) $$
denote the joint probability density of $(X_1,\dotsc, X_n)$ which I assumed to be independent. The probability density of $D$ is
$$ d(t)=\frac{1}{2\sqrt{t}}\int_{|x|=\sqrt{t}} \rho(x) dS(x), $$
where $dS(x)$ denotes the area element on the sphere $\{|x|=\sqrt{t}\}$.