generates random markov matrix with recurrent and transient classes
M=genmarkov(rec,tr)
M=genmarkov(rec,tr,flag)
: :tr integer (number of transient states) : :M real Markov matrix. Sum of entries in each row should add to one. : :flag string ‘perm’. If given, a random permutation of the states
is done.
:
Returns in M a random Markov transition probability matrix with size(rec,1) recurrent classes with rec(1),...rec($) entries respectively and tr transient states.
//P has two recurrent classes (with 2 and 1 states) 2 transient states
P=genmarkov([2,1],2,'perm')
[perm,rec,tr,indsRec,indsT]=`classmarkov`_(P);
P(perm,perm)