Skip to content

Markov Chain Models: Sequenzo and seqHMM Mapping

This page maps Sequenzo sequenzo.seqhmm functions to their closest seqHMM (R) counterparts.

What This Section Covers

This section focuses on building, fitting, predicting, comparing, and simulating hidden Markov models for sequence data. For R users, the workflow mirrors seqHMM's build_*fit_*predict / posterior_probs pattern, with SequenceData replacing TraMineR stslist objects.

Mapping Table

Sequenzo functionseqHMM counterpartNotes
build_hmm()build_hmm()Creates an unfitted HMM; supports single- and multichannel input.
fit_model()fit_model()EM fitting for basic HMM. Sequenzo's default wrapper uses EM only; use fit_model_advanced() for global/local steps.
fit_model_advanced()fit_model(..., global_step, local_step)Optional EM + global (MLSL-style) + local (L-BFGS) optimization with restarts.
predict()hidden_paths() / predict.hmmViterbi decoding of the most likely hidden-state path.
posterior_probs()posterior_probs()Forward–backward state probabilities at each time point.
plot_hmm()plot.hmm()Transition/emission matrices and network graph.
build_mhmm()build_mhmm()Mixture HMM structure. Sequenzo: single-channel only for now.
fit_mhmm()fit_model.mhmmEM for mixture HMM.
predict_mhmm()most_probable_cluster()Hard cluster assignment per sequence.
posterior_probs_mhmm()posterior_cluster_probabilities()Soft cluster membership probabilities.
plot_mhmm()plot.mhmm()Cluster weights and per-cluster parameters.
build_nhmm()build_nhmm()Covariate-dependent NHMM; formula or X matrix.
fit_nhmm()fit_nhmm()Numerical optimization of NHMM coefficients.
aic() / bic()stats::AIC(logLik()) / stats::BIC(logLik())Information criteria after fitting.
compare_models()Manual comparison of fitted modelsRanks models by AIC or BIC.
simulate_hmm()simulate_hmm()Generate synthetic sequences from HMM parameters.
simulate_mhmm()simulate_mhmm()Generate synthetic MHMM sequences; supports formula-based mixture weights.
simulate_nhmm()simulate_nhmm()Generate synthetic NHMM sequences from formulas.
bootstrap_model()bootstrap_coefs()Nonparametric bootstrap confidence intervals (partial parity).

Not Yet Mapped in Sequenzo

The R package also exports utilities that do not yet have a direct Sequenzo equivalent:

seqHMM (R)Status in Sequenzo
build_mnhmm(), estimate_mnhmm()Not implemented
hidden_paths() as standalone exportUse predict() instead
get_initial_probs(), get_transition_probs(), get_emission_probs()Read attributes on fitted model objects
stacked_sequence_plot(), ssplot(), gridplot()Not implemented
trim_model(), permute_states(), separate_mhmm()Not implemented
data_to_stslist() / stslist_to_data()Use SequenceData directly

Input Type Mapping

ConceptseqHMM (R)Sequenzo
Sequence inputTraMineR stslist (seqdef)SequenceData
Multichannel inputList of stslistList[SequenceData] in build_hmm() only
CovariatesFormula + data.frameFormula strings + pandas.DataFrame, or NumPy X tensor
Fitted model classhmm, mhmm, nhmm, mnhmmHMM, MHMM, NHMM

Authors

Code: Yuqi Liang and Yapeng Wei

Documentation: Yuqi Liang

References

Helske, S., & Helske, J. (2019). Mixture hidden Markov models for sequence data: The seqHMM package in R. Journal of Statistical Software, 88(3), 1–32. https://doi.org/10.18637/jss.v088.i03