# mcmc - \documentclass[11pt]cfw_article...

This preview shows pages 1–3. Sign up to view the full content.


This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
If this does not work, then get the library using the package menu for R. \subsection{Random Number Generator Seed} In order to get the same results every time, we set the seed of the random number generator. <<library>>= set.seed(42) @ To get different results, change the seed or simply omit this statement. \subsection{Prior} We have not done the Fisher information matrix for the two-parameter gamma distribution. To calculate Fisher information, it is enough to have the log likelihood for sample size one. The PDF is $$f(x \mid \alpha, \lambda) = \frac{\lambda^\alpha}{\Gamma(\alpha)} x^{\alpha - 1} \exp\left( - \lambda x \right)$$ The log likelihood is $$l(\alpha, \lambda) = \log f(x \mid \alpha, \lambda) = \alpha \log(\lambda) - \log \Gamma(\alpha) + (\alpha - 1) \log(x) - \lambda x$$ which has derivatives \begin{align*} \frac{\partial l(\alpha, \lambda)}{\partial \alpha} \log(\lambda) - \frac{d}{d \alpha} \log \Gamma(\alpha) + \log(x) \\ \frac{\partial l(\alpha, \lambda)}{\partial \lambda} \frac{\alpha}{\lambda} - x \\ \frac{\partial^2 l(\alpha, \lambda)}{\partial \alpha^2} & = - \frac{d^2}{d \alpha^2} \log \Gamma(\alpha) \\ \frac{\partial^2 l(\alpha, \lambda)}{\partial \alpha \partial \lambda} \frac{1}{\lambda} \\ \frac{\partial^2 l(\alpha, \lambda)}{\partial \lambda^2} & = - \frac{\alpha}{\lambda^2} \end{align*} % foo = alpha Log[lambda] - Log[Gamma[alpha]] + (alpha - 1) Log[x] - lambda x % D[ D[ foo, alpha ], alpha ] % D[ D[ foo, alpha ], lambda ] % D[ D[ foo, lambda ], lambda ]
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 10/28/2010 for the course STAT 2102 taught by Professor Geyer during the Spring '09 term at Minnesota.

### Page1 / 11

mcmc - \documentclass[11pt]cfw_article...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online