simulateHMM: Simulate a hidden Markov model path (HMM)

Description Usage Arguments Value Author(s) References Examples

View source: R/simulateHMM.R

Description

This function simulates a HMM path of size 'm' given a matrix of transition probabilities 'P'. By default, the path always begins at the first state of the HMM.

Usage

1

Arguments

P

a square matrix of transition probabiltiies such that all(rowSums(P)==1) is TRUE

m

length of the HMM path

Value

A vector of integers of length 'm' representing states of the HMM

Author(s)

Pedro L. Baldoni, pedrobaldoni@gmail.com

References

https://github.com/plbaldoni/mixHMM

Examples

1
rle(simulateHMM(P = matrix(c(0.95,0.05,0.05,0.95),2,2),m = 1e4))

plbaldoni/mixHMM documentation built on Nov. 8, 2019, 8:05 p.m.