plot.hsmm.data {mhsmm} | R Documentation |
Produces a plot of the observed sequences, and displays a coloured bar signifying the hidden states (if available)
## S3 method for class 'hsmm.data': plot(x, ...)
x |
A hsmm.data object |
... |
Arguments passed to plot.ts |
Jared O'Connell
addStates
J<-3 initial <- rep(1/J,J) P <- matrix(c(.8,.5,.1,0.05,.2,.5,.15,.3,.4),nrow=J) b <- list(mu=c(-3,0,2),sigma=c(2,1,.5)) model <- hmmspec(init=initial, trans=P, emission=b,f=dnorm.hsmm) train <- simulate(model, nsim=300, seed=1234, r=rnorm.hsmm) plot(train,xlim=c(0,100))