Provided any `markovchain`

or `markovchainList`

objects, it returns a sequence of
states coming from the underlying stationary distribution.

1 2 |

`n` |
Sample size |

`object` |
Either a |

`what` |
It specifies whether either a |

`useRCpp` |
Boolean. Should RCpp fast implementation being used? Default is yes. |

`parallel` |
Boolean. Should parallel implementation being used? Default is yes. |

`num.cores` |
Number of Cores to be used |

`...` |
additional parameters passed to the internal sampler |

When a homogeneous process is assumed (`markovchain`

object) a sequence is
sampled of size n. When an non - homogeneous process is assumed,
n samples are taken but the process is assumed to last from the begin to the end of the
non-homogeneous markov process.

Character Vector, data.frame, list or matrix

Check the type of input

Giorgio Spedicato

A First Course in Probability (8th Edition), Sheldon Ross, Prentice Hall 2010

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 | ```
# define the markovchain object
statesNames <- c("a", "b", "c")
mcB <- new("markovchain", states = statesNames,
transitionMatrix = matrix(c(0.2, 0.5, 0.3, 0, 0.2, 0.8, 0.1, 0.8, 0.1),
nrow = 3, byrow = TRUE, dimnames = list(statesNames, statesNames)))
# show the sequence
outs <- rmarkovchain(n = 100, object = mcB, what = "list")
#define markovchainList object
statesNames <- c("a", "b", "c")
mcA <- new("markovchain", states = statesNames, transitionMatrix =
matrix(c(0.2, 0.5, 0.3, 0, 0.2, 0.8, 0.1, 0.8, 0.1), nrow = 3,
byrow = TRUE, dimnames = list(statesNames, statesNames)))
mcB <- new("markovchain", states = statesNames, transitionMatrix =
matrix(c(0.2, 0.5, 0.3, 0, 0.2, 0.8, 0.1, 0.8, 0.1), nrow = 3,
byrow = TRUE, dimnames = list(statesNames, statesNames)))
mcC <- new("markovchain", states = statesNames, transitionMatrix =
matrix(c(0.2, 0.5, 0.3, 0, 0.2, 0.8, 0.1, 0.8, 0.1), nrow = 3,
byrow = TRUE, dimnames = list(statesNames, statesNames)))
mclist <- new("markovchainList", markovchains = list(mcA, mcB, mcC))
# show the list of sequence
rmarkovchain(100, mclist, "list")
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.