mc: Generate Markov Chains

Description Usage Arguments Value Author(s) Examples

View source: R/mc.R

Description

Generates a Markov Chain.

Usage

1
  mc(p, n)

Arguments

p

Probability matrix.

n

Number of observations.

Value

x values of observations.

Author(s)

Tyler Hunt tyler@psychoanalytix.com

Examples

1
2
3
4
5
6
7
8
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)
 mc(A, 10)
 mc(B, 10)
 mc(C, 10)
 mc(D, 10)

JackStat/CompPack documentation built on May 7, 2019, 10:16 a.m.