Sequence Clustering with Discrete-Output HMMs

Provides an implementation of a mixture of hidden Markov models (HMMs) for discrete sequence data in the Discrete Bayesian HMM Clustering (DBHC) algorithm. The DBHC algorithm is an HMM Clustering algorithm that finds a mixture of discrete-output HMMs while using heuristics based on Bayesian Information Criterion (BIC) to search for the optimal number of HMM states and the optimal number of clusters.

output: md_document: variant: markdown_github

Package DBHC is an implementation of a sequence clustering algorithm that uses a mixture of discrete-output hidden Markov models (HMMs), the Discrete Bayesian HMM Clustering (DBHC) algorithm. The algorithm uses heuristics based on the Bayesian Information Criterion (BIC) to search for the optimal number of hidden states in each HMM and the optimal number of clusters. The packages provides functions for finding clusters in discrete sequence data with the DBHC algorithm and for plotting heatmaps of the probability matrices that are estimated in the cluster models.


Below a basic example of how to use package DBHC for obtaining sequence clusters for the Swiss Household data in package TraMineR:

## Swiss Household Data
data("biofam", package = "TraMineR")
# Clustering algorithm
new.alphabet <- c("P", "L", "M", "LM", "C", "LC", "LMC", "D")
sequences <- seqdef(biofam[,10:25], alphabet = 0:7, states = new.alphabet)
# Code below takes long time to run
res <- hmm.clust(sequences)
# Heatmaps
cluster <- 1  # display heatmaps for cluster 1
## A smaller example, which takes less time to run
subset <- sequences[sample(1:nrow(sequences), 20, replace = FALSE),]
# Clustering algorithm
res <- hmm.clust(subset, K.max = 3)
# Number of clusters
# Table of cluster memberships
# BIC for each number of clusters
# Heatmaps
cluster <- 1  # display heatmaps for cluster 1


DBHC 0.0.2

First submission

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.0.2 by Gabriel Budel, a year ago

Report a bug at

Browse source code at

Authors: Gabriel Budel [aut, cre] , Flavius Frasincar [aut]

Documentation:   PDF Manual  

GPL (>= 3) license

Imports seqHMM, TraMineR, reshape2, ggplot2

See at CRAN