Professional Documents
Culture Documents
Outline
Recap MCMC overview Markov Chains Metropolis-Hastings Method Convergence, mixing and burn-in Output Examples Codes
Recap
Unknown distribution
Draw samples from known distribution (proposal) Correct probability by rejecting some samples
Samples are statistically dependent Advantage: achieves good scaling with dimension
Unlike independent sampling methods
Markov Chains
MC is sequence of random vectors Probability of next vector depends only on present one Transition matrix T(x,x): distribution from which next vector is drawn An ergodic MC converges to invariant distrib p(x)
P(x) is characteristic of the transition matrix
Goal: construct T(x,x) s.t. its invariant distribution is the target distribution
Metropolis: most popular and general Propose step away from current position in parameter space
Using Gaussian centered at current position, for example
Convergence
Convergence diagnostics
Plot trace of parameter values, running avgs Compare many chains All diagnostics can give false positives
Mixing
* Handbook
Correlated Variables
Reparameterize
Ex: use ne, Pe=(Te*ne) as alternate params Rotate, rescale axes according to (co)variances Aim to make distribution spherical
Summarizing Results
Inference tools
Point Estimator
MLE/mode, median, mean/1st moment
Mean is better estimate than MLE
Interval Estimator
Easy: Quantiles, mean +/- standard deviation Tougher: credible region (requires marginal distrib.)
Marginal distribution
Histogram Kernel estimate of density function (smooth histogram) Analytic approximations
Need to estimate MC Standard Error (MCSE) May use subsample batch method:
Find variance of batches of samples
Use batch size bn~
Example: Verdoolaege
6-D M-H w/ Cauchy proposal fake data
Example: Verdoolaege
Histograms from real data run
Code
PyMC 2.0
Metropolis-Hastings algorithm as a Python class
BUGS
http://www.mrc-bsu.cam.ac.uk/bugs/ R or GUI version, using Gibbs sampler
AMCMC
http://probability.ca/amcmc/ Open-source C/R Adaptive Metropolis-Hastings MCMC