# Travis: Segment 8

#### To Calculate

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

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

$p(x) = \frac{\beta^\alpha}{\Gamma (\alpha)}x^{\alpha-1}e^{-\beta x}$

$\frac{d (p(x))}{dx} = 0 = \frac{\beta^\alpha}{\Gamma (\alpha)}(\alpha -1)x^{\alpha-2}e^{-\beta x} - \frac{\beta^\alpha}{\Gamma (\alpha)}x^{\alpha-1} (-\beta) e^{-\beta x} = \frac{\beta^\alpha}{\Gamma (\alpha)}x^{\alpha-2}e^{-\beta x} \bigg[ (\alpha -1) - \beta x \bigg] = 0$

$\therefore x = \frac{\alpha -1}{\beta}$ for an optimal point with $\alpha \ge 1$.

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

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

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$(\beta)$ random variable conditioned on its being greater than some given value?)

#### Class Activity

Here's the code group 1 did for class, but we can't figure out what's wrong with our code. Help please :-) On the first iteration, the performance index is 2025.86. but then it converges to 918 which is way off.

clc
clear all
close all
X0 = [2,1.2,5]; % mu, sigma, nu
ops = optimset('Display','iter');
[x,fval,exitflag,output] = fminsearch(@opt, X0,ops)

function [prob] = opt(X)