stateDec: stateDec

Description Usage Arguments Value References Examples

View source: R/stateDec.R

Description

Decodes the states of the Markov chain underlying the observed time series of counts using the Viterbi algorithm. For details, see Zucchini et al. (2016).

Usage

1
stateDec(mod)

Arguments

mod

An object of type countHMM (as returned by the function fitMod).

Value

A vector of Viterbi-decoded states.

References

Zucchini W., MacDonald, I.L., and Langrock, R. (2016): Hidden Markov Models for Time Series: An Introduction Using R, 2nd Edition. Chapman & Hall/CRC. doi:https://doi.org/10.1201/b20790.

Examples

1
2
3
4
5
6
7
# importing example data
x = read.table("http://www.hmms-for-time-series.de/second/data/earthquakes.txt")$V2
# model fitting
lambda = rep(10^4,2)
mod = fitMod(x=x,lambda=lambda)
# decoding the states
stateDec(mod)

countHMM documentation built on May 2, 2019, 1:06 p.m.

Related to stateDec in countHMM...