Hidden Markov Models using LAPACK primitives

Version on this page:0.5
LTS Haskell 21.14:
Stackage Nightly 2023-10-02:
Latest on Hackage:

See all snapshots hmm-lapack appears in

BSD-3-Clause licensed by Henning Thielemann
This version can be pinned in stack with:hmm-lapack-0.5@sha256:0d27d0e20092ed3318a9629c2627ba105b1124940ff5fd01ad83ffe90d2473f7,3949

Hidden Markov Models implemented using LAPACK data types and operations.

It implements:

  • generation of samples of emission sequences,

  • computation of the likelihood of an observed sequence of emissions,

  • construction of most likely state sequence that produces an observed sequence of emissions,

  • supervised and unsupervised training of the model by Baum-Welch algorithm.

It supports any kind of emission distribution, where discrete and multivariate Gaussian distributions are implemented as examples.

For an introduction please refer to the examples:

  • Math.HiddenMarkovModel.Example.TrafficLight

  • Math.HiddenMarkovModel.Example.SineWave

  • Math.HiddenMarkovModel.Example.Circle

An alternative package without foreign calls is hmm.



  • Distribution: Make type-classes single parameter using data families.


  • Move to new packages comfort-array and lapack.


  • Distribution.Estimate turned into a multi-parameter type class.