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 'gamma'. By default, the path always begins at the first state of the HMM.

Usage

1

Arguments

gamma

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/mixNBHMM

Examples

1
rle(simulateHMM(gamma = matrix(c(0.95,0.05,0.05,0.95),2,2),M = 1e4))

plbaldoni/mixNBHMM documentation built on Dec. 24, 2019, 1:31 p.m.