sim.mc: Markov chain simulation

Description Usage Arguments Value Author(s) Examples

View source: R/hsmm_functions.R

Description

Simulates a Markov chain

Usage

1
sim.mc(init, transition, N)

Arguments

init

The distribution of states at the first time step

transition

The transition probability matrix of the Markov chain

N

The number of observations to simulate

Value

A vector of integers representing the state sequence.

Author(s)

Jared O'Connell jaredoconnell@gmail.com

Examples

1
2
3
4
5
  p <- matrix(c(.1,.3,.6,rep(1/3,3),0,.5,.5),ncol=3,byrow=TRUE)
  init <- rep(1/3,3)
  sim.mc(init,p,10)  
  
  

jaredo/mhsmm documentation built on Dec. 6, 2019, 11:07 a.m.