https://github.com/bmwcarit/hmm-lib
Library for time-inhomogeneous Hidden Markov Models
https://github.com/bmwcarit/hmm-lib
Last synced: 7 months ago
JSON representation
Library for time-inhomogeneous Hidden Markov Models
- Host: GitHub
- URL: https://github.com/bmwcarit/hmm-lib
- Owner: bmwcarit
- License: apache-2.0
- Created: 2015-05-06T15:57:53.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2021-08-24T12:04:19.000Z (over 4 years ago)
- Last Synced: 2025-07-28T07:49:53.938Z (8 months ago)
- Language: Java
- Homepage:
- Size: 253 KB
- Stars: 92
- Watchers: 14
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-java - HMMLib
README
# Overview
This library implements Hidden Markov Models (HMM) for time-inhomogeneous Markov processes.
This means that, in contrast to many other HMM implementations, there can be different
states and a different transition matrix at each time step.
This library provides an implementation of
* The Viterbi algorithm, which computes the most likely sequence of states.
* The forward-backward algorithm, which computes the probability of all state candidates given
the entire sequence of observations. This process is also called smoothing.
# Applications
This library was initially created for HMM-based map matching according to the paper
"NEWSON, Paul; KRUMM, John. Hidden Markov map matching through noise and sparseness.
In: Proceedings of the 17th ACM SIGSPATIAL international conference on advances in geographic
information systems. ACM, 2009. S. 336-343."
[Graphhopper](https://graphhopper.com/) [map matching](https://github.com/graphhopper/map-matching)
is now using the hmm-lib for matching GPS positions to OpenStreetMap maps.
The [offline-map-matching](https://github.com/bmwcarit/offline-map-matching) project
demonstrates how to use the hmm-lib for map matching but does not provide integration to any
particular map.
Besides map matching, the hmm-lib can also be used for other applications.
# License
This library is licensed under the
[Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).
# Dependencies
Except for testing, there are no dependencies to other libraries.
# Maven
To use this library, add the following to your pom.xml:
```
com.bmw.hmm
hmm-lib
1.1.0-SNAPSHOT
```
If you want to use snapshots, add
```
...
hmm-lib-snapshots
https://raw.github.com/bmwcarit/hmm-lib/mvn-snapshots/
true
always
```
# Contribute
Contributions are welcome! For bug reports, please create an issue.
For code contributions (e.g. new features or bugfixes), please create a pull request.
# Changes
* 1.1.0:
* Add forward-backward algorithm, which performs smoothing on the hidden state variables.
* The Viterbi algorithm now optionally returns smoothing probabilities for the states of the
most likely sequence.
* 1.0.0:
* API redesign to allow calling the Viterbi algorithm iteratively. This gives the library user
increased flexibility and optimization opportunities when computing transition and observation
probabilities. Moreover, the new API enables better handling of HMM breaks.
* Add support for transition descriptors. For map matching, this allows retrieving the paths
between matched positions (the entire matched route) after computing the most likely sequence.
* Reduce memory footprint from O(t\*n²) to O(t\*n) or even O(t) in many applications, where t is
the number of time steps and n is the number of candidates per time step.
* 0.2.0: Extend HmmProbabilities interface to include the observation
* 0.1.0: Initial release