/stat_bay

Primary LanguagePython

Markov chain mixture with HMM (Chib 96)

Authors: Marin Bouthemy, Kossi Neroma, Tangi Salaün and Nicolas Toussaint

Introduction

This repository contains the implementation of the HMM algorithm describes in the paper of Siddhartha Chib named "Calculating posterior distributions and modal estimates in Markov mixture models". You can find it here.

This repository is designed like a library to simulate and run HMM on different markov chain. You can define easily your prior and posterior. Then just run the HMM to get your results. Next, you can plot the ACF to see, how many steps from the beginning you need to remove.

Examples

You can see two examples of the library working in the examples folder.

A poisson mixture example

There are two notebooks :

  1. Poisson mixture : pHMM.ipynb
  2. Gaussian mixture : gHMM.ipynb

Library structure

All the files running the library are in the models folder.

  1. posteriors.py : contains the implementation of different posteriors for the HMM. Posteriors are used to defined your model for the HMM
  2. HMM.py : contains the implementation of the HMM
  3. simulation.py : some function to simulate the markov chain from a posterior
  4. utils.py : some utilities to plot the ACF.