rstochmat {spgs} | R Documentation |
Random Generation of Stochastic Matrices
Description
Randomly generates stochastic matrices.
Usage
rstochmat(n, labels)
Arguments
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
|
Details
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.
Value
An n\times n
stochastic matrix with rows and columns labelled according to ‘labels’.
Author(s)
Andrew Hart and Servet MartÃnez
See Also
rcspr2mat
, estimateMarkovChain
, simulateMarkovChain
Examples
rstochmat(4)
rstochmat(3, c("a", "b", "c"))
rstochmat(labels=c("r", "R"))
[Package spgs version 1.0-4 Index]