FactorialHMM is a Python package for fast exact inference in Factorial Hidden Markov Models.
FactorialHMM is freely available for academic use. A specific license must be obtained for any commercial or for-profit organization or for any web-diffusion purpose.
Citation: Regev Schweiger, Yaniv Erlich, Shai Carmi; FactorialHMM: fast and exact inference in factorial hidden Markov models, Bioinformatics, bty944, https://doi.org/10.1093/bioinformatics/bty944
Our package allows:
- Simulating directly from the model
- Simulating from the posterior distribution of states given the observations
- Calculating the (Viterbi) sequence of states with the largest posterior probability
- Calculating the Forward-Backward algorithm, and in particular likelihood of the data and the posterior probability (given all observations) of the marginal and joint state probabilities as well as additional HMM-related procedures.
The running time and space requirement of all procedures is linear in the number of possible states. This package is highly modular, providing the user with maximal flexibility for developing downstream applications.
Required Python 3+.
Simply download the factorial_hmm.py
file, add its location to sys.path
(e.g., sys.path.append(path_to_dir)
), and import the library.
Prerequisites are numpy
and scipy
.
Comments are welcome at regevs@gmail.com or regev.schweiger@myheritage.com.
The full documentation is available at the Wiki section.