MCMC “burn-in” calculator


Here is a Ruby script for calculating the “burn-in” for a Markov Chain Monte Carlo run, using the Mr. Bayes software package. In some circles, “burn-in” is referred to as stationarity.

My script performs the following steps:

  1. parses the *.p file(s) from a Mr. Bayes mcmc run.
  2. calculates the average log likelihood for the final 15% of the samples
  3. starting at the top of the *.p file(s), finds the first sample whose log likelihood value is equal to the value calculated in #2. This sample is where the burnin should be drawn. In other words, this sample is where the MCMC run reached stationarity.

You can download the file below; instructions are in the top of the file.

DOWNLOAD HERE: burnin-calc.rb


Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: