Coder Social home page Coder Social logo

compops / qpmh2-sysid2015 Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 6.36 MB

Quasi-Newton particle Metropolis-Hastings

Home Page: http://www.johandahlin.com/research/

License: GNU General Public License v3.0

Python 100.00%
metropolis-hastings particle-filter state-space-models quasi-newton particle-metropolis-hastings

qpmh2-sysid2015's Introduction

qpmh2-sysid2015

This code was downloaded from < https://github.com/compops/qpmh2-sysid2015 > and contains the code used to produce the results in the paper

J. Dahlin, F. Lindsten and T. B. Schön, Quasi-Newton particle Metropolis-Hastings. Proceedings of the 17th IFAC Symposium on System Identification, Beijing, China, October 2015.

The papers are available as a preprint from < http://arxiv.org/pdf/1502.03656 >.

Requirements

The code is written and tested for Python 2.7.6. The implementation makes use of NumPy 1.9.2, SciPy 0.15.1, Matplotlib 1.4.3 and Pandas 0.13.1. On Ubuntu, these packages can be installed/upgraded using

sudo pip install --upgrade package-name

Included files

RUNME-kalman.py Compares the pPMH0, pPMH1 and qPMH2 algorithms using the Kalman smoother to estimate the required gradient and log-likelihood. This is an simplified example of the LGSS model in the paper that runs fairly quickly. The code presents the trace plots, the resulting posterior estimates and computes an approximate value of the IACT (IF in the paper) for the different proposals and parameters. Note that the IACT calculation is carried out in R for the paper but the code is written to resemble the R implementation as close as possible. The plots and data from a run of this file is attached in the results folder.

RUNME-particles.py Makes the same comparison as in RUNME-kalman.py but by using the fully adapted particle filter instead as done in the paper. This code takes a bit longer to run but generates similar results as in the Kalman case.

Supporting files

models/lgss_4parameters.py Defines the state space model that we use together with the expressions required to simulate from the model and estimate the gradient.

models/models_dists.py Subroutines for evaluating distributions, their derivatives and Hessians.

models/models_helpers.py Subroutines for data generation and for importing data.

para/pmh.py The main routine for the PMH algorithm and for estimating the Hessian using the quasi-Newton scheme.

para/pmh_helpers.py Subroutines for exporting the data generated by the PMH algorithm.

results/ Data and plots from running the two RUNME-files.

state/kalman.py The routines for Kalman filtering and smoothing to estimate the log-likelihood and gradients of the log-posterior.

state/smc.py The routines for particle filtering and particle fixed-lag smoothing to estimate the log-likelihood and gradients of the log-posterior.

qpmh2-sysid2015's People

Contributors

compops avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.