Generating random variates from a distribution of phase type

An algorithm for generating phase type random variates is presented. A phase type distribution is any distribution which may be that of the time until absorption in a finite state Markov process. The exponential sojourn times allow us to record only the number of visits, k, to each state before absorption and then generate appropriate Erlang-k random variates. A related algorithm for the superposition of renewal processes of phase type is also discussed.