# Math Help - Confidence interval

1. ## Confidence interval

Suppose that a random variable Y has a gamma distribution w. parameters $\alpha = 2$ and an unknown $\beta$. We have earlier proved that $2Y/\beta$ has a chi-square distribution w. 4 df. Using $2Y/\beta$ as a pivotal quantity. derive a 90% confidence interval for \beta.

I don't know if I'm on the right way. I create a new random variable $U = 2Y/\beta$ and look for $P(a\leq U\leq b) = 0.90$

=

$P(a\leq 2Y/\beta\leq b) = 0.90$

I then have a similar example in the book that tells me to set it up like this:

$P(U

$P(U>b) = \int_b^\infty f(u) du = 0.05$

Must I derive the pdf of U manually or can I use that $2Y/\beta$ is chi-square distributed and put in the pdf of a chi-square distribution?

That would be:
$(y)^{(\upsilon /2)-1}e^{-y/2}/2^{\upsilon/2}\Gamma (\upsilon /2)$ but with y=u and $\upsilon$ = 4
I've tried to do that but I don't get the right answer, which is $2Y/9.49, 2Y/.711$.

Thanks for your help.

2. Originally Posted by approx
Suppose that a random variable Y has a gamma distribution w. parameters $\alpha = 2$ and an unknown $\beta$. We have earlier proved that $2Y/\beta$ has a chi-square distribution w. 4 df. Using $2Y/\beta$ as a pivotal quantity. derive a 90% confidence interval for \beta.

I don't know if I'm on the right way. I create a new random variable $U = 2Y/\beta$ and look for $P(a\leq U\leq b) = 0.90$

=

$P(a\leq 2Y/\beta\leq b) = 0.90$

I then have a similar example in the book that tells me to set it up like this:

$P(U

$P(U>b) = \int_b^\infty f(u) du = 0.05$

Must I derive the pdf of U manually or can I use that $2Y/\beta$ is chi-square distributed and put in the pdf of a chi-square distribution?

That would be:
$(y)^{(\upsilon /2)-1}e^{-y/2}/2^{\upsilon/2}\Gamma (\upsilon /2)$ but with y=u and $\upsilon$ = 4
I've tried to do that but I don't get the right answer, which is $2Y/9.49, 2Y/.711$.
Thanks for your help.
The pdf of U is $f(u) = \frac{u e^{-u/2}}{4}$.

Your trouble is solving:

$\Pr(U < a) = \int_0^a \frac{u e^{-u/2}}{4} \, du$ for a. I get a = 0.710723.

$\Pr(U > b) = \int_b^{+\infty} \frac{u e^{-u/2}}{4} \, du$ for b. I get b = 9.48772.

So your trouble is calculus, not statistics. Now that you know that what you're trying to do is correct, I suggest you go back and re-check your calculations. Then:

$0.9 = \Pr \left( 0.710723 \leq U \leq 9.48792 \right) = \Pr \left( 0.710723 \leq \frac{2Y}{\beta} \leq 9.48792 \right)$

$= \Pr \left( \frac{0.710723}{2Y} \leq \frac{1}{\beta} \leq \frac{9.48792}{2Y} \right)$

where the direction of the inequalities is maintained (that is, they are NOT reversed) because Y > 0. Y > 0 because Pr(Y > 0) = 1 (since Y has a gamma distribution)

$= \Pr \left( \frac{2Y}{9.48792} \leq \beta \leq \frac{2Y}{0.710723} \right)$.

3. Seems like I can't get the right answer after all. Can someone please check my calculations to see where I go wrong?

$P(U =

$1/4\int_0^a {ue^{-u/2}} du] = 0.05$ =

$1/4[u*(-2e^{-u/2}]_0^a - \int_0^a 1*(-2e^{-u/2})\, du = 0.05$ =

$1/4[[-u2e^{-u/2}]_0^a - \int_0^a -2e^{-u/2} du] = 0.05$

$1/4[[-a2e^{-a/2}] - [4e^{-u/2}]_0^a] = 0.05$ =

$1/4[-a2e^{-a/2} - [4(e^{-a/2}-e^{-0})] = 0.05$

$1/4[-a2e^{-a/2} - [4(e^{-a/2}-1)] = 0.05$ =

$1/4[-a2e^{-a/2} - 4e^{-a/2} + 4)] = 0.05$

4. Originally Posted by approx
Seems like I can't get the right answer after all. Can someone please check my calculations to see where I go wrong?

$P(U =

$1/4\int_0^a {ue^{-u/2}} du] = 0.05$ =

$1/4[u*(-2e^{-u/2}]_0^a - \int_0^a 1*(-2e^{-u/2})\, du = 0.05$ =

$1/4[[-u2e^{-u/2}]_0^a - \int_0^a -2e^{-u/2} du] = 0.05$

$1/4[[-a2e^{-a/2}] - [4e^{-u/2}]_0^a] = 0.05$ =

$1/4[-a2e^{-a/2} - [4(e^{-a/2}-e^{-0})] = 0.05$

$1/4[-a2e^{-a/2} - [4(e^{-a/2}-1)] = 0.05$ =

$1/4[-a2e^{-a/2} - 4e^{-a/2} + 4)] = 0.05$
Your calculations are correct. Now solve for a (numerically, I'd imagine) and get an answer to the required accuracy. (An exact answer in terms of the Lambert W-function is possible but neither useful nor required).

5. Sorry for going about this forever. I also posted this in the math part, but no one was able to help me out. I go on like this:

$1/4[-a2e^{-a/2} - 4e^{-a/2} + 4)] = 0.05
$

$1/4(-a2e^{-a/2}) -e^{a/2} +1 = 0.05
$

$-0.5a(e^{-a/2}) -e^{a/2} +1 = 0.05
$

$-0.5a(e^{-a/2}) -e^{a/2} = -0.95
$

$-e^{-a/2} (1+0.5a)= -0.95
$

$-e^{-a/2} = \frac{-0.95}{(1+0.5a)}
$

$e^{-a/2} = \frac{0.95}{-(1+0.5a)}
$

But how do I solve for a from here? Thanks for your help.

6. Originally Posted by approx
Sorry for going about this forever. I also posted this in the math part, but no one was able to help me out. I go on like this:

$1/4[-a2e^{-a/2} - 4e^{-a/2} + 4)] = 0.05$ $
$

$
$1/4(-a2e^{-a/2}) -e^{a/2} +1 = 0.05$" alt="
$1/4(-a2e^{-a/2}) -e^{a/2} +1 = 0.05$" />

$
$-0.5a(e^{-a/2}) -e^{a/2} +1 = 0.05$
" alt="
$-0.5a(e^{-a/2}) -e^{a/2} +1 = 0.05$" />

$
$-0.5a(e^{-a/2}) -e^{a/2} = -0.95$
" alt="
$-0.5a(e^{-a/2}) -e^{a/2} = -0.95$" />

$
$-e^{-a/2} (1+0.5a)= -0.95$
" alt="
$-e^{-a/2} (1+0.5a)= -0.95$" />

$
$-e^{-a/2} = \frac{-0.95}{(1+0.5a)}$
" alt="
$-e^{-a/2} = \frac{-0.95}{(1+0.5a)}$" />

$
$e^{-a/2} = \frac{0.95}{-(1+0.5a)}$
" alt="
$e^{-a/2} = \frac{0.95}{-(1+0.5a)}$" />

But how do I solve for a from here? Thanks for your help.

As I said earlier, you will have to solve it numerically. That means you have to use technology to get an approximate solution. eg. I used a TI-89 calculator to get my answers.