## 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)
model <- getHMM(list(a=transition, mu=location, sigma=scale, nu=df),
state.names)
## plot emission distributions of HMM
plot(model)
## now plot density functions separately
par(mfrow=c(1,1))
plot(model@emission$one)
plot(model@emission$two, new.plot=FALSE, lty=2)
legend("topleft", legend=states(model), lty=1:2)
Run the code above in your browser using DataLab