## create two state HMM with t distributions
state.names <- c("one","two")
transition <- c(0.1, 0.02)
location <- c(1, 2)
scale <- c(1, 1)
df <- c(4, 6)
hmm <- getHMM(list(a=transition, mu=location, sigma=scale, nu=df),
state.names)
## number of states in the model
length(hmm)
## transition probability from state 'one' to state 'two'
hmm["one", "two"]
## or equivalently
hmm[1, 2]
## get the transition probability matrix
hmm[ , ]
## evaluate emission distribution function of state 'one' at 0
hmm["one", 0, transition = FALSE]
## again, this time using log transformation
hmm["one", 0, transition = FALSE, log = TRUE]
Run the code above in your browser using DataLab