HMMSet | R Documentation |
This function is used to create a HMMClass object which contains the parameters of the HMM. An HMM is described by an initial state probability vector, transition matrices and a distributionClass object.
HMMSet(initProb, transMat, ...)
initProb |
The vector of probabilities of the initial state |
transMat |
The transition matrix of the hidden Markov chain. Since version 1.3.4 of RHmm, a list of transition matrices can be specified in order to define an inhomogeneous HMM. |
... |
Other parameters. See details. |
Typical usages are:
HMMSet(initProb, transMat, distribution)
HMMSet(initProb, transMat, dis="NORMAL", mean, var)
HMMSet(initProb, transMat, dis="NORMAL", mean, cov)
HMMSet(initProb, transMat, dis="MIXTURE", mean, var, proportion)
HMMSet(initProb, transMat, dis="DISCRETE", proba, labels=NULL)
The different arguments are:
The distributionClass object of the observations
dis parameter. See distributionSet
mean parameter. See distributionSet
var parameter. See distributionSet
cov parameter. See distributionSet
proportion parameter. See distributionSet
proba parameter. See distributionSet
labels parameter. See distributionSet
An ‘HMMClass’ class object with the following elements:
Initial state probabilities vector
Transition matrix
The distributionClass object which describes the conditional distribution. See distributionSet.
distributionSet
# 3 hidden states Markov Model with univariate normal distributions
# for the observations
# obs | hidden state = 1 are N(1, 1)
# obs | hidden state = 2 are N(-2, 2)
# obs | hidden state = 3 are N(5, 4)
n_1d_3s <- distributionSet("NORMAL", c(1, -2, 5), c(1, 2, 4))
initProb3 <- rep(1,3)/3
transMat3 <- rbind(c(0.5, 0.4, 0.1), c(0.3, 0.4, 0.3),
c(0.2, 0.1, 0.7))
hmm1 <- HMMSet(initProb3, transMat3, n_1d_3s)
# or directly
hmm2 <- HMMSet(initProb3, transMat3, "NORMAL", mean=c(1, -2, 5),
var=c(1, 2, 4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.