Markov chain monte carlo
1 / 11

Markov-Chain Monte Carlo - PowerPoint PPT Presentation

  • Uploaded on

Markov-Chain Monte Carlo. Instead of integrating, sample from the posterior. The histogram of chain values for a parameter is a visual representation of the (marginalized) probability distribution for that parameter. Can then easily compute confidence intervals:

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' Markov-Chain Monte Carlo' - hamlin

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Markov chain monte carlo
Markov-Chain Monte Carlo

Instead of integrating, sample from the posterior

The histogram of chain values for a parameter is a visual representation of the (marginalized) probability distribution for that parameter

  • Can then easily compute confidence intervals:

  • Sum histogram from best-fit value (often peak of histogram) in both directions

  • Stop when x% of values summed for an x% confidence interval

Gibbs sampling
Gibbs Sampling

  • Derive conditional probability of each parameter given values of the other parameters

  • Pick parameter at random

  • Draw from conditional probability of that parameter given values of all other parameters from previous iteration

  • Repeat until chain converges

Metropolis hastings

  • Can be visualized as similar to the rejection method of random number generation

  • Use a “proposal” distribution that is similar in shape to the expected posterior distribution to generate new parameter values

  • Accept new step when probability of new values is higher, occasionally accept new step otherwise (to go “up hill”, avoiding relative minima)

M h issues
M-H Issues

  • Can be very slow to converge, especially when there are correlated variables

    • Use multivariate proposal distributions (done in XSPEC approach)

    • Transform correlated variables

  • Convergence

    • Run multiple chains, compute convergence statistics

Mcmc example
MCMC Example

  • In Ptak et al. (2007) we used MCMC to fit the X-ray luminosity functions of normal galaxies in the GOODS area (see poster)

  • Tested code first by fitting published FIR luminosity function

  • Key advantages:

    • visualizing full probability space of parameters

    • ability to derive quantities from MCMC chain value (e.g., luminosity density)

Sanity Check: Fitting local 60 mm LF


Fit Saunders et al (1990) LF

assuming Gaussian errors and

ignoring upper limits

Param. S1990 MCMC

α 1.09 ± 0.12 1.04 ± 0.08

σ 0.72 ± 0.03 0.75 ± 0.02

Φ* 0.026 ± 0.008 0.026 ± 0.003

log L* 8.47 ± 0.23 8.39 ± 0.15

log L/L○

(Ugly) Posterior Probabilities

z< 0.5 X-ray luminosity functions

Early-type Galaxies

Late-type Galaxies

Red crosses show 68% confidence interval

Marginalized Posterior Probabilities

Dashed curves show Gaussian with same mean & st. dev. as posterior

Dotted curves show prior

log φ*

log L*





Note: α and σ tightly constrained by (Gaussian) prior, rather than being “fixed”

Mcmc in xspec

XSPEC MCMC is based on the Metropolis-Hastings algorithm. The chain proposal command is used to set the proposal distribution.

MCMC is integrated into other XSPEC commands (e.g., error). If chains are loaded then these are used to generate confidence regions on parameters, fluxes and luminosities. This is more accurate than the current method for estimating errors on fluxes and luminosities.


Xspec mcmc output

Histogram and probability density plot (2-d histogram) of spectral fit parameters from an XSPEC MCMC run produced by fv (see

Future The

  • Use “physical” priors… have posterior from previous work be prior for current work

    • Use observed distribution of photon indices of nearby AGN when fitting for NH in deep surveys

    • Incorporate calibration uncertainty into fitting (Kashyap AISR project)

  • XSPEC has a plug-in mechanism for user-defined proposal distributions… would be good to also allow user-defined priors

  • Code repository/WIKI for MCMC analysis in astronomy