Python script to run diagnostics on MCMC chains. More...
Functions | |
def | ACT (fileName, burnIn) |
Function to run the autocorrelation test and calculate the auto-correlation time. | |
def | GR_eval (var, b, n, data) |
Function to the perform Gelman-Rubin convergence test. | |
def | GR_run (var, b, data) |
def | GR (fileName, burnIn) |
Function to run the Gelman-Rubin test. More... | |
Variables | |
tuple | parser = OptionParser() |
string | metavar = "FILE" |
list | FILE_NAMES = [x.strip() for x in options.fileName.split(',')] |
Detailed Description
- Date
- May 2017
This is a Python script to run diagnostics on MCMC chains to assess convergence of the chains and performance of the sampler.
./diagnosticss.py [options]
The available options are:
-h, --help : Show the help message explaining the various available options.
-f, --chain-file [FILE1, FILE2, ...] : Option to pass the MCMC Chain files to the script. If one chain file is supplied only the autocorrelation time test is performed. If more than one chain file is passed, autocorrelation time tests are performed on each file separately. In addition Gelman-Rubin tests are done on the chain files.
-b, --burn-in [INTEGER]: Optional number of burn in samples to exclude from the beginning of the chains.
Autocorrelation time is calculated using Jonathan Goodman's C++ software Acor. We include a version of Acor in the analysis directory including a makefile to compile the software. Once it's compiled the script can use it to generate the autocorrelation time outputs.