Related Experiment Video
Updated: Feb 2, 2026

Genotypic Inference of HIV-1 Tropism Using Population-based Sequencing of V3
Published on: December 27, 2010
FactorialHMM: fast and exact inference in factorial hidden Markov models
Regev Schweiger1,2, Yaniv Erlich2,3,4,5, Shai Carmi6
1Blavatnik School of Computer Science, Tel Aviv University, Tel Aviv, Israel.
Motivation:
Hidden Markov models (HMMs) are powerful tools for modeling processes along the genome. In a standard genomic HMM, observations are drawn, at each genomic position, from a distribution whose parameters depend on a hidden state, and the hidden states evolve along the genome as a Markov chain. Often, the hidden state is the Cartesian product of multiple processes, each evolving independently along the genome. Inference in these so-called Factorial HMMs has a naïve running time that scales as the square of the number of possible states, which by itself increases exponentially with the number of sub-chains; such a running time scaling is impractical for many applications. While faster algorithms exist, there is no available implementation suitable for developing bioinformatics applications.
Results:
We developed FactorialHMM, a Python package for fast exact inference in Factorial HMMs. Our package allows simulating either directly from the model or from the posterior distribution of states given the observations. Additionally, we allow the inference of all key quantities related to HMMs: (i) the (Viterbi) sequence of states with the highest posterior probability; (ii) the likelihood of the data and (iii) the posterior probability (given all observations) of the marginal and pairwise state probabilities. The running time and space requirement of all procedures is linearithmic in the number of possible states. Our package is highly modular, providing the user with maximal flexibility for developing downstream applications.
Availability And Implementation:
https://github.com/regevs/factorial_hmm.
Supplementary Information:
Supplementary data are available at Bioinformatics online.
Related Concept Videos
Factorial Design
Fisher's Exact Test
Theory of Attribution I: Correspondent Inference Theory
Fast Fourier Transform
The computational efficiency of the FFT becomes...
Statistical Inference Techniques in Hypothesis Testing: Parametric Versus Nonparametric Data
Parametric statistics, as the name suggests, assumes that data follow a specific distribution, often a normal distribution. This assumption enables robust hypothesis testing and estimation. Parametric methods, like the Student's t-test or Goodness-of-fit test, are frequently employed in biostatistics due to their robustness. For instance,...
Fast Decoupled and DC Powerflow

