Segment 8

Calculation Problems

1. Show that $1/r$ is a special case of Lognormal Prior

$p(x) = \frac{1}{\sqrt{2\pi} \sigma x } exp \left ( - \frac12 \left [ \frac{log(x) - \mu}{\sigma}\right ]^2\right )$

$\lim_{\sigma \to \infin} p(x) \propto \frac{1}{\sqrt{2\pi} \sigma x } \propto \frac1x$

2. Prove that Gamma($\alpha , \beta$) has a single mode $\left ( \alpha - 1 \right ) / \beta$ when $\alpha \ge 1$

\begin{align} Gamma(\alpha, \beta) &= \frac{\beta^{\alpha}}{\Gamma(\alpha)} x^{\alpha -1} e^{-\beta x}, &x > 0\\ \frac{d Gamma(\alpha, \beta)}{dx} &= 0\\ \frac{\beta^{\alpha} x^{\alpha -2} e^{-\beta x} (\alpha -1 -\beta x)}{\Gamma(\alpha)} &= 0\\ x &= \frac{\alpha -1}{\beta} \end{align}

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

Student distribution : $p(t) = \frac{\Gamma\left(\frac12 \left [\nu + 1\right] \right )}{\Gamma\left(\frac12 \nu \right ) \sqrt{\nu\pi}\sigma}\left(1 + \frac{1}{\nu} \left[ \frac{t - \mu}{\sigma}\right]^2\right)^{-\frac12 (\nu+ 1)}$

\begin{align} \lim_{\nu \rightarrow \infin} \frac{\Gamma\left(\frac12 \left [\nu + 1\right] \right )}{\Gamma\left(\frac12 \nu \right ) \sqrt{\nu\pi}\sigma} &= \frac{1}{\sqrt{2\pi}\sigma}\\ \lim_{\nu \rightarrow \infin} \left(1 + \frac{1}{\nu} \left[ \frac{t - \mu}{\sigma}\right]^2\right)^{-\frac12 (\nu+ 1)} &= e^{-\frac12 \left(\frac{t - \mu}{\sigma}\right)^2 }\\ \lim_{\nu \rightarrow \infin} p(t) &=\frac{1}{\sqrt{2\pi}\sigma} e^{-\frac12 \left(\frac{t - \mu}{\sigma}\right)^2 } \end{align}

Food for Thought Problems

Radioactive atoms decay randomly. A sample of atoms in a time interval such that the number of atoms has not changed significantly can show that the decay is proportional to the interval of time. A quantity is at a exponential decay if it decreases at a rate proportional to its value.

\begin{align} \frac{dN}{dt} &= -\lambda N\\ N(t) &= N_0 e^{-\lambda t} \end{align}

Class Activity

Worked with Noah,Jin and Silu's homework problems.

from scipy.stats import norm,t
from scipy.optimize import fmin
f = open('./data/Events20130204.txt', 'r')
events = []
for line in f:
events.append(float(line))
avg = np.mean(events)
std = np.sqrt(np.var(events))
hist(events,bins=50)
normdis = norm(scale=std,loc=avg)
nvector = normdis.pdf(events)
nsump= sum(np.log(nvector))
tdis = t(5,loc=2,scale=1.2)
tvector = tdis.pdf(events)
tsump = sum(np.log(tvector))

def e((d, u, sigma)):
td = t(d,loc=u,scale=sigma)
return sum(np.log(td.pdf(events)))*(-1)
print fmin(e,(5,2,1.2))
print nsump
print tsump
print np.exp(tsump-nsump)
print avg
print std