Skip to content

compops/pmmh-qn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Correlated pseudo-marginal Metropolis-Hastings using quasi-Newton proposals

This code was downloaded from https://github.com/compops/pmmh-qn and contains the code and data used to produce the results in the papers:

J. Dahlin, A. Wills and B. Ninness, Correlated pseudo-marginal Metropolis-Hastings using quasi-Newton proposals. Pre-print, arXiv:1807:nnnnn, 2018.

The paper is available as a preprint from https://arxiv.org/abs/1807.nnnnn.

Python code (python/)

This code is used to set-up and run all the experiments in the paper. The code can possibly also be modified for other models. See the README.md file for more information.

Docker

A simple method to reproduce the results is to make use of the Docker container build from the code in this repository when the paper was published. Docker enables you to recreate the computational environment used to create the results in the paper. Hence, it automatically downloads the correct version of Python and all dependencies.

First, you need to download and installer Docker on your OS. Please see https://docs.docker.com/engine/installation/ for instructions on how to do this. Secondly, you can run the Docker container by running the command

docker run -v <<LOCALPATH>>:/app/results -e EXPERIMENT='<<EXPERIMENT_NUMBER>>' -e FULLRUN='<<FULL_RUN>>' --name pmmh-qn-run compops/pmmh-qn:draft1

where <<LOCALPATH>> is replaced with a local path to where the results are to be stored, e.g., /home/username/tmp on a Linux computer. <<EXPERIMENT_NUMBER>> is replaced with either 1, 2 or 3 corresponding to the three experiments in the paper. <<FULL_RUN>> can be either 0 or 1. Selecting 0 runs only one experiment (for practical reasons) and 1 runs 5/10 Monte Carlo simulations just like in the paper.

Note that running with the flag -e EXPERIMENT='1' -e FULLRUN='1', i.e. the first experiment (random effects model) and 5 Monte Carlo runs will probably take around a day to complete.

To reproduce the plots from the paper, move the contents of the results folder in <<LOCALPATH>> into a folder called results in a cloned version of the GitHub repository. Follow the instruction for the R code to create pdf versions of the plots. Note that the plot scripts are written for the case when -e FULLRUN='1' for the first and second example, which means that they might require some changes when running with -e FULLRUN='0'.

R code (r/)

This code is used to generate diagnostic plot as well as plots and table for the paper. See the README.md file for more information.

Binaries and results from simulations

The data generated from each run of the algorithm is rather large and cannot be easily distributed via GitHub. Please contact the authors if you would like to receive a copy of the output from the simulations. Otherwise, you should be able to reproduce all runs yourself within a few hours by running the Docker container.

License

This source code is distributed under the GPLv3 license with (c) Johan Dahlin 2018 and comes with ABSOLUTELY NO WARRANTY. See the file LICENSE for more information.

###############################################################################
#    Constructing Metropolis-Hastings proposals using damped BFGS updates
#    Copyright (C) 2018  Johan Dahlin < uni (at) johandahlin [dot] com >
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <https://www.gnu.org/licenses/>.
###############################################################################

Acknowledgements

This code makes use of the argsort implementation by Jason Rudy found at https://github.com/jcrudy/cython-argsort.