non-homogeneous counting process Consider a  counting process $\{N(t), t\geq 0\}$ where the time distribution between any two consecutive events, say $k$ and $k+1$ has a Poisson rate $\lambda(k)$, which is an explicit function of $k$. I would like to know whether the number of events that happen in a time interval, say  $[0, T]$, has a particular distribution. In general, what we can say about the number of events in time interval $[0, T]$.
 A: $\newcommand\la\lambda$Let $\la_k:=\la(k)$. Let $P_{\la_0,\la_1,\dots}(t,m)$ denote the probability that $N(t)=m$ given the rates $\la_0,\la_1,\dots$. Then, conditioning on the time of the first event, we get the recurrence
$$P_{\la_0,\la_1,\dots}(t,m)
=\int_0^t\la_0\,ds\,e^{-\la_0 s}P_{\la_1,\la_2,\dots}(t-s,m-1)$$
for all real $t>0$ and all natural $m$, with $P_{\la_0,\la_1,\dots}(t,0)=e^{-\la_0 t}$.
One can now check by induction on $m$ that the solution of this recurrence is given by
$$P_{\la_0,\la_1,\dots}(t,m)=(-1)^m \Big(\prod_{j=0}^{m-1}\la_j\Big)
\sum_{j=0}^m \Big(e^{-\la_j t}\Big/\prod_{i\in[[m]]\setminus\{j\}}(\la_j-\la_i)\Big)$$
if the $\la_j$'s are all distinct, where $[[m]]:=\{0,1,\dots,m\}$.
A: Another solution method: Starting with the observation that $(N_t)_{t \geq 0}$ is a birth-process with birth rate $\lambda_k$ if there are $k$ events $(N_t)$ is a (homogeneous) Markov chain in countinuous time with state space $S = \mathbb{N}_n$ and $Q$-matrix $Q = (q_{k\ell} \colon k,\ell \in S)$, where $q_{k,k+1} = \lambda_k$, $q_{kk} = -\lambda_k$ and $q_{k\ell} = 0$ else.
To simplify the problems with infinite state space we can replace here the state space $S$ by $S^{(n)} := \{0,\ldots,n\}$ where $n$ is chosen suffieciently large. Further $Q$ is replaced by $Q^{(n)} = (q^{(n)}_{k\ell} \colon k,\ell \in S^{(n)})$ with $q_{n\ell} = 0$ for each $\ell \in S^{(n)}$. Let $N^{(n)}_t := \min \{N_t,n\}$. Then $N^{(n)} := (N^{(n)}_t)_{t \geq 0}$ is a Markov chain (birth process) again with $Q$-matrix $Q^{(n)}$ and for $T > 0$ and $k < n$ $(e^{Q^{(n)} \cdot T})_{0,k} = \mathbb{P}(N_T = k ~|~ N_0 = 0)$. Fast algorithms for calculating $e^A$, $A$ any finite quadratic matrix, are implemented in Matlab, Octave, $\ldots$. If one chooses $n$ large enough $\mathbb{P}(N_t \geq n ~|~ N_0 = 0)$ can be made arbitrary small.
