# hmmsim3.cont: Simulate a continuous-time hidden Markov series and its... In ziphsmm: Zero-Inflated Poisson Hidden (Semi-)Markov Models

## Description

Simulate a continuous-time hidden Markov series and its underlying states with covariates in state-dependent parameters and transition rates.

## Usage

 `1` ```hmmsim3.cont(workparm, M, n, zeroindex, x, timeindex) ```

## Arguments

 `workparm` working parameters `M` number of latent states `n` length of the simulated series `zeroindex` a vector specifying whether a certain state is zero-inflated `x` matrix of covariates for the log poisson means, structural zero proportions and transition rates. `timeindex` a vector containing the time points

## Value

simulated series and corresponding states

## References

Walter Zucchini, Iain L. MacDonald, Roland Langrock. Hidden Markov Models for Time Series: An Introduction Using R, Second Edition. Chapman & Hall/CRC

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```priorparm <- 0 tpmparm <- c(-2,0.1,-0.1,-2,0.2,-0.2) zeroindex <- c(1,0) zeroparm <- c(0,-1,1) emitparm <- c(2,0.5,-0.5,3,0.3,-0.2) workparm <- c(priorparm,tpmparm,zeroparm,emitparm) timeindex <- rep(1,1000) for(i in 2:1000) timeindex[i] <- timeindex[i-1] + sample(1:4,1) designx <- matrix(rnorm(2000),nrow=1000,ncol=2) result <- hmmsim3.cont(workparm,2,1000,zeroindex,x=designx,timeindex=timeindex) y <- result\$series state <- result\$state ```

ziphsmm documentation built on May 2, 2019, 6:10 a.m.