Markov Chain Monte Carlo: Poisson Distribution and Gibbs Sampling - Prof. Mary Kathryn Cow, Study notes of Statistics

The markov chain monte carlo (mcmc) method, specifically in relation to the poisson distribution. The properties of the poisson distribution, the concept of markov chains, and the use of gibbs sampling to construct the transition kernel. The document also mentions bugs and winbugs as tools for implementing mcmc methods. The goal is to make inferences about model parameters and make predictions.

Typology: Study notes

Pre 2010

Uploaded on 03/10/2009

koofers-user-24i
koofers-user-24i 🇺🇸

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Markov Chain Monte Carlo
22S:138, Bayesian Statistics
Lecture 10
Oct 1, 2007
Kate Cowles
374 SH, 335-0727
The Poisson distribution (one more
one-parameter distribution)
The Poisson distribution may be appropriate
when the data are counts of rare events.
events occurring at random at a constant rate
per unit time, distance, volume, or whatever
assumption that the number of events that
occur in any interval is independent of the
number of events occurring in a disjoint
interval
examples:
the number of cases of a rare form of cancer
occurring in Johnson County in each
calendar year
the number of flaws occurring in each
100-foot length of yarn produced by a
spinning machine
the number of particles of pollen per cubic
foot of air in this room
Since the values of a random variable
following a Poisson distribution are counts,
what are the possible values?
probability mass function for a Poisson
random variable
p(y|λ) = eλλy
y!, y = 0,1,...
the count of the number of events occurring in
mtime units also follows a Poisson
distribution, but with parameter
The conjugate prior distribution for the
Poisson rate parameter is the gamma family.
pf3
pf4
pf5

Partial preview of the text

Download Markov Chain Monte Carlo: Poisson Distribution and Gibbs Sampling - Prof. Mary Kathryn Cow and more Study notes Statistics in PDF only on Docsity!

Markov Chain Monte Carlo

22S:138, Bayesian Statistics

Lecture 10 Oct 1, 2007 Kate Cowles 374 SH, 335-

The Poisson distribution (one more one-parameter distribution)

  • The Poisson distribution may be appropriate when the data are counts of rare events.
  • events occurring at random at a constant rate per unit time, distance, volume, or whatever
  • assumption that the number of events that occur in any interval is independent of the number of events occurring in a disjoint interval
  • examples:
  • the number of cases of a rare form of cancer occurring in Johnson County in each calendar year
  • the number of flaws occurring in each 100-foot length of yarn produced by a spinning machine
  • the number of particles of pollen per cubic foot of air in this room
  • Since the values of a random variable following a Poisson distribution are counts, what are the possible values?
  • probability mass function for a Poisson random variable

p(y|λ) =

e−λ^ λy y!

, y = 0, 1 ,...

  • the count of the number of events occurring in m time units also follows a Poisson distribution, but with parameter mλ - The conjugate prior distribution for the Poisson rate parameter is the gamma family.

Markov Chain Monte Carlo Methods

  • Goals
    • to make inference about model parameters
    • to make predictions
  • Requires
    • integration over possibly high-dimensional integrand
    • and we may not know the integrating constant

Monte Carlo integration and MCMC

  • Monte Carlo integration
    • draw independent samples from required distribution
    • use sample averages to approximate expectations
  • Markov chain Monte Carlo (MCMC)
    • draws samples by running a Markov chain that is constructed so that its limiting distribution is the joint distribution of interest

Markov chains

  • A Markov chain is a sequence of random variables X 0 , X 1 , X 2 ,...
  • At each time t ≥ 0 the next state Xt+1 is sampled from a distribution P (Xt+1|Xt) that depends only on the state at time t - called “transition kernel”
  • Under certain regularity conditions, the iterates from a Markov chain will gradually converge to draws from a unique stationary or invariant distribution - i.e. chain will “forget’ its initial state - as t increases, sampled points Xt will look increasingly like (correlated) samples from the stationary distribution - Suppose: - MC is run for N (large number) iterations - we throw away output from first m iterations - regularity conditions are met - then by ergodic theorem - we can use averages of remaining samples to estimate means E[f (X)] ≃

N − m

N∑ t=m+

f (Xt)

Gibbs Sampler algorithm for Normal

  1. choose initial values μ(0), σ2(0)
  2. at each iteration t, generate new value for each parameter, conditional on most recent value of all other parameters

What are BUGS and WinBUGS?

  • “Bayesian inference Using Gibbs Sampling”
  • general purpose program for fitting Bayesian models
  • developed by David Spiegelhalter, Andrew Thomas, Nicky Best, and Wally Gilks at the Medical Research Council Biostatistics Unit, Institute of Public He alth, in Cambridge, UK
  • BUGS
    • for Unix and DOS platforms
    • written in Modula-2; distributed in compiled form only
  • WinBUGS
  • for Windows
  • written in Component Pascal running in Oberon Microsystems’ Blackbox environment
  • able to fit a wider variety of models than BUGS can handle
  • undergoing continuing development
  • excellent documentation, including two volumes of examples
  • Web page: http://www.mrc-bsu.cam.ac.uk/bugs/welcome.shtml
  • OpenBUGS
  • open source version of WinBUGS
  • interfaces easily with R
  • Web page: http://mathstat.helsinki.fi/openbugs/

What do BUGS and WinBUGS do?

  • enable user to specify model in simple Splus-like language
  • construct the transition kernel for a Markov chain with the joint posterior as its stationary distribution, and simulate a sample path of the resulting chain - determine whether or not the full conditional for each unknown quantity (parameter or missing data) in the model is a standard density. - generate random variates from standard densities using standard algorithms. - BUGS uses the adaptive rejection algorithm (Gilks and Wild, Applied Statistics, 1992) to generate from nonstandard full conditionals; consequently can handle only log-concave or discrete full conditionals
  • WinBUGS uses Metropolis algorithm to generate from nonstandard full conditionals and is not subject to this limitation

The Art and Science of MCMC Use

  • Deciding how many chains to run
  • Choosing initial values
    • Do not confuse initial values with priors!
    • Priors are part of the model. Initial values are part of the computing strategy used to fit the model.
    • Priors must not be based on the current data.
    • The best choices of initial values are values that are in a high-posterior-density region of the parameter space. If the prior is not very strong, then maximum likelihood estimates (from the current data) are excellent choices of initial values if they can be calculated.
  • In the simple models we have encountered so far, the MCMC sampler will converge quickly even with a poor choice of initial values.
  • In more complicated models, choosing initial values in low posterior density regions may make the sampler take a huge number of iterations to finally start drawing from a good approximation to the true posterior.
  • Assessing whether sampler has “converged”
  • How many initial iterations need to be discarded in order that remaining samples are drawn from a distribution close enough to the true stationary distribution to be usable for estimation and inference?
  • Once we are drawing from the right distribution, how many samples are needed in order to provide the desired precision in estimation and inference?
  • Choosing model parameterizations and MCMC algorithms that will lead to convergence in a reasonable amount of time
  • Using correlated samples for estimation and inference
  • adjusting estimates of standard errors
  • Our next lab will consider output analysis (items from this list)