# Thread: probability generating functions- please help

1. ## probability generating functions- please help

A random variable Y is called gamma( $\theta$, n) for $\theta$>0 and natural n if it takes positive values and takes the following PDF:

f(y)= $\frac{1}{\theta (n-1)!}$( $\frac{y^{n-1}}{\theta^{n-1}}$) exp $\frac{-y}{\theta}$

Show how to find the moment generating function, expectation and variance of Y.

my attempt:

$\int_{0}^{\infty} e^{\frac{-y}{\theta}}e^{ty} \frac{y^{n-1}}{(t\theta-1)^{n-1}}\frac{1}{\theta(n-1)!}dy$

= $\int_{0}^{\infty} e^\frac{y(t\theta-1)}{\theta} \frac{y^{n-1}}{\theta^{n-1}}\frac{1}{\theta(n-1)!}dy$

let u= ${\frac{y(t\theta-1)}{\theta}}$

Then du= $\frac{(t\theta-1)}{\theta}$dy

= $\int_{0}^{\infty} \frac{1}{(t\theta-1)(n-1)!} \frac{u^{n-1}}{(t\theta-1)^{n-1}}e^u du$

= $\frac{1}{(t\theta-1)^n}$ $\int_{0}^{\infty} e^u \frac{u^{n-1}}{(n-1)!} du$

Is this right so far? Is there some reason why $\int_{0}^{\infty} e^u \frac{u^{n-1}}{(n-1)!} du$ should be one? Could somebody show me how to integrate this by parts? (I know I should be able to do it but I am really struggling).

2. Hello,
Originally Posted by C.E
A random variable Y is called gamma( $\theta$, n) for $\theta$>0 and natural n if it takes positive values and takes the following PDF:

f(y)= $\frac{1}{\theta (n-1)!}$( $\frac{y^{n-1}}{\theta^{n-1}}$) exp $\frac{-y}{\theta}$

Show how to find the moment generating function, expectation and variance of Y.

my attempt:

$\int_{0}^{\infty} e^{\frac{-y}{\theta}}e^{ty} \frac{y^{n-1}}{({\color{red}t\theta-1})^{n-1}}\frac{1}{\theta(n-1)!}dy$
I guess there's a little typo in red, though not important for your further working

= $\int_{0}^{\infty} e^\frac{y(t\theta-1)}{\theta} \frac{y^{n-1}}{\theta^{n-1}}\frac{1}{\theta(n-1)!}dy$

let u= ${\frac{y(t\theta-1)}{\theta}}$

Then du= $\frac{(t\theta-1)}{\theta}$dy

= $\int_{0}^{\infty} \frac{1}{(t\theta-1)(n-1)!} \frac{u^{n-1}}{(t\theta-1)^{n-1}}e^u du$

= $\frac{1}{(t\theta-1)^n}$ $\int_{0}^{\infty} e^u \frac{u^{n-1}}{(n-1)!} du$

Is this right so far? Is there some reason why $\int_{0}^{\infty} e^u \frac{u^{n-1}}{(n-1)!} du$ should be one? Could somebody show me how to integrate this by parts? (I know I should be able to do it but I am really struggling).
Well, actually, there's a problem, as for the convergence of the integral. But I'm a bit tired to study it ><

Make the substitution $u=\frac{y(1-t\theta)}{\theta}$, assuming that $t<\frac 1\theta$ . Otherwise, you'd have to change the boundaries of the integral, and it makes it more complicated.

Then, you'll get something like $\frac{1}{(1-t\theta)^n} \int_0^\infty e^{-u} \cdot \frac{u^{n-1}}{(n-1)!} ~du$

For this integral, see the Gamma function : Gamma function - Wikipedia, the free encyclopedia and it should be okay !

I hope that what I babbled will help you in your process. Anyway, it's nice to see your working

3. Do you think I am ok to assume t< $\frac{1}{\theta}$? I doesn't say anything about the value of t in the question.

4. It is important that your generating function exists in a neighborhood that contains zero.

The trick to these is to make your generating function look like a density so you don't have to integrate.