# Sum of weighted chi square distributions

Let $X_1 \sim \chi_{k}^2$ and $X_2 \sim \chi_{k}^2$ be i.i.d and both $a_1$ and $a_2$ positive real values.

How can be expressed the PDF of $Y = a_1X_1 + a_2X_2$? Is it also a chi-square distribution?

thanks

• According to this article, it would appear that it's a scaled infinite sum of gamma distributions: sciencedirect.com/science/article/pii/089812218490066X Jun 13, 2015 at 23:24
• Thr are several misunderstandings in your question. You write "both i.i.d" which doesnt have maning, you probably want only "i.i.d." To be iid is not a property one random variable can have, it is a property of a collection of random variables (here $X, Y$). Jun 13, 2015 at 23:39

A linear combination of chi-squared random variables is not, in general, chi-squared

The answer is NO unless the $a_i$ are either 0 or 1. This is easy to see by looking at moment generating functions. (Also, by looking at means and variances, see Addendum.)

Such distributions occur often in practice.

The issue of the distribution $Y$ is of interest in many practical situations. An elementary example is in trying to find a confidence interval (CI) for the 'batch' variance $\sigma_B$ in a random-effects one-factor ANOVA model $Y_{ij} = \mu + B_{i} + e_{ij},$ where $i = 1,\dots,b$ batches, $j = 1, \dots, r$ replications per batch, $B_i \text{ iid Norm(}0, \sigma_B^2\text{)}$ and $e_{ij} \text{i id Norm (}0, \sigma_e^2\text{)}.$

The error mean square in the ANOVA table is an unbiased estimate of $\sigma_e^2$ and a CI for it can be constructed using an obvious chi-squared distribution. However, the mean square for batches is influenced by both $\sigma_A^2$ and $\sigma_e^2.$ A method of moments estimate of $\sigma_A^2$ is a linear combination of the two mean squared terms and its distribution would be a linear combination of chi-squared distributions.

You might look at some of the methods that have been attempted to approximate the distribution and find CIs for batch variances. In this case, one of the $a_i$s is negative. (One very nice solution to the problem involves a Bayesian formulation of the ANOVA and using a Gibbs sampler to get an interval estimate, but that has nothing to do with solving your problem.)

Addendum with simulation: Below is a brief simulation of 100,000 realizations of $S = X_1 + X_2,$ where $X_1 \sim \text{Chisq}(5), X_2 \sim \text{Chisq}(10)$ and also of $T = 3X_1 + 0.5X_2.$ The sample of $S$ passes a Kolmogrorv- Smirnov goodness-of-fit test for matching $\text{Chisq}(15)$ and also has mean and variance compatible with this distribution. However, there can be no chi-squared distribution with mean $E(T) = 3(5) + 0.5(10) = 20$ and variance $V(T) = 9(10) + 0.25(20) = 95 \ne 40.$

In practical applications, distributions of linear combinations of chi-squared random variables are often approximated by simulation.

 x1 = rchisq(10^5, 5);  x2 = rchisq(10^5, 10)
s = x1 + x2;  mean(s);  var(s)
## 15.02936  # E(S) = 15 as for Chisq(15)
## 30.07302  # V(S) = 30 as for Chisq(15)
t = 3*x1 + .5*x2;  mean(t);  var(t)
## 20.00794  # Not a possible combination of
## 94.5343   #   mean and var for a chisq distn.


PDF of weighted sum of TWO iid chi-square distributions:

Please check page 5 Corollary 1 https://arxiv.org/pdf/1208.2691.pdf