Toolbox for hidden Markov models
HMM Documentation

Overview: HMM - Hidden Markov Models

hmm is a simple set of hidden Markov model (HMM) code intended to support control of switching linear dynamical systems.

It contains methods for generating and decoding systems with discrete latent states and discrete observed signals.


see also: rtxi-hmmDecoder and rtxi-hmmGenerator for application of this library in modules intended for the RTXI platform

Repository Organization

  • src source files (*.cpp)
  • include header files (*.h)
  • examples demonstrating functionality, includes tutorial
  • matlab for comparing matlab and C++ implementations
  • scripts utilities for setting up hmm library
  • docs files for creating Doxygen documentation
  • legacy old implementations (could likely be safely deleted)


  • none

Compilation & Installation

For basic project build & install

cd /path/to/repository
mkdir build && cd build
cmake .. #configure build
cmake --build . #build the project
cmake --install . #[optional] installs to default location (OS-specific),
#use `--prefix` to install to a different directory

see the build and test process in action: build and test

For basic benchmarking and verification of a successful install

ctest -N #list tests to be performed
ctest -VV #execute tests

2 state results

Tutorial: Understanding the HMM toolbox

Common issues

sometimes, the first time I build after a clean install I get: `the C compiler "/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang" is not able to compile a simple test program.`
This happens when i'm in a conda environment with an older version of clang conda deactive usually fixes the issue

GitHub Page