# See the help for sim.hmm() for how to generate y.sim.
try <- hmm(y.sim,K=2,verb=TRUE)
sss.1 <- mps(y.sim,try)
sss.2 <- mps(y.sim,tpm=P,ispd=c(0.25,0.75),Rho=R) # P and R as in the help
# for sim.hmm().
# The order of the states has gotten swapped; 3-sss.1[,1] is much
# more similar to sss.2[,1] than is sss.1[,1].
Run the code above in your browser using DataLab