simulateMarkovChain | R Documentation |
Simulates a Markov Chain of length 'n' given a matrix of transition probabilities P
simulateMarkovChain(P, n)
P |
a matrix of transition probabilities (row sums should be 1) |
n |
an integer specifying thhe length of the simulated sequence |
#Example
simulateMarkovChain(matrix(c(0.99,0.01,0.01,0.99),2,2),100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.