Learn R Programming

SciencesPo (version 1.02.12)

plotMC: Plot Markov Chains

Description

A plotting method for markov chains.

Usage

plotMC(reps, prob)

Arguments

reps
the number of replications
prob
the probability matrix

Examples

Run this code
A<-matrix(c(.9,.8,0,0,.1,.2,0,0,0,0,.5,.6,0,0,.5,.4), nrow=4)
 B<-matrix(rep(.3,16), nrow=4); diag(B)<-.1
 C<-matrix(c(.9,0,0,0, .1,.9,0,0 ,0,.1,.8,.1, 0,0,.2,.9), nrow=4)
 D<-matrix(c(.9,0,0,.1,.1,.9,0,0,0,.1,.9,0,0,0,.1,.9), nrow=4)
plotMC(100, B)

Run the code above in your browser using DataLab