View source: R/HiddenMarkovModel.R
HiddenMarkovModel | R Documentation |
HiddenMarkovModel using Rhmm package.
Procedure:
1. Selection of the number of states (Knowledge Discovery)
2. the Baum-Welch algorithm (generalized EM) determines the transition matrix P and the output probability
3. Veterbi algorithm: Determination of the probable sequence of states for a given observation, i.e. clustering is reproduced as output
HiddenMarkovModel(Data,ClusterNo,DistributionName='NORMAL',
Iterations=500,PriorClassification,PlotIt=TRUE,Silent=TRUE)
Data |
[1:n,1:d] d-dimensional data of n cases |
ClusterNo |
number of states, |
DistributionName |
Normal==gaussian distributions |
Iterations |
number of maximal iteration steps |
PriorClassification |
Optional, to be compared with HMM |
PlotIt |
Optional, Plots the distributions of |
Silent |
Optional, additional outputs during the process of the function, e.g. |
"Hidden", since only time series given, but no actual states. States cannot be observed The output in a state is probalistic. The output in one state is therefore probalistic, since neither the transition probability nor the states are known. The number must be specified using a cluster procedure or from expert knowledge. The states should have semantics.
List of
HMMmodell |
please see |
HMM_means |
[1:k] means of distributions, please see |
HMM_SDs |
[1:k] standard deviations of distributions, please see |
HMM_weights |
[1:k] weights of distributions |
Uebergangsmatrix |
Transition matrix, please see |
VitPath |
please see |
HMMcls |
[1:n] classification defining which datapoint (case) belongs to which case |
XTable |
if |
Accuracy |
if |
Michael Thrun
Bilmes, Jeff A.: A Gentle Tutorial of the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models http://ssli.ee.washington.edu/people/bilmes/mypapers/em.ps.gz, 1997.
Baum-Welch-Algorithmus (generalisierter EM): HMMFit
Viterbi-Algorithmus: viterbi
,HMMFit
requireNamespace('Rhmm')
data(n1d_3s)
Data=as.matrix(obs_n1d_3s[[1]])
model=HiddenMarkovModel(Data,3,PlotIt = T,Silent = T)
TagNR=1:nrow(Data)
plot(TagNR,Data[,1],col=model$HMMcls,main='HMM states with Viterbi',pch=20)
legend("topright", inset = c(-0.2, 0), legend = sort(unique(model$HMMcls)),
fill = sort(unique(model$HMMcls)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.