# Thread: Method of moment generating function with Gamma Distribution

1. ## Method of moment generating function with Gamma Distribution

Assume that $\displaystyle Y_1, \ Y_2, ... \ Y_n$ is a sample space of size n from a gamma distribution population with $\displaystyle \alpha = 2$ and $\displaystyle \beta$ unknown.

Us the method of moment generating function to show that $\displaystyle 2 \sum_{i=1}^n \frac{Y_i}{\beta}$ is a pivotal quantity and has a $\displaystyle \chi^2$ distribution with 4n df.

I know that the moment generating function of a Gamma Distribution is $\displaystyle (1-\beta t)^{-\alpha}$.

I attempted to replicate http://www.mathhelpforum.com/math-he...-function.html, but got nowhere. I figure it has to like:

$\displaystyle (1-2t)^{-4n}$ since that's the mgf of a $\displaystyle \chi^2$ distribution with 4n df.

2. Originally Posted by lllll
Assume that $\displaystyle Y_1, \ Y_2, ... \ Y_n$ is a sample space of size n from a gamma distribution population with $\displaystyle \alpha = 2$ and $\displaystyle \beta$ unknown.

Us the method of moment generating function to show that $\displaystyle 2 \sum_{i=1}^n \frac{Y_i}{\beta}$ is a pivotal quantity and has a $\displaystyle \chi^2$ distribution with 4n df.

I know that the moment generating function of a Gamma Distribution is $\displaystyle (1-\beta t)^{-\alpha}$.

I attempted to replicate http://www.mathhelpforum.com/math-he...-function.html, but got nowhere. I figure it has to like:

$\displaystyle (1-2t)^{-4n}$ since that's the mgf of a $\displaystyle \chi^2$ distribution with 4n df.
Let $\displaystyle X_i = \frac{2 Y_i}{\beta}$.

$\displaystyle m_{Y_i}(t) = \frac{1}{(1 - \beta t)^2}$.

Therefore $\displaystyle m_{X_i}(t) = \frac{1}{\left(1 - \beta \left( \frac{2}{\beta} \, t\right)\right)^2} = \frac{1}{(1 - 2t)^2}$.

Therefore the moment generating function of $\displaystyle X = \sum_{i=1}^{n} X_i$ is equal to $\displaystyle \left[\frac{1}{(1 - 2t)^2}\right]^n = \frac{1}{(1 - 2t)^{2n}}$.

Note that the moment generating function of the $\displaystyle \chi^2$ distribution with k degrees of freedom is $\displaystyle \frac{1}{(1 - 2t)^{k/2}}$.

Compare moment generating functions: $\displaystyle \frac{k}{2} = 2n \Rightarrow k = 4n$.

Therefore $\displaystyle X = \sum_{i=1}^{n} X_i$ has a $\displaystyle \chi^2$ distribution with 4n degrees of freedom. Therefore the pdf is independent of $\displaystyle \beta$.

Therefore .....

3. if I wanted to construct a confidence interval of 90% for $\displaystyle \beta$, would I integrate with respect to t which would give:

$\displaystyle \int_0^{\alpha} \frac{1}{(1-2t)^{2n}} dt = 0.05$

$\displaystyle \int_\beta^{\infty} \frac{1}{(1-2t)^{2n}} dt = 0.05$ ?

4. Originally Posted by lllll
if I wanted to construct a confidence interval of 90% for $\displaystyle \beta$, would I integrate with respect to t which would give:

$\displaystyle \int_0^{\alpha} \frac{1}{(1-2t)^{2n}} dt = 0.05$

$\displaystyle \int_\beta^{\infty} \frac{1}{(1-2t)^{2n}} dt = 0.05$ ?
NO! You certainly don't integrate the moment generating function!

5. Hopefully I got it, this is what I got for the confidence integral:

$\displaystyle \frac{1}{\Gamma{(\alpha)} \beta^{\alpha}} Y_i e^{-Y_i/\beta}$ now since $\displaystyle \alpha = 2$ and $\displaystyle X_i = \frac{2Y_i}{\beta}$ where $\displaystyle Y_i= \frac{\beta}{2}X_i$ and $\displaystyle dY_i = \frac{\beta}{2}dX_i$. Substituting these values in and taking the integral, I get:

$\displaystyle \int^{\alpha}_{0} \frac{1}{\Gamma{(2)} \beta^{2}} \frac{\beta}{2}X_i e^{-\left( \frac{\beta}{2}X_i \right)/\beta} \frac{\beta}{2} \ dX_i$

= $\displaystyle \int^{\alpha}_{0} \frac{X_i}{4} e^{-X_i/2} \ dX_i$

using integration by parts I get:

$\displaystyle \frac{1}{4} \bigg{[}-2X_i e^{-X_i/2} + 2e^{-X_i/2}\bigg{]}^{\alpha}_0 = 0.05$

$\displaystyle = -2\alpha e^{-\alpha/2} + 2e^{-\alpha/2} -1 = 0.2$

$\displaystyle = -\alpha e^{-\alpha/2} + e^{-\alpha/2} = 0.6$

now just isolate for $\displaystyle \alpha$ (which doesn't look very solvable by hand), would this be correct?

6. Originally Posted by lllll
Hopefully I got it, this is what I got for the confidence integral:

$\displaystyle \frac{1}{\Gamma{(\alpha)} \beta^{\alpha}} Y_i e^{-Y_i/\beta}$ now since $\displaystyle \alpha = 2$ and $\displaystyle X_i = \frac{2Y_i}{\beta}$ where $\displaystyle Y_i= \frac{\beta}{2}X_i$ and $\displaystyle dY_i = \frac{\beta}{2}dX_i$. Substituting these values in and taking the integral, I get:

$\displaystyle \int^{\alpha}_{0} \frac{1}{\Gamma{(2)} \beta^{2}} \frac{\beta}{2}X_i e^{-\left( \frac{\beta}{2}X_i \right)/\beta} \frac{\beta}{2} \ dX_i$

= $\displaystyle \int^{\alpha}_{0} \frac{X_i}{4} e^{-X_i/2} \ dX_i$

using integration by parts I get:

$\displaystyle \frac{1}{4} \bigg{[}-2X_i e^{-X_i/2} + 2e^{-X_i/2}\bigg{]}^{\alpha}_0 = 0.05$

$\displaystyle = -2\alpha e^{-\alpha/2} + 2e^{-\alpha/2} -1 = 0.2$

$\displaystyle = -\alpha e^{-\alpha/2} + e^{-\alpha/2} = 0.6$

now just isolate for $\displaystyle \alpha$ (which doesn't look very solvable by hand), would this be correct?
No. Where has n gone? And I have pointed out a few times that the sort of integrals you're setting up are wrong.

You need to closely follow the solution in the thread I refered you to.

$\displaystyle \Pr(a \leq X \leq b) = 0.9$

$\displaystyle \Rightarrow \Pr\left( a \leq \frac{2}{\beta} \sum_{i=1}^{n} Y_i \leq b \right) = 0.9$

$\displaystyle \Rightarrow \Pr\left( \frac{a}{2 \sum_{i=1}^{n} Y_i} \leq \frac{1}{\beta} \leq \frac{b}{2 \sum_{i=1}^{n} Y_i} \right) = 0.9$

$\displaystyle \Rightarrow \Pr\left( \frac{2 \sum_{i=1}^{n} Y_i}{b} \leq \beta \leq \frac{2 \sum_{i=1}^{n} Y_i}{a} \right) = 0.9$

where $\displaystyle \Pr(X \leq b) = \int_0^b \frac{(1/2)^{2n}}{\Gamma (2n)}\, u^{2n-1} e^{-u/2} \, du$ and $\displaystyle \Pr(X \geq a) = \int^{+\infty}_a \frac{(1/2)^{2n}}{\Gamma (2n)}\, u^{2n-1} e^{-u/2} \, du$.

Nothing much can be done to get a value for a and b until the value of n is given. And when a value of n is given you should use technology to solve for the values of a and b.