Description Usage Arguments Author(s) Examples
Print the name, states, dimension and transition matrix of Markov Chain
1 2 3 4 |
x |
the Markov Chain we want to apply |
... |
Arguments to be passed to methods |
Jiexuan Cao, Yuki Liu, Qianhan Zhang
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | dtftmc = mc(states = c("sunny", "cloudy", "rain"),
pijdef = function(i,j,...) {
if (i == 1 && j < 3 ||
i == 2 && j != 2 ||
i == 3 && j > 1) return(0.5)
0
},
name = "Weather")
dtftmc
dtftmc$states
dtftmc$pijdef
pijdeffunction = function(i,j) {
p = 0.3
q = 0.7
r = 0
if (i == 1 && j == 1)
return (1 - p)
if(j == i + 1)
return(p)
if(j == i - 1)
return(q)
if(j==i)
return(r)
return(0)
}
dtiftmc = mc(states = "infinity",
pijdef = pijdeffunction,
name = "death and birth")
dtiftmc
dtiftmc$states
dtiftmc$pijdef
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.