# Method of moment generating function with Gamma Distribution

• Nov 9th 2008, 04:37 PM
lllll
Method of moment generating function with Gamma Distribution
Assume that $Y_1, \ Y_2, ... \ Y_n$ is a sample space of size n from a gamma distribution population with $\alpha = 2$ and $\beta$ unknown.

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

I know that the moment generating function of a Gamma Distribution is $(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:

$(1-2t)^{-4n}$ since that's the mgf of a $\chi^2$ distribution with 4n df.
• Nov 9th 2008, 11:42 PM
mr fantastic
Quote:

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

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

I know that the moment generating function of a Gamma Distribution is $(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:

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

Let $X_i = \frac{2 Y_i}{\beta}$.

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

Therefore $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 $X = \sum_{i=1}^{n} X_i$ is equal to $\left[\frac{1}{(1 - 2t)^2}\right]^n = \frac{1}{(1 - 2t)^{2n}}$.

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

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

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

Therefore .....
• Nov 10th 2008, 05:55 PM
lllll
if I wanted to construct a confidence interval of 90% for $\beta$, would I integrate with respect to t which would give:

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

$\int_\beta^{\infty} \frac{1}{(1-2t)^{2n}} dt = 0.05$ ?
• Nov 10th 2008, 06:59 PM
mr fantastic
Quote:

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

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

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

NO! You certainly don't integrate the moment generating function!

• Nov 10th 2008, 07:51 PM
lllll
Hopefully I got it, this is what I got for the confidence integral:

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

$\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$

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

using integration by parts I get:

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

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

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

now just isolate for $\alpha$ (which doesn't look very solvable by hand), would this be correct?
• Nov 10th 2008, 09:07 PM
mr fantastic
Quote:

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

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

$\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$

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

using integration by parts I get:

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

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

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

now just isolate for $\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.

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

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

$\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$

$\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 $\Pr(X \leq b) = \int_0^b \frac{(1/2)^{2n}}{\Gamma (2n)}\, u^{2n-1} e^{-u/2} \, du$ and $\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.