hmmvbTrain: Train HMM-VB

Description Usage Arguments Value See Also Examples

View source: R/hmmvbTrain.R

Description

This function estimates parameters for HMM-VB using the Baum-Welch algorithm. If the variable block structure is not provided, the function will first find the structure by a greedy search algorithm that minimizes BIC.

Usage

1
2
hmmvbTrain(data, VbStructure = NULL, searchControl = vbSearchControl(),
  trControl = trainControl(), nthread = 1)

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.

VbStructure

An object of class 'VB'. If supplied, variable block structure stored in VbStructure is used to train HMM-VB. If not provided, a search algorithm will be perfomed to find a variable block structure with minimal BIC.

searchControl

A list of control parameters for variable block structure search. This parameter is ignored if variable block structure VbStructure is provided. The defaults are set by the call vbSearchControl().

trControl

A list of control parameters for HMM-VB training algorithm. The defaults are set by the call hmmvbTrainControl().

nthread

An integer specifying the number of threads used in searching and training routines.

Value

An object of class 'HMMVB' providing estimation for HMM-VB. The details of output components are as follows:

VbStructure

An object of class 'VB' with variable block structure for HMM-VB

HmmChain

A list of objects of class 'HMM' with trained Hidden Markov Models for each variable block.

diagCov

A logical value indicating whether or not covariance matrices for mixture models are diagonal.

BIC

BIC value for provided variable block structure or optimal BIC value for found variable block structure.

See Also

VB, vb, vbSearchControl, trainControl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Train HMM-VB with known variable block structure
data("sim3")
Vb <- vb(2, dim=40, bdim=c(10,30), numst=c(3,5), varorder=list(c(1:10),c(11:40)))
set.seed(12345)
hmmvb <- hmmvbTrain(sim3[,1:40], VbStructure=Vb)
show(hmmvb)


# Train HMM-VB with unknown variable block structure using default parameters
data("sim2")
set.seed(12345)
hmmvb <- hmmvbTrain(sim2[,1:5])
show(hmmvb)

# Train HMM-VB with unknown variable block structure using with ten permutations
# and several threads
data("sim2")
set.seed(12345)
hmmvb <- hmmvbTrain(sim2[1:5], searchControl=vbSearchControl(nperm=10), nthread=3)
show(hmmvb)

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