generateMarkovchain: Generate a sequence of states from a Markov chain.

Description Usage Arguments Value References Examples

View source: R/rewriteFunc.R

Description

Provided any markovchain or markovchainList objects, it returns a sequence of states coming from the underlying stationary distribution.

Usage

1

Arguments

n

integer

mc

mc class

Value

A vector of states names

References

A First Course in Probability (8th Edition), Sheldon Ross, Prentice Hall 2010

markovchain CRAN package

Examples

1
2
3
4
5
6
## The function is currently defined as
#define the Markov chain
statesNames=c("a","b","c")
mcB<-mc.create(matrix(c(0.2,0.5,0.3,0,0.2,0.8,0.1,0.8,0.1),nrow=3, byrow=TRUE, 
	dimnames=list(statesNames,statesNames)), discrete = TRUE,infinite = FALSE)
outs<-generateMarkovchain(n=20,mcB)

qiwei-li/fidcMC documentation built on May 26, 2019, 11:35 a.m.