hmmvbTrain | R Documentation |
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.
hmmvbTrain(
data,
VbStructure = NULL,
searchControl = vbSearchControl(),
trControl = trainControl(),
nthread = 1
)
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 |
trControl |
A list of control parameters for HMM-VB training algorithm.
The defaults are set by the call |
nthread |
An integer specifying the number of threads used in searching and training routines. |
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. |
VB
, vb
, vbSearchControl
,
trainControl
# 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=1)
show(hmmvb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.