# Proving transformations of two independent chi-squared random variables is equivalent to a Beta distribution

I came across the following in some old class notes of mine:

if $$\chi_{v_{1}}^{2}$$ is independent of $$\chi_{v_{2}}^{2}$$ then $$\frac{\chi_{v_{1}}^{2}}{\chi_{v_{1}}^{2}+\chi_{v_{2}}^{2}}\backsim Beta\left(\alpha=\frac{v_{1}}{2},\beta=\frac{v_{2}}{2}\right)$$,

but there was no proof presented. I tried to prove this on my own, but I'm getting stuck when trying to get the $$(1-x)^{\beta-1}$$ term from the $$Beta(\alpha, \beta)$$ distribution to appear. My attempt is below, but I'm getting stuck, so I'd appreciate it if anyone could help me figure out where I've gone wrong or perhaps next steps to take to prove this.

$$\begin{eqnarray*} \frac{\chi_{v_{1}}^{2}}{\chi_{v_{1}}^{2}+\chi_{v_{2}}^{2}} & = & \frac{\chi_{v_{1}}^{2}}{\chi_{v_{1}+v_{2}}^{2}}&(\text{independence})\\ & = & \frac{x^{(v_{1}/2)-1}e^{x/2}}{\Gamma\left(\frac{v_{1}}{2}\right)2^{\left(v_{1}/2\right)}}\cdot\frac{\Gamma\left(\frac{v_{1}}{2}+\frac{v_{2}}{2}\right)2^{\left[\left(v_{1}+v_{2}\right)/2\right]}}{x^{(v_{1}+v_{2}/2)-1}e^{x/2}}\\ & = & \frac{x^{\alpha-1}}{\Gamma\left(\alpha\right)2^{\alpha}}\cdot\frac{\Gamma\left(\alpha+\beta\right)2^{(\alpha+\beta)}}{x^{\alpha+\beta-1}}&(\text{letting } \frac{v_{1}}{2}=\alpha ,\frac{v_{2}}{2}=\beta )\\ & = & \frac{\Gamma\left(\alpha+\beta\right)}{\Gamma\left(\alpha\right)}2^{\beta}x^{\alpha-1}x^{-\alpha-\beta+1}\\ & = & \frac{\Gamma\left(\alpha+\beta\right)}{\Gamma\left(\alpha\right)\Gamma\left(\beta\right)}\Gamma\left(\beta\right)2^{\beta}x^{\alpha-1}x^{-\alpha-\beta+1}\\ & = & \frac{1}{Beta(\alpha,\beta)}x^{\alpha-1}x^{-\alpha-\beta+1}\\ & = & \frac{1}{Beta(\alpha,\beta)}x^{\alpha-1}\underset{ \text{need } (1-x)^{\beta-1} \text{term from this?}}{\underbrace{\Gamma\left(\beta\right)2^{\beta}x^{-\alpha-\beta+1}}} \end{eqnarray*}$$

So, it seems like I should be able to make the terms gathered above the underbrace to form the $$(1-x)^{\beta-1}$$ term, but I can't see how to do this. It's entirely possible I've gone wrong someplace as well. I'd appreciate any help.

I don't understand what you are doing, so only some hints. One problem with your development is that numerator and denominator is not independent. Define the independent random variables $$X \sim \chi^2_{\nu_1}, \quad Y\sim \chi^2_{\nu_2}$$. You are interested in the distribution of the ratio $$R=\frac{X}{X+Y}$$. Then $$R = \frac{X}{X+Y}= \frac{1}{1+\frac{Y}{X}}=\frac{1}{1+\frac{\nu_2}{\nu_1}\frac{Y/\nu_2}{X/\nu_1}}=\frac{1}{1+\frac{\nu_2}{\nu_1}F}$$ where now $$F$$ is a random variable with the F distribution, $$F\sim \mathcal{F}_{\nu_2,\nu_1}$$. The density of the $$F$$ distribution is known, so use that together with what you know about finding densities for transformations of random variables.

• Ahhh, of course!! I think you nailed it-I can't assume the numerator and denominator are independent like I've done. I can't believe I missed that somehow. I think that's exactly where I ran off course! Thank you so much for your comment! – StatCurious May 6 at 14:15
• Thanks, @kjetilbhalvorsen. See my answer below. – StatCurious May 6 at 21:43

The key is to keep track of the differentials.

Let's begin with the definitions, but focus on the essentials:

• A chi-squared distribution is a rescaled Gamma distribution. Such distributions are determined by their densities, which (up to a normalizing constant) have the form $$f(x;\alpha)=x^\alpha e^{-x} \frac{\mathrm{d}x}{x}$$ for positive $$x$$ (and are zero for non-positive $$x$$). This way of writing the density (using $$\mathrm{d}x/x$$ instead of $$\mathrm{d}x$$ for the differential element) results from a fundamental symmetry explained at https://stats.stackexchange.com/a/185709/919.

• A beta distribution has a density proportional to $$g(x;a,b)=x^a (1-x)^b \frac{\mathrm{d}x}{x(1-x)}$$ for $$0 \lt x \lt 1.$$ (This differential element arises from $$\frac{\mathrm{d}x}{x(1-x)} = \frac{\mathrm{d}x}{x} + \frac{\mathrm{d}x}{1-x},$$ strongly hinting at an underlying symmetry.)

The bivariate density for an independent pair of chi-squared variables will, by definition of independence, be proportional to the product $$f(x;\alpha)f(y;\beta).$$ To get this into the form $$g,$$ the question invites us to perform a change of variables to $$(s,t)$$ where one of them--say $$s$$--represents the quotient $$x/(x+y).$$ Staring at this for a minute suggests trying $$t=x+y$$ for the other variable. That is, set

$$(s,t) = \left(\frac{x}{x+y}, x+y\right).$$

This is invertible with the inverse given by

$$(x,y) = (st, (1-s)t).\tag{1}$$

We need to convert the differential element $$\mathrm{d}x\mathrm{d}y$$ appearing in the product of the $$f$$'s into a multiple of the differential element $$\mathrm{d}s\mathrm{d}t.$$ You could use Jacobians, but I find it easier to interpret each as a wedge product and to use the natural elements suggested by the forms taken by $$f$$ and $$g,$$ thus:

$$\frac{\mathrm{d}x}{x} = \frac{s\mathrm{d}t + t\mathrm{d}s}{st} = \frac{\mathrm{d}t}{t} + \frac{\mathrm{d}s}{s}$$

and, similarly,

$$\frac{\mathrm{d}y}{y} = \frac{\mathrm{d}t}{t} - \frac{\mathrm{d}s}{1-s}.$$

Therefore

$$\frac{\mathrm{d}x}{x}\wedge \frac{\mathrm{d}y}{y} = \left(\frac{\mathrm{d}t}{t} + \frac{\mathrm{d}s}{s}\right) \wedge \left(\frac{\mathrm{d}t}{t} - \frac{\mathrm{d}s}{1-s}\right) = \frac{\mathrm{d}t}{t}\wedge \frac{\mathrm{d}s}{s(1-s)}.\tag{2}$$

The change of variables is effected by plugging $$(1)$$ and $$(2)$$ into the product of the $$f$$'s:

\eqalign{ f(x;\alpha)f(y;\beta) &= x^\alpha y^\beta e^{-(x+y)} \frac{\mathrm{d}x}{x}\frac{\mathrm{d}y}{y} \\ &= (st)^\alpha ((1-s)t)^\beta e^{-t} \frac{\mathrm{d}t}{t} \frac{\mathrm{d}s}{s(1-s)} \\ &= s^\alpha (1-s)^\beta\frac{\mathrm{d}s}{s(1-s)}\ t^{\alpha+\beta} e^{-t} \frac{\mathrm{d}t}{t} \\ &= g(s;\alpha,\beta) f(t;\alpha+\beta). }

The form of this result shows that

When $$X$$ has a Gamma$$(\alpha)$$ distribution and the independent variable $$Y$$ has a Gamma$$(\beta)$$ distribution, the variable $$S=X/(X+Y)$$ has a Beta$$(\alpha,\beta)$$ distribution and the variable $$T=X+Y$$ is independent of $$S$$ and has a Gamma$$(\alpha+\beta)$$ distribution.

At this point we might wonder what the rescaling (of a Gamma to a chi-squared distribution) does to the result. Because $$S=X/(X+Y)$$ is a homogeneous function of $$(X,Y),$$ rescaling $$X$$ and $$Y$$ by the same amounts will not change $$S$$. It will obviously rescale $$T=X+Y$$ by the same factor. Thus, $$S$$ still has a Beta distribution and $$T$$ now has a chi-squared distribution, QED.

• Wow. What an amazing answer! Thank you, @whuber. I'll spend some time today going through this and if all look good (I'm sure it will), I'll come back and accept this very thorough answer. Much appreciated for the time you put into this answer! – StatCurious May 6 at 14:16
• Thanks, @whuber. See my answer below. – StatCurious May 6 at 21:43

The problem I had as @kjetil aptly pointed out was that I had incorrectly assumed the numerator and denominator were independent, which is obviously not true. All I needed really to to do was to rewrite the ratio $$Y=W/(W+U)$$, where $$W\sim\chi_{v_{2}}^{2}\perp U\sim\chi_{v_{1}}^{2}$$ as follows:

$$\begin{eqnarray*} Y=\frac{W}{W+U} & = & \frac{1}{1+\frac{U}{W}}=\frac{1}{1+\frac{v_{2}}{v_{1}}\frac{\frac{U}{v_{2}}}{\frac{W}{v_{1}}}}=\frac{1}{1+\frac{v_{2}}{v_{1}}X} \end{eqnarray*}$$ where $$X\sim F_{v_{2},v_{1}}$$. Letting $$\alpha=v_{1}/2$$ and $$\beta=v_{2}/2$$ and using standard one-to-one transformation of random variable techniques, we have an inverse transformation of . $$g^{-1}(y)=\frac{\alpha}{\beta}(1-y)y^{-1}$$ which leads to:

$$\begin{eqnarray*} f_{Y}(y) & = & f_{X}\left(g^{-1}(y)\right)\left|\frac{d}{dy}g^{-1}\left(y\right)\right|\\ & = & \frac{\Gamma\left(\frac{\alpha}{2}+\frac{\beta}{2}\right)}{\Gamma\left(\frac{\alpha}{2}\right)\Gamma\left(\frac{\beta}{2}\right)}\left(\frac{\beta}{\alpha}\right)^{\beta}\frac{\left[\frac{\alpha}{\beta}(1-y)y^{-1}\right]^{\beta-1}}{\left[1+\left(\frac{\beta}{\alpha}\right)\frac{\alpha}{\beta}(1-y)y^{-1}\right]^{\alpha+\beta}}\left(\frac{\alpha}{\beta}\right)y^{-2}\\ & = & \frac{1}{B(\alpha,\beta)}\left(\frac{\beta}{\alpha}\right)^{\beta}\left(\frac{\alpha}{\beta}\right)^{\beta-1}\left(\frac{\alpha}{\beta}\right)y^{-2}\frac{\left[(1-y)y^{-1}\right]^{\beta-1}}{\left[1+y^{-1}-1\right]^{\alpha+\beta}}\\ & = & \frac{1}{B(\alpha,\beta)}\left(\frac{\beta}{\alpha}\right)^{\beta}\left(\frac{\beta}{\alpha}\right)^{-\beta+1}\left(\frac{\beta}{\alpha}\right)^{-1}y^{-2}\frac{\left[(1-y)y^{-1}\right]^{\beta-1}}{\left[y^{-1}\right]^{\alpha+\beta}}\\ & = & \frac{1}{B(\alpha,\beta)}y^{-2}\left[(1-y)y^{-1}\right]^{\beta-1}y^{\alpha+\beta}\\ & = & \frac{1}{B(\alpha,\beta)}y^{-2}(1-y)^{\beta-1}y^{-\beta+1}y^{\alpha+\beta}\\ & = & \frac{1}{B(\alpha,\beta)}y^{-2-\beta+1+\alpha+\beta}(1-y)^{\beta-1}\\ & = & \frac{1}{B(\alpha,\beta)}y^{\alpha-1}(1-y)^{\beta-1} \end{eqnarray*}$$

for $$0\le z\le1,\,\alpha>0,\beta>0$$, which is a $$Beta\left(\alpha=\frac{v_{1}}{2},\beta=\frac{v_{2}}{2}\right)$$distribution, which completes the proof. QED.

Thank you for everyone's helpful comments which put me on the right track to prooving this. I really wish I could award both whuber and kjetil b. halvorsen points for the right answer because both are really deserving, but I think kjetil's answer was more helpful to leading me to the right answer and was a bit easier to digest, so I'm afraid, if I can only accept one answer, it will be his.