1. Let $X=(X\_{t},\,t \in T)$ be a non-homogeneous, continuous time Markov process with a finite state space $S=\{1,...,K\}$.
2. Let $\alpha\_{i,j}(t)$ be the hazard rates of some $\varGamma$-distributed random variables.



> 
> **My question:** How can I simulate random paths of the Markov process with a transition intensity matrix which is built with the above hazard rates $\alpha\_{i,j}(t)$?
> 
> 
> 


For example:
$S=\{1,2,3,4\}$ with given $\alpha\_{i,j}(t)$ with $i,j \in S$.


Any idea is greatly appreciated.



How to simulate random paths of a non-homogeneous continuous-time Markov process with discrete state space for a given infinitesimal generator matrix?
Suppose you're in state $i$. For each $j$, let $X\_j$ be an independent Exponential random variable with mean 1.


Now solve
$\int\_{0}^{T\_j}\alpha\_{i,j}(t)\ dt=X\_j$ for each $i$. Whichever of the $T\_j$'s is smallest, you jump from state $i$ to state $j$ at time $T\_j$.


