rstochmat | R Documentation |
Randomly generates stochastic matrices.
rstochmat(n, labels)
n |
the dimension of the matrix. If n is not specified, it is inferred from the lenth of ‘labels’. |
labels |
a vector of labels for the rows and columns of the matrix. If ‘labels’
is not specified, ‘n’ must be specified and the value
|
Stochastic matrices are non-negative matrices whose rows all sum to unity. This
function uniformly generates samples from the set of n\times n
stochastic matrices.
At least one of the arguments must be specified. The missing argument is infered from the other.
An n\times n
stochastic matrix with rows and columns labelled according to ‘labels’.
Andrew Hart and Servet Martínez
rcspr2mat
, estimateMarkovChain
, simulateMarkovChain
rstochmat(4)
rstochmat(3, c("a", "b", "c"))
rstochmat(labels=c("r", "R"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.