# Thread: Condition distribution - stuck

1. ## Condition distribution - stuck

If $\displaystyle Y | \Lambda = \lambda$ ~Poi$\displaystyle (\lambda)$ and $\displaystyle \Lambda$ ~ Exp$\displaystyle (\mu)$, find the distribution of Y.
There is a hint about looking up the gamma function but I can't see how to use it in this case yet.

I am also confused with $\displaystyle Y | \Lambda = \lambda$ ~Poi$\displaystyle (\lambda)$.

Does this mean Pr$\displaystyle ( Y | \Lambda = \lambda) = \frac{\lambda^{\lambda}}{\lambda !} e^{- \lambda}$?

2. NO it means that, we just know lambda...

$\displaystyle P ( Y=y | \Lambda = \lambda) = \frac{\lambda^{y}}{y!} e^{- \lambda}$

where y=0,1,2,3.....

I'm sure I can solve this, but before I attempt it I want to know how you write

this density Exp$\displaystyle (\mu)$.

3. Originally Posted by matheagle
I want to know how you write

this density Exp$\displaystyle (\mu)$.
The pdf of $\displaystyle X$ which has an Exp$\displaystyle (\mu)$ distribution is

$\displaystyle f(x) = \mu e^{-\mu x} , x \geq 0$ and 0 otherwise.

4. I'm glad I asked, since that's not the exponential density I use.
I just solved this. The answer looks weird, but is a valid distribution.

It's a geo with $\displaystyle p={\mu\over \mu+1}$

I hate using f(x) when talking about discrete distributions, but this is a mixture of discete and continuous.
Multiplying the conditional of Y given lambda with the distribution of lambda gives you the joint distribution of Y and lambda.

That being said, this joint density is

$\displaystyle f(y,\lambda )={e^{-\lambda}\lambda^y\over y!}\mu e^{-\mu\lambda}$

So, the marginal of Y is

$\displaystyle g(y)=\int_0^{\infty}{e^{-\lambda}\lambda^y\over y!}\mu e^{-\mu\lambda}d\lambda$

NOW, what I do instead of making a substitution I just recognize the GAMMA density and note that ALL densities integrate to one.

$\displaystyle ={\mu\over y!}\int_0^{\infty}\lambda^ye^{-\lambda(\mu+1)}d\lambda$ (you could make a substitutin and then use the gamma function, but I prefer...)

$\displaystyle ={\mu\Gamma(y+1)\over (\mu+1)^{y+1}y!}\int_0^{\infty}{ (\mu+1)^{y+1}\over \Gamma(y+1)}\lambda^{(y+1)-1}e^{-\lambda(\mu+1)}d\lambda$

the integral is one, NOT how I write my gamma, but I did it your way
also $\displaystyle \Gamma(y+1)=y!$ since y is an integer.
This reduces to

$\displaystyle ={\mu\over (\mu+1)^{y+1}}$

or

$\displaystyle =\Biggl({\mu\over \mu+1}\Biggr)\Biggl({1\over \mu+1}\Biggr)^y =pq^y$

y=0,1,2,... which is that geo.

5. Originally Posted by matheagle
I'm glad I asked, since that's not the exp density I use.
Can I ask, what do you use?

6. I prefer the beta, or mu in your case to be in the denominator

$\displaystyle f(x) = {1\over\mu} e^{-x/\mu}$

Note that I left out a bunch of minus signs earlier tonight.

7. This is a good example of what I am trying to master, therefore, I'd like to try to summarise the approach used here. We are given a conditional distribution for Y on Lambda and told the (marginal?) distribution for Lambda. We are asked to find the (marginal?) distribution of Y.

1. First, if Y is conditioned on Lambda distributed according to some distribution (here Poisson), that means that Y is the random variable in the Poisson formula, as here:

Originally Posted by matheagle
NO it means that, we just know lambda...

$\displaystyle P ( Y=y|\Lambda=\lambda) = \frac{\lambda^{y}}{y!} e^{- \lambda}$

where y=0,1,2,3.....
2. Next, we find the joint density according to the standard formula

$\displaystyle f_{Y,\Lambda}(y,\lambda)=f_{Y|\Lambda}(y,\lambda)f _{Y|{\Lambda}}(\lambda)$

3. And finally to find $\displaystyle f_Y(y)$ we integrate (or summate) the joint density over the range of Lambda. Whether this is integration or summation will be determined by the type of Lambda variable, right? Here Lambda is exponentially distributed, therefore, continous, therefore, we integrate.

Does it make sense?

8. Note the corrected marginal density...

Originally Posted by Volga
This is a good example of what I am trying to master, therefore, I'd like to try to summarise the approach used here. We are given a conditional distribution for Y on Lambda and told the (marginal?) distribution for Lambda. We are asked to find the (marginal?) distribution of Y.

1. First, if Y is conditioned on Lambda distributed according to some distribution (here Poisson), that means that Y is the random variable in the Poisson formula, as here:

2. Next, we find the joint density according to the standard formula

$\displaystyle f_{Y,\Lambda}(y,\lambda)=f_{Y|\Lambda}(y,\lambda)f _{\Lambda}}(\lambda)$

3. And finally to find $\displaystyle f_Y(y)$ we integrate (or summate) the joint density over the range of Lambda. Whether this is integration or summation will be determined by the type of Lambda variable, right? Here Lambda is exponentially distributed, therefore, continous, therefore, we integrate.

Does it make sense?

It's just like P(A,B)=P(A|B)P(B)