seqHMM: Mixture Hidden Markov Models for Social Sequence Data and Other Multivariate, Multichannel Categorical Time Series

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>).

Version: 2.0.0
Depends: R (≥ 4.1.0)
Imports: checkmate, cli, data.table, future.apply, ggplot2, ggseqplot, graphics, grDevices, grid, gridBase, igraph, lhs, Matrix, methods, nloptr, numDeriv, patchwork, progressr, Rcpp (≥ 0.12.0), RcppHungarian, rlang, stats, TraMineR (≥ 2.2-7), utils
LinkingTo: nloptr, Rcpp (≥ 0.12.0), RcppArmadillo
Suggests: covr, knitr, MASS, nnet, testthat (≥ 3.0.0)
Published: 2025-05-17
Author: Jouni Helske ORCID iD [aut, cre], Satu Helske ORCID iD [aut]
Maintainer: Jouni Helske <jouni.helske at iki.fi>
BugReports: https://github.com/helske/seqHMM/issues
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
NeedsCompilation: yes
SystemRequirements: GNU make
Citation: seqHMM citation info
Materials: README NEWS
CRAN checks: seqHMM results

Documentation:

Reference manual: seqHMM.pdf
Vignettes: Mixture Hidden Markov Models for Sequence Data: the seqHMM Package in R (source, R code)
The main algorithms used in the seqHMM package (source)
Examples and tips for estimating Markovian models with seqHMM (source)
Visualization tools in the seqHMM package (source, R code)

Downloads:

Package source: seqHMM_2.0.0.tar.gz
Windows binaries: r-devel: seqHMM_1.2.6.zip, r-release: seqHMM_1.2.6.zip, r-oldrel: seqHMM_1.2.6.zip
macOS binaries: r-release (arm64): seqHMM_2.0.0.tgz, r-oldrel (arm64): seqHMM_2.0.0.tgz, r-release (x86_64): seqHMM_1.2.6.tgz, r-oldrel (x86_64): seqHMM_1.2.6.tgz
Old sources: seqHMM archive

Reverse dependencies:

Reverse imports: DBHC
Reverse suggests: clickb, tna

Linking:

Please use the canonical form https://CRAN.R-project.org/package=seqHMM to link to this page.