<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>genmarkov</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>April 1993</DATE>
  <SHORT_DESCRIPTION name="genmarkov"> generates random markov matrix with recurrent and transient classes</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>M=genmarkov(rec,tr)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>M=genmarkov(rec,tr,flag)  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>rec</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: integer row vector (its dimension is the number of recurrent classes).</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>tr</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: integer (number of transient states)</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>M</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: real Markov matrix. Sum of entries in each row should add to one.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>flag</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: string <VERB>'perm'</VERB>. If given, a random permutation of the states is done.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P>
    Returns in M a random Markov transition probability matrix
    with <VERB>size(rec,1)</VERB> recurrent classes with <VERB>rec(1),...rec($)</VERB> 
    entries respectively and tr transient states.</P>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
//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)
 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>classmarkov</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>eigenmarkov</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>
</MAN>
