Description Usage Arguments Examples
This function allows you to estimate transition matrices (probabilities or counts) for up-to-fifth-order discrete Markov chains. For n-order Markov chains with n greater than 1, you can access the estimated transition matrices through nested lists.
1 | TransMatrix(sequence, order = 1, probs = TRUE)
|
sequence |
A vector of integers representing the sequence. The sequence must be in the form of 1,2,3,... |
order |
Integer from 1 to 5. Order of the Markov chain. By default is set to 1. |
probs |
Logical. If TRUE probability matrices are returned, otherwise count matrices are returned. By default is set to TRUE. |
1 2 3 4 5 |
1 2 3 4
1 0.2175732 0.2845188 0.2468619 0.2510460
2 0.2254545 0.3200000 0.2581818 0.1963636
3 0.2460938 0.2578125 0.2539062 0.2421875
4 0.2707424 0.2314410 0.2707424 0.2270742
[[1]]
1 2 3 4
1 9 16 12 15
2 15 22 16 15
3 15 18 15 11
4 16 11 22 11
[[2]]
1 2 3 4
1 11 20 18 13
2 20 24 24 20
3 15 19 19 18
4 15 17 9 13
[[3]]
1 2 3 4
1 16 17 14 16
2 12 25 18 11
3 12 17 16 20
4 14 14 16 18
[[4]]
1 2 3 4
1 16 15 15 16
2 15 17 13 8
3 21 12 15 13
4 16 11 15 10
1 2 3 4
1 0.25 0.2500000 0.0000000 0.5000000
2 0.00 0.6666667 0.3333333 0.0000000
3 0.25 0.5000000 0.0000000 0.2500000
4 0.00 0.2857143 0.1428571 0.5714286
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.