# How to derive the density of the square of a standard normal and chi-squared density from the gamma density?

My question is two parts. My book defines the gamma density as:

$$g_n(x) = \lambda\frac{(\lambda x)^{n-1}}{(n-1)!}e^{-\lambda x},\space x>0$$

Part 1: In an example my book states that the following is a gamma density with $$\lambda = 1/2$$ and $$n = 1/2$$ (density for the square of a standard normal random variable):

$$f_{X^2}(r) = \frac{1}{\sqrt{2\pi r}}e^{-r/2},\space r >0$$

I can't figure out how to get this equation from the above, given that if n = 1/2 then I get a negative factorial in the denominator of the gamma density?

Part 2: More generally, $$f_{X^2}(r)$$ above is the density for the square of a standard normal random variable $$X$$. My book states that the sum of of the square of $$m$$ independent standard normal random variables ($$\mu_X = 0$$ and $$\sigma_X^2=1$$) is a gamma density with $$\lambda = 1/2$$ and $$n = m/2$$ (the chi-squared density). For the case of $$m=2$$ the density given in my book was

$$f_{R^2}(r)=1/2e^{-r/2},\space r>0$$

I tried computing the convolution between $$f_{R^2}$$ and $$f_{X^2}$$ and ended up with:

$$f_{Z^2}(z)=\frac{1}{\sqrt{2\pi}}\sqrt{z}e^{-z/2}, \space z > 0$$

Again I couldn't arrive at this result by plugging in $$\lambda = 1/2$$ and $$n = 3/2$$ into the gamma function.

• – StubbornAtom Jun 1 '19 at 18:14

You need to use the general definition of Gamma function. For any $$\alpha>0,$$ $$\Gamma(\alpha)$$ is defined as $$\Gamma(\alpha)=\int_0^{\infty}x^{\alpha-1}e^{-x}dx.$$
An important property of the Gamma function is that $$\Gamma(\alpha+1)=\alpha\Gamma(\alpha).$$ This is proved here.
Another fact is that $$\Gamma\left(\dfrac{1}{2}\right)=\sqrt{\pi}.$$ Here is the proof.
Moreover, this function reduces to $$\Gamma(\alpha)=(\alpha-1)!$$ when $$\alpha$$ is a natural number. With this definition, the Gamma distribution is defined as $$g_{n,\lambda}(x)=\dfrac{\lambda^nx^{n-1}e^{-\lambda x}}{\Gamma(n)},\,\,x>0.$$
The pdf you have derived for sum of squares of three standard normal random variables, is correct. You can check that this is indeed the $$g\left(\dfrac{3}{2},\dfrac{1}{2}\right)$$ density, using the fact that $$\Gamma\left(\dfrac{3}{2}\right)=\dfrac{1}{2}\times\Gamma\left(\dfrac{1}{2}\right)=\dfrac{\sqrt{\pi}}{2}.$$
@ArnabAuddy has already answered part 1, so I'll talk about part 2. Let's first consider the case $$m=1$$, for which we just have the distribution of $$X^2$$ with $$X\sim N(0,\,1)$$. The characteristic function of $$X^2$$ is $$\Bbb E\exp itX^2=\int_{\Bbb R}\frac{1}{\sqrt{2\pi}}\exp\left(-\frac{1-2it}{2}x^2\right)dx=(1-2it)^{-1/2}.$$A general value of $$m$$ therefore obtains characteristic function $$(1-2it)^{-m/2}$$, as does the claimed Gamma distribution. Since distinct distributions have different characteristic functions, this completes the proof.