# hmmsmooth.cont: Compute the posterior state probabilities for continuous-time... In ziphsmm: Zero-Inflated Poisson Hidden (Semi-)Markov Models

## Description

Compute the posterior state probabilities for continuous-time hidden Markov models without covariates where zero-inflation only happens in state 1

## Usage

 `1` ```hmmsmooth.cont(y, M, prior_init, tpm_init, emit_init, zero_init, timeindex) ```

## Arguments

 `y` the observed series to be decoded `M` number of latent states `prior_init` a vector of prior probability values `tpm_init` transition rate matrix `emit_init` a vector containing means for each poisson distribution `zero_init` a scalar containing structural zero proportion in state 1 `timeindex` a vector containing the time points

## Value

posterior state probabilities

## 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 14``` ```prior_init <- c(0.5,0.2,0.3) emit_init <- c(10,40,70) zero_init <- c(0.5,0,0) omega <- matrix(c(-0.3,0.2,0.1,0.1,-0.2,0.1,0.2,0.2,-0.4),3,3,byrow=TRUE) timeindex <- rep(1,1000) for(i in 2:1000) timeindex[i] <- timeindex[i-1] + sample(1:3,1) result <- hmmsim.cont(n=1000,M=3,prior=prior_init, tpm_parm=omega, emit_parm=emit_init,zeroprop=zero_init,timeindex=timeindex) y <- result\$series fit2 <- fasthmmfit.cont(y,x=NULL,M=3,prior_init,omega, emit_init,0.5,timeindex=timeindex,hessian=FALSE, method="BFGS", control=list(maxit=500,trace=1)) post <- hmmsmooth.cont(y,3,fit2\$prior,fit2\$tpm,fit2\$emit, fit2\$zeroprop,timeindex=timeindex) ```

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