hmmvbFindModes: Find density modes with HMM-VB

Description Usage Arguments Value See Also Examples

View source: R/hmmvbFindModes.R

Description

This function finds the density modes with HMM-VB. First, for each data point it finds an optimal state sequence using Viterbi algorithm. Next, it uses Modal Baum-Welch algorithm (MBW) to find the modes of distinct Viterbi state sequences. Data points associated the same modes form clusters.

Usage

1
hmmvbFindModes(data, model = NULL, nthread = 1, bicObj = NULL)

Arguments

data

A numeric vector, matrix, or data frame of observations. Categorical values are not allowed. If a matrix or data frame, rows correspond to observations and columns correspond to variables.

model

An object of class 'HMMVB' that contains trained HMM-VB obtained by the call to function hmmvbTrain.

nthread

An integer specifying the number of threads used in clustering.

bicObj

An object of class 'HMMVBBIC' which stores results of model selection. If provided, argument model is ignored.

Value

An object of class 'HMMVBclust'.

See Also

HMMVB-class, HMMVBclust-class, hmmvbTrain

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# find modes using trained HMM-VB
Vb <- vb(1, dim=4, numst=2)
set.seed(12345)
hmmvb <- hmmvbTrain(iris[,1:4], VbStructure=Vb)
modes <- hmmvbFindModes(iris[,1:4], model=hmmvb)
show(modes)


# find modes using HMMVBBIC object obtained in model selection
Vb <- vb(1, dim=4, numst=1)
set.seed(12345)
modelBIC <- hmmvbBIC(iris[,1:4], VbStructure=Vb)
modes <- hmmvbClust(iris[,1:4], bicObj=modelBIC)
show(modes)

HDclust documentation built on May 2, 2019, 9:20 a.m.