Mixture Hidden Markov Models for Social Sequence Data and Other Multivariate, Multichannel Categorical Time Series
Overview
Designed for estimating variants of hidden (latent) Markov models (HMMs), mixture HMMs, and non-homogeneous HMMs (NHMMs) for social sequence data and other categorical time series. Special cases include feedback-augmented NHMMs, Markov models without latent layer, mixture Markov models, and latent class models. The package supports models for one or multiple subjects with one or multiple parallel sequences (channels). External covariates can be added to explain cluster membership in mixture models as well as initial, transition and emission probabilities in NHMMs. The package provides functions for evaluating and comparing models, as well as functions for visualizing of multichannel sequence data and HMMs. For NHMMs, methods for computing average causal effects and marginal state and emission probabilities are available. Models are estimated using maximum likelihood via the EM algorithm or direct numerical maximization with analytical gradients. Documentation is available via several vignettes, and Helske and Helske (2019, doi:10.18637/jss.v088.i03). For methodology behind the NHMMs, see Helske (2025, doi:10.48550/arXiv.2503.16014).
- EM algorithm for NHMMs now supports SQUAREM acceleration
(Varadhan and Roland, 2008).
- Exposed argument
save_all_solutionsinestimate_nhmmand
estimate_mnhmm for saving solutions from all restarts.
- Changed the options of the
plotsargument options of
stacked_sequence_plot to observations and hidden states.
- Added an argument
idsforget_*_probsfunctions. estimate_nhmmandestimate_mnhmmnow setinit_sd=0ifrestart=0and
user has provided initial values.
- Added default values for
idandtimeforstslist_to_data. - Fixed the forward weighting in
get_marginals. - Improved the performance of
posterior_probs.
Show all changes in 2.2.0Hide the rest of the changes in 2.2.0
- Improved the performance of
summary_mnhmmand computation of posterior
cluster probabilities in general.
- Improved the performance of creating the design matrices in model building.
- Fixed a bug in
coef.mnhmmwhich resulted an error on extracting
confidence intervals for emission probabilities.
- Fixed mnhmm example in
estimate_mnhmmdocumentation. - Fixed a memory leak in the M-step of initial probabilities of NHMMs.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK13 OK2026-05-02
Show 4 earlier changesHide 4 earlier changes
- ERROR11 OK, 1 ERROR2026-04-25
- NOTE12 OK, 2 NOTE2026-04-22
- ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 65 (1 internal)includes a package overview page
- Examples that run
- 100%30 run in a plain check
- Exported functions with examples
- 49%
- Documented parameters
- 99%
- Return-value docs
- 63%
- Help pages citing references
- 12%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 94
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
5 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/helske/seqhmm on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Installing seqHMM adds 84 packages (46 with compiled code, 66 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 2.2.0Latest
- 2.1.0
- 2.0.02025-05-17 · diff ↗ ·
removed 4 exports
estimate_coef, fit_hmm, fit_mhmm, trim_hmmadded 16 exports
bootstrap_coefs, data_to_stslist, estimate_mnhmm, estimate_nhmm, get_cluster_probs, get_emission_probs, get_initial_probs, get_marginals, get_transition_probs, most_probable_cluster, posterior_cluster_probabilities, simulate_mnhmm, simulate_nhmm, sort_sequences, stacked_sequence_plot, stslist_to_data - RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 1.2.62023-07-06 · diff ↗
- 1.2.5
- RR 4.3.0 released · 2023-04-21
- 1.2.42023-01-09 · diff ↗
- 1.2.32022-12-12 · diff ↗
- 1.2.22022-11-30 · diff ↗
- 1.2.1-12022-05-25 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 1.2.02021-10-18 · diff ↗
- 1.1.12021-08-13 · diff ↗
Show 23 earlier eventsHide 23 earlier events
- 1.1.02021-06-18 · diff ↗
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- 1.0.142019-10-22 · diff ↗
- 1.0.132019-06-17 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 1.0.122019-04-11 · diff ↗
- 1.0.112019-04-09 · diff ↗
- 1.0.102019-01-26 · diff ↗
- 1.0.92018-11-06 · diff ↗
- 1.0.8-12018-05-10 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 1.0.82017-11-08 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 1.0.72017-04-04 · diff ↗
- 1.0.6
- RR 3.3.0 released · 2016-05-03
- 1.0.52016-02-24 · diff ↗
- 1.0.42016-01-14 · diff ↗
- 1.0.3-12015-12-30 · diff ↗
- 1.0.32015-12-23 · diff ↗
- 1.0.2-12015-12-19
- RR 3.2.0 released · 2015-04-16
Package metadata
- First published
- 2015-12-19
- Total releases
- 27 / 11 yrs
- License
- GPL (>= 2) OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 408 KB / 8 files
- Download size
- 1.4 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("seqHMM")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.