# Segment 8 Sanmit Narvekar

Jump to navigation Jump to search

## Segment 8

#### To Calculate

1. In Segment 6 (slide 8) we used the improper prior $\displaystyle 1/r$ . Show that this is just a limiting case of a (completely proper) Lognormal prior.

2. Prove that $\displaystyle {\rm Gamma}(\alpha,\beta)$ has a single mode at $\displaystyle (\alpha-1)/\beta$ when $\displaystyle \alpha \ge 1$ .

The mode of the function is the value of x at the peak. So we simply take the derivative of the pdf of a gamma distribution, set it equal to 0, and solve for x.

$\displaystyle \frac{d}{dx} \left( \frac{\beta^\alpha}{\Gamma(\alpha)} x^{\alpha-1}e^{-\beta x}\right) = 0$

$\displaystyle \frac{\beta^\alpha}{\Gamma(\alpha)} \left( x^{\alpha-1}e^{-\beta x} (-\beta) + e^{-\beta x}(\alpha - 1) x^{\alpha - 2} \right) = 0$

$\displaystyle \frac{\beta^\alpha}{\Gamma(\alpha)} (x^{\alpha-2}e^{-\beta x}) (-\beta x + (\alpha - 1)) = 0$

Thus, one solution is at:

$\displaystyle (-\beta x + (\alpha - 1)) = 0$

And solving for x gives:

$\displaystyle x = \frac{\alpha - 1}{\beta}$

3. Show that the limiting case of the Student distribution as $\displaystyle \nu\rightarrow\infty$ is the Normal distribution.

We start by taking the limit:

$\displaystyle \lim_{\nu \to \infty} \frac{\Gamma(0.5 (\nu+1))}{\Gamma(0.5 \nu)\sqrt{\nu \pi} \sigma} \left( 1 + \frac{1}{\nu} \left[ \frac{t - \mu}{\sigma} \right]^2 \right)^{-\frac{1}{2}(\nu + 1)}$

Split the limits over the 2 terms:

$\displaystyle = \lim_{\nu \to \infty} \frac{\Gamma(0.5 (\nu+1))}{\Gamma(0.5 \nu)\sqrt{\nu \pi} \sigma} \lim_{\nu \to \infty} \left( 1 + \frac{1}{\nu} \left[ \frac{t - \mu}{\sigma} \right]^2 \right)^{-\frac{1}{2}(\nu + 1)}$

For ease of exposition, we evaluate the two limits separately.

The second limit is done as follows:

$\displaystyle \lim_{\nu \to \infty} \left( 1 + \frac{1}{\nu} \left[ \frac{t - \mu}{\sigma} \right]^2 \right)^{-\frac{1}{2}(\nu + 1)}$

Take the $\displaystyle e^{\ln(X)}$ , where X is the quantity we are evaluating. Note that this doesn't change the original function (it also sets us up nicely for turning it into a Gaussian).

$\displaystyle = \lim_{\nu \to \infty} e^{ \ln \left( 1 + \frac{1}{\nu} \left[ \frac{t - \mu}{\sigma} \right]^2 \right)^{-\frac{1}{2}(\nu + 1)}}$

Using properties of logarithms:

$\displaystyle = \lim_{\nu \to \infty} e^{ -\frac{1}{2}(\nu + 1) \ln \left( 1 + \frac{1}{\nu} \left[ \frac{t - \mu}{\sigma} \right]^2 \right)}$

Notice that if we evaluate the limit in this form, we have an indeterminate form in the exponential: $\displaystyle (-\infty) (0)$ . One way to deal with this is to use L'Hospital's rule. First we have to get it into the right form, which is easily done by moving the first term into the denominator:

$\displaystyle = \lim_{\nu \to \infty} e^{ - \frac{ \ln \left( 1 + \frac{1}{\nu} \left[ \frac{t - \mu}{\sigma} \right]^2 \right) } {\frac{2}{\nu + 1} } }$

Now we apply L'Hospital's rule by taking the derivative of the numerator and the denominator:

$\displaystyle = \lim_{\nu \to \infty} e^{ - \frac{ \left( \frac{1}{ 1 + \frac{1}{\nu} \left[ \frac{t - \mu}{\sigma} \right]^2 }\right) \left( \left[ \frac{t - \mu}{\sigma} \right]^2 \right) \left( \frac{1}{\nu^2} \right) } {\frac{2}{(\nu + 1)^2} } }$

What's convenient is that we have also gotten rid of the ln! Now we bring the denominator back up (I'm going to start skipping a few steps, but hopefully you get the idea -- too much writing!).

$\displaystyle = \lim_{\nu \to \infty} e^{ - \frac{1}{2} \left( \frac{1}{ 1 + \frac{1}{\nu} \left[ \frac{t - \mu}{\sigma} \right]^2 }\right) \left( \left[ \frac{t - \mu}{\sigma} \right]^2 \right) \left( \frac{\nu^2 + 2\nu + 1}{\nu^2} \right)}$

And now we take the limit, which will cancel out the terms in the first and last parenthesis, giving us the desired partial result. (For the last parenthesis, divide the top and bottom by nu^2, and it's easy to see that it becomes 1).

$\displaystyle = e^{ - \frac{1}{2} \left( \frac{t - \mu}{\sigma} \right)^2 }$

For the first limit, I used wolfram alpha (didn't know what to do with the gamma function... might look into it later):

$\displaystyle \lim_{\nu \to \infty} \frac{\Gamma(0.5 (\nu+1))}{\Gamma(0.5 \nu)\sqrt{\nu \pi} \sigma}$

$\displaystyle = \frac{0.398942}{\sigma}$

$\displaystyle = \frac{1}{\sqrt{2 \pi} \sigma}$

And putting the two together gives the final answer, a normal distribution:

$\displaystyle \frac{1}{\sqrt{2 \pi} \sigma} e^{ - \frac{1}{2} \left( \frac{t - \mu}{\sigma} \right)^2 }$

#### To Think About

1. Suppose you have an algorithm that can compute a CDF, $\displaystyle P(x)$ . How would you design an algorithm to compute its inverse (see slide 9) $\displaystyle x(P)$ ?

One way is a binary search style method: evaluate the cdf of p(x) at some value. If we need a value that is higher, evaluate another point to the right. Otherwise, use a point on the left. At some point, you will have upper and lower bounds, and these can be used to pinpoint the value using regular binary search. This works because the cumulative distribution function is monotonically increasing.

2. The lifetime t of a radioactive nucleus (say Uranium 238) is distributed as the Exponential distribution. Do you know why? (Hint: What is the distribution of an Exponential$\displaystyle (\beta)$ random variable conditioned on its being greater than some given value?)