Abstract
A birth-death process is a continuous-time Markov chain that counts the number of particles in a system over time. In the general process with n current particles, a new particle is born with instantaneous rate λn and a particle dies with instantaneous rate μn. Currently no robust and efficient method exists to evaluate the finite-time transition probabilities in a general birth-death process with arbitrary birth and death rates. In this paper, we first revisit the theory of continued fractions to obtain expressions for the Laplace transforms of these transition probabilities and make explicit an important derivation connecting transition probabilities and continued fractions. We then develop an efficient algorithm for computing these probabilities that analyzes the error associated with approximations in the method. We demonstrate that this error-controlled method agrees with known solutions and outperforms previous approaches to computing these probabilities. Finally, we apply our novel method to several important problems in ecology, evolution, and genetics.
Keywords: General birth-death process, Continuous-time Markov chain, Transition probabilities, Population genetics, Ecology, Evolution
1 Introduction
Birth-death processes (BDPs) have a rich history in probabilistic modeling, including applications in ecology, genetics, and evolution (Thorne et al 1991; Krone and Neuhauser 1997; Novozhilov et al 2006). Traditionally, BDPs have been used to model the number of organisms or particles in a system, each of which reproduce and die in continuous time. A general BDP is a continuous-time Markov chain on the non-negative integers in which instantaneous transitions from state n ≥ 0 to either n+1 or n−1 are possible. These transitions are called “births” and “deaths”. Starting at state n, jumps to n + 1 occur with instantaneous rate λn and jumps to n − 1 with instantaneous rate μn. The simplest BDP has linear rates λn = nλ and μn = nμ with no state-independent terms (Kendall 1948; Feller 1971). This model is the most widely-used BDP since there exist closed-form expressions for its transition probabilities (Bailey 1964; Novozhilov et al 2006). Many applications of BDPs require convenient methods for computing the probability Pm,n(t) that the system moves from state m to state n in finite time t ≥ 0. These probabilities exhibit their usefulness in many modeling applications since the probabilities do not depend on the possibly unobserved path taken by the process from m to n and hence make possible analyses of discretely sampled or partially observed processes. Despite the relative simplicity of specifying the rates of a general BDP, it can be remarkably difficult to find closed-form solutions for the transition probabilities even for simple models (Renshaw 1993; Mederer 2003; Novozhilov et al 2006).
In a pioneering series of papers, Karlin and McGregor develop a formal theory of general BDPs that expresses their transition probabilities in terms of a sequence of orthogonal polynomials and a spectral measure (Karlin and McGregor 1957a,b, 1958b). While the work of Karlin and McGregor yields valuable theoretical insights regarding the existence of unique solutions and properties of recurrence and transience for a given process, there remains no clear recipe for determining the orthogonal polynomials and measure corresponding to an arbitrary set of birth and death rates. Additionally, even when the polynomials and measure are known, the transition probabilities may not have an analytic representation or a convenient computational form.
Possibly due to the difficulty of finding computationally useful formulas for transition probabilities in general BDPs, many applied researchers resort to easier analyses using moments, first passage times, equilibrium probabilities, and other tractable quantities of interest. Referring to the system of Kolmogorov forward differential equations for transition probabilities that we give below, Novozhilov et al (2006, page 73) write,
“The problem with exact solutions of system (1) is that, in many cases, the expressions for the state probabilities, although explicit, are intractable for analysis and include special polynomials. In such cases, it may be sensible to solve more modest problems concerning the birth-and-death process under consideration, without the knowledge of the time-dependent behavior of state probabilities pn(t).”
Indeed, closed-form analytic expressions for transition probabilities of general BDPs are only known for a few types of processes. Some examples include constant birth and death rates (Bailey 1964), zero birth or death rates (pure-death and pure-birth) (Yule 1925; Taylor and Karlin 1998), and certain linear rates (Karlin and McGregor 1958a). As a seemingly straightforward example, in the BDP with linear birth and death rates λn = nλ + ν and μn = nμ + γ including state-independent terms, Ismail et al (1988) offer the orthogonal polynomials and associated measure, but still no closed form is available for the transition probabilities.
Despite the difficulty in obtaining analytic expressions, several authors have made progress in approximate numerical methods for solution of transition probabilities in general BDPs. Murphy and O’Donohoe (1975) develop an appealing numerical method for the transition probabilities based on a continued fraction representation of Laplace-transformed transition probabilities. They invert these transformed probabilities by first truncating the continued fraction. Several other authors give similar expressions derived from truncation of the state space (Grassmann 1977b,a; Rosenlund 1978; Sharma and Dass 1988; Mohanty et al 1993). However, Klar et al (2010) find that methods based on continued fraction truncation and then subsequent analytical transformation can suffer from instability. As an alternative, Parthasarathy and Sudhesh (2006a) express the infinite continued fraction representation given by Murphy and O’Donohoe as a power series. Unfortunately, the small radius of convergence of this series makes it less useful for numerical computation.
We also note that for general BDPs that take values on a finite state space (usually n ∈ {0, 1,…, N}), it is possible to write a finite-dimensional stochastic transition rate matrix and solve for the matrix of transition probabilities. If the rate matrix is diagonal-izable, computation of transition probabilities in this manner can be computationally straightforward. To illustrate, let Q be a finite-dimensional stochastic rate matrix with Q = UΛU−1 where U is an orthogonal matrix and Λ is diagonal. The matrix of transition probabilities P satisfies the matrix differential equation P′ = PQ with initial condition P(0) = I. The solution is P(t) = exp[Qt] = U diag(ez1t, ez2t,…, ezNt) U−1, where z1,…, zN are the eigenvalues of Q. However, it is possible to specify reasonable rate parameters in a general BDP that satisfy requirements for the existence of a unique solution, but do not result in a diagonalizable rate matrix. Also, if the state space over which the BDP takes values is large, numerical eigendecomposition of Q may be computationally expensive and could introduce serious roundoff errors.
To our knowledge, no robust computational method currently exists for finding the finite-time transition probabilities of general BDPs with arbitrary rates. Such a technique would allow rapid development of rich and sophisticated ecological, genetic, and evolutionary models. Additionally, in statistical applications, transition probabilities can serve as observed data likelihoods, and are thus often useful in estimating transition rate parameters from partially observed BDPs. We believe more sophisticated BDPs can be very useful for applied researchers. In spite of the numerical difficulties presented by approximant methods, we are surprised that continued fraction methods like that of Murphy and O’Donohoe (1975) are not more widely explored. This may be due to omission of important details in their derivation of continued fraction expressions for the Laplace transform of the transition probabilities.
In this paper, we build on continued fraction expressions for the Laplace transforms of the transition probabilities of a general BDP using techniques similar to those introduced by Murphy and O’Donohoe, and we fill in the missing details in the proof of this representation. We then apply the Laplace inversion formulae of Abate and Whitt (1992a,b) to obtain an efficient and robust method for computation of transition probabilities in general BDPs. Our method relies on three observations: 1) it is possible to find exact expressions for Laplace transforms of the transition probabilities of a general BDP using continued fractions (Murphy and O’Donohoe 1975); 2) evaluation of continued fractions is typically very fast, requires far fewer evaluations than equivalent power series, and there exist robust algorithms for evaluating them efficiently (Bankier and Leighton 1942; Wall 1948; Blanch 1964; Lorentzen and Waadeland 1992; Craviotto et al 1993; Abate and Whitt 1999; Cuyt et al 2008); and 3) recovery of probability distributions by Laplace inversion using a Riemann sum approximation is often more computationally stable than analytical methods of inversion (Abate and Whitt 1992a,b, 1995). Finally, we demonstrate the advantages of our error-controlled method through its application to several birth-death models in ecology, genetics, and evolution whose solution remains unavailable by other means.
2 Transition probabilities
2.1 Background
A general birth-death process is a continuous-time Markov process X = {X(t), t ≥ 0} counting the number of arbitrarily defined “particles” in existence at time t ≥ 0, with X(0) = m ≥ 0. To characterize the process, we define non-negative instantaneous birth rates λn and death rates μn for n ≥ 0, with μ0 = 0 and transition probabilities Pm,n(t) = Pr(X(t) = n | X(0) = m). While λn and μn are time-homogeneous constants, they may depend on n. We refer to the classical linear BDP in which λn = nλ and μn = nμ as the “simple birth-death process” (Kendall 1948; Feller 1971). The general BDP transition probabilities satisfy the infinite system of ordinary differential equations
(1) |
with boundary conditions Pm,m(0) = 1 and Pm,n(0) = 0 for n ≠ m (Feller 1971).
Karlin and McGregor (1957b) show that for arbitrary starting state m, transition probabilities can be represented in the form
(2) |
where π0 = 1 and πn = (λ0 ··· λn−1)/(μ1 ··· μn) for n ≥ 1. Here, {Qn(x)} is a sequence of polynomials satisfying the three-term recurrence relation
(3) |
and ψ is the spectral measure of X with respect to which the polynomials {Qn(x)} are orthogonal. The system (1) has a unique solution if and only if
(4) |
In what follows, we assume that the rate parameters {λn} and {μn} satisfy (4). Closed-form solutions to (1) are available for a surprisingly small number of choices of {λn} and {μn}. We therefore need another approach to find useful formulae for computation of the transition probabilities.
2.2 Continued fraction representation of Laplace transform
To find an expression that is useful for computing Pm,n(t) for an arbitrary general BDP, a fruitful approach is often to Laplace transform each equation of the system (1) and form a recurrence relationship relating back to the Laplace transform of Pm,n(t). We base our presentation on that of Murphy and O’Donohoe (1975). Denote the Laplace transform of Pn,m(t) as
(5) |
Applying the Laplace transform to (1), with the starting state m = 0, we arrive at
(6) |
for n ≥ 1. Rearranging and recalling that P0,0(0) = 1 and P0,n(0) = 0 for n ≥ 1, we simplify (6) to
(7) |
Some rearranging of (7) yields the forward system of recurrence relations
(8) |
Then combining these expressions, we arrive at the generalized continued fraction
(9) |
This is an exact expression for the Laplace transform of the transition probability P0,0(t). Let the partial numerators in (9) be a1 = 1 and an = −λn−2μn−1, and the partial denominators b1 = s + λ0 and bn = s + λn−1 + μn−1 for n ≥ 2. Then (9) becomes
(10) |
To express (10) in more typographically economical notation, we write
(11) |
We denote the kth convergent (approximant) of f0,0(s) as
(12) |
There are deep connections between the orthogonal polynomial representation (3), Laplace transforms (7), and continued fractions of the form (9) that are beyond the scope of this paper (Karlin and McGregor 1957b; Bordes and Roehner 1983; Guillemin and Pinchon 1999). Interestingly, Flajolet and Guillemin (2000) demonstrate a close relationship between the Laplace transforms of transition probabilities and state paths of the underlying Markov chain.
Before stating a theorem supporting this representation, we give two lemmas that will be useful in what follows.
Lemma 1
Both the numerator Ak and denominator Bk of (12) satisfy the same recurrence, due to Wallis (1695):
(13) |
with A0 = 0, A1 = a1, B0 = 1, and B1 = b1.
Lemma 2
By repeated application of Lemma 1, we arrive at the determinant formula
(14) |
Now we state and prove a theorem giving expressions for the Laplace transform of Pm,n(t). Although Murphy and O’Donohoe (1975) first report this result, they do not provide a detailed derivation in their paper.
Theorem 1
The Laplace transform of the transition probability Pm,n(t) is given by
(15) |
where an, bn, and Bn are as defined above.
Proof
Proof To simplify notation, we sometimes omit the dependence of fk, Ak, and Bk on the Laplace variable s. Suppose the process starts at X(0) = m. We can re-write the Laplace-transformed equations (6) with Pm,m(0) = 1 and Pm,n(0) = 0 for all n ≠ m as
(16a) |
(16b) |
where δmn = 1 if m = n and zero otherwise. We first derive the expression for n ≤ m. If m = 0, f0,0(s) is given by (11), so we assume in what follows when n ≤ m, that m ≥ 1. Rearranging (16a), we see that since B0 = 1 and s + λ0 = b1 = B1,
(17) |
Now, to show the general case by induction, assume that for n ≤ m,
(18) |
Substituting (18) into (16b) when n < m, we have
(19) |
(20) |
(21) |
and so (18) is true for any n < m. Letting n = m, we have by (18) and (16b),
(22) |
Recalling that s + λm + μm = bm+1 and using Lemma 1,
(23) |
Rearranging the previous equation, we find that
(24) |
Likewise, we can write (16b) as a continued fraction recurrence:
(25) |
Then plugging (25) into (24) and iterating, we obtain the continued fraction for fm,m:
(26) |
This is an exact formula for the Laplace transform of Pm,m(t), and proves the case m = n. For n ≤ m, we iterate (18) to get
(27) |
Substituting (26) for fm,m completes the proof for n ≤ m.
To find the formula for fm,n when n > m, we adopt a similar approach. From (24) we arrive at
(28) |
We proceed inductively. Assume that for n > m,
(29) |
From (16b), we have
(30) |
Solving for fm,n in (29) and plugging this into the above equation, we have
(31) |
Recalling that −λnμn+1 = an+2,
(32) |
and by Lemma 1,
(33) |
This establishes the recurrence (29). Then for any n ≥ m, we can rearrange (29) to obtain
(34) |
This completes the proof.
2.3 Obtaining transition probabilities
Murphy and O’Donohoe (1975) find transition probabilities by truncating (15) at a pre-specified depth, forming a partial fractions sum, and inverse transforming. Parthasarathy and Sudhesh (2006a) give a series solution for transition probabilities based on an equivalence between continued fractions like (15) and power series. However, both of these approaches suffer from serious drawbacks, as we explore in detail in the Appendix.
We instead seek an efficient and robust numerical method for evaluating and inverting (15). We first note that continued fractions typically converge rapidly, and in our experience, evaluation of (15) is very fast and stable using the Lentz algorithm and its subsequent improvements (Lentz 1976; Thompson and Barnett 1986; Press 2007). We therefore invert (15) numerically by a summation formula.
To do this, we treat the continued fraction representation (15) of the Laplace transform of Pm,n(t) as an unknown but computable function of the complex Laplace variable s. We base our presentation on that of Abate and Whitt (1992a). If ε is a positive real number such that all singularities of fm,n(s) lie to the left of ε in the complex plane, the inverse Laplace transform of fm,n(s) is given by the Bromwich integral
(35) |
Letting s = ε + iu,
(36) |
but Pm,n(t) is real-valued, so the imaginary part of the last equality in (36) is zero.
Then
(37) |
But since Pm,n(t) = 0 for t < 0, we also have that
(38) |
Then applying (38) to (37), we obtain
(39) |
Finally, we note that since
(40) |
it must be the case that Re fm,n(ε + iu) is even in u for every ε. Therefore,
(41) |
Following Abate and Whitt (1992a), we approximate the integral above by a discrete Riemann sum via the trapezoidal rule with step size h:
(42) |
where the second line is obtained by setting h = π/(2t) and ε = A/(2t); this change of variables eliminates the cosine term.
2.4 Numerical considerations
While (42) presents a method for numerical solution of the transition probabilities Pm,n(t) for a BDP with arbitrary birth and death rates, it is not yet an algorithm for reliable evaluation of these probabilities. In order to develop a reliable numerical method, we must: 1) characterize the error introduced by discretization of the integral in (41); 2) determine a suitable method to evaluate this nearly alternating sum while controlling the error; and 3) accurately and rapidly evaluate the infinite continued fraction in (15).
Abate and Whitt show that the discretization error that arises in (42) is
(43) |
and when Pm,n(t) ≤ 1,
(44) |
when e−A is small. Then to obtain ed ≤ 10−γ, we set A = γ log(10). As Abate and Whitt point out, the terms of the series (42) alternate in sign when
(45) |
has constant sign. This suggests that a series acceleration method may be helpful in keeping the terms of the sum manageable and avoiding roundoff error due to summands of alternating sign. We opt to use the Levin transform for this purpose (Levin 1973; Press 2007; Numerical Recipes Software 2007).
Evaluation of rational approximations to continued fractions by repeated application of Lemma 1 is appealing, but suffers from roundoff error when denominators are small (Press 2007). To evaluate the infinite continued fraction in the summand of (42), we use the modified Lentz method (Lentz 1976; Thompson and Barnett 1986; Press 2007). To demonstrate, suppose we wish to approximate the value of f0,0(s), given by (9) by truncating at depth k. Then
(46) |
is the kth rational approximant to the infinite continued fraction f0,0(s). In the modified Lentz method, we stabilize the computation by finding the ratios
(47) |
so that can be found iteratively by
(48) |
Using Lemma 1, we can iteratively compute Ck and Dk via the updates
(49) |
In practice, we must evaluate the continued fraction to only a finite depth, but we must evaluate to a depth sufficient to control the error. Suppose we wish to evaluate the infinite continued fraction f0,0(s) given by (9) at some complex number s. Intuitively, we wish to terminate the Lentz algorithm when the difference between successive convergents is small. However, it is not immediately clear how the difference between convergents is related to the absolute error .Craviotto et al (1993) make this relationship clear by furnishing an a posteriori truncation error bound for Jacobi fractions of the same form as (9) in this paper. Assuming that converges to f0,0(s) as k → ∞, Craviotto et al (1993) give the bound
(50) |
that is valid when Im(s) is nonzero. Note that Bk(s)/Bk−1(s) = 1/Dk(s), so (50) is easy to evaluate during iteration under the Lentz algorithm. Therefore, we stop at depth k in the Lentz algorithm when
(51) |
is small.
2.5 Numerical results
Although our error-controlled method is designed to be used when an analytic solution cannot be found, we seek to validate our numerical results by comparison to available analytic and numerical solutions. For the simple BDP with λn = nλ and μn = nμ, our numerical results agree with the values from the well-known closed-form solution given explicitly in Bailey (1964) as
(52) |
where
(53) |
Murphy and O’Donohoe (1975) give numerical probabilities for four general birth-death models: a) immigration-death with λn = 0.2 and μn = 0.4n; b) immigration-emigration with μn = 0.3, μ0 = 0, and μn = 0.1; c) queue with λn = 0.6, μ0 = 0, μ1 = μ2 = 0.2, μ3 = μ4 = 0.4, and μn = 0.6 for n ≥ 5; and d) λn = 0.4, Our results agree with those computed by Murphy and O’Donohoe for each of the four models given in Tables 2 through 7 in their paper (Murphy and O’Donohoe 1975). We note that Murphy and O’Donohoe did not report probabilities for m > 2 or n > 5 in any of their four models. In our experience, their method performs poorly when n + m + k is greater than approximately 20.
As a demonstration of the instability of the approximant method, we contrast the numerical results given by our error-controlled method with those obtained using the approximant method, that we implemented as described in Murphy and O’Donohoe (1975), except for some rescaling of intermediate quantities to avoid obvious sources of roundoff error. Figure 1 shows this comparison, using model (a) above, for three values of the truncation index k. Note that increasing the truncation depth k in the approximant method does not improve the error.
3 Applications
Drawing on the robustness and generality of our error-controlled method, we conclude with four models in ecology, genetics, and evolution whose analytic solutions remain elusive and where past numerical approaches have fallen short. Using our approach, computation of transition probabilities is straightforward, and the techniques outlined above may be used without modification. Some of the examples are well-known models, and others are novel. In some cases, the orthogonal polynomials satisfying (3) are known, and hence a solution could be numerically computed using (2), provided there are good ways of evaluating the polynomials. Often, a severe drawback of using known orthogonal polynomials to compute a solution based on (2) is that the polynomials are model-specific. This makes experimentation and model selection difficult, since computation of transition probabilities depends on a priori analytic information about the polynomials and measure associated with the BDP. Our method does not rely on a priori information about the process, other than the birth and death rates for each state.
3.1 Immigration and emigration
Consider a population model for the number of organisms in an area, and suppose new immigrants arrive at rate ν, and emigrants leave at rate γ. Organisms living in the area reproduce with per-capita birth rate λ and die with rate μ. Define the linear rates
(54) |
For the case γ = 0, an analytic expression for the orthogonal polynomials is known (Karlin and McGregor 1958a). For nonzero γ, orthogonal polynomials are available from which a solution of the form (2) may be computed (Karlin and McGregor 1958a; Ismail et al 1988). However, using our error-controlled method, we can easily find the transition probabilities without additional analytic information. Figure 2 shows an example of the time-evolution of P10,n(t) for various times t and states n, with the parameters λ = 0.5, ν = 0.2, μ = 0.3, and γ= 0.1. The approximant method method of Murphy and O’Donohoe fails to produce useful probabilities for n > 10 (not shown).
3.2 Logistic growth with Allee effects
Populations of organisms that occupy a finite space may be subject to various constraints on their growth. The per-capita birth rate may decline when there are more organisms than the ecosystem can sustain (Tan and Piantadosi 1991). This can happen when there are too many organisms competing for the same food supply. The decay of population size above some carrying capacity is usually called logistic growth by ecologists. Another density-dependent constraint is known as the Allee effect, in which per-capita birth rate increases superlinearly with n once a small population has been established, due to favorable consequences of density, such as cooperation and mutual protection from predators (Allee et al 1949). As a realistic example of a general BDP that has no obvious solution by orthogonal polynomials, we seek a model that both transiently supports growth above the carrying capacity, and reflects these two density-dependent constraints, similar in spirit to models described by Tan and Piantadosi (1991) and Dennis (2002).
Qualitatively, if the per-capita birth rate with no density effects is λ, then the total birth rate should rise faster than nλ when n is small, slower than nλ for intermediate n near the carrying capacity, and should decay toward zero for n greater than the carrying capacity. Tan and Piantadosi introduce a logistic birth rate for a finite state space model that takes values {0; 1; : : : ;N}. However, to allow for temporary growth beyond the carrying capacity, we choose λn α λn2e−&agr;n for intermediate and large n. To achieve attenuated growth for small n as well, we scale this rate by a logistic function, yielding
(55) |
where M is the population size with highest birth rate, and the death rate is assumed to be proportional only to the number of existing individuals. Figure 3 shows the resulting rates for various states n, with the different phases of population change shaded. To illustrate that the model produces the desired behavior, several realizations of the process are given in the lower panel for various starting values. The shaded regions correspond with the three phases of growth. Note that most paths in the lower panel of Figure 3 center near n = 27, where the birth rate and death rate are equal. The lower panel corresponds with Figure 1 in Dennis (2002). Figure 4 demonstrates the success of the error-controlled method in computing time-dependent extinction probabilities Pm,0 for various starting values with λ = 1, α = 0.2, β = 0.3, M = 20, and μ = 0.1.
3.3 Moran models with mutation and selection
The probability of fixation or extinction of an allele in finite populations is frequently of interest to researchers in genetics. However, publications often rely on the probability of eventual extinction Pm,0(t → ∞), or the probability of fixation of a novel mutation in a population of constant size N, P1,N (t → ∞). While these asymptotic probabilities do reveal important properties of the underlying models, the information they provide about the distribution of time to fixation/extinction is incomplete. In practice, researchers may observe that m organisms in a sample exhibit a certain trait at a certain time. Then Pm,0(t), the probability of extinction of that trait at finite times t in the future should presumably be of great interest, since researchers cannot reliably observe the process for infinitely long times. Additionally, the finite-time probability of fixation/extinction may exhibit threshold effects or unexpected dynamics that are not revealed by the asymptotic probability of such an event.
Moran (1958) introduces a model for the time-evolution of a biallelic locus when the population size is constant through time. A biallelic locus is a location in an organism’s genome in which two different genetic variants or alleles exist in a population. We are interested in how the number of individuals carrying each allele changes from generation to generation. Krone and Neuhauser (1997) exploit the Moran model to derive a BDP counting the number of individuals with a certain allele in the context of ancestral genealogy reconstruction in which one allele offers a selective advantage to individuals that carry it. Selection greatly complicates the problem and remains an active area of research. In a limiting case, this process corresponds to Kingman’s coalescent process when there is no mutation or selection (Kingman 1982a,b).
To construct the Moran process with mutation and selection, suppose a finite population of N haploid organisms has 2 alleles at a certain locus: A1 and A2. Individuals that carry A1 reproduce at rate α and A2 individuals reproduce at rate β. Suppose further that individuals carrying the A1 allele have a selective advantage over individuals carrying A2, so α > β. When an individual dies, it is replaced by the offspring of a random parent chosen from all N individuals, including the one that dies. This parent contributes a gamete carrying its allele that is also subject to mutation. Mutation from A1 to A2 happens with probability u and in reverse with rate υ. The new offspring receives the possibly mutated haplotype and the process continues.
Let X(t) be a BDP counting the number of A1 individuals on the state space n ε {0,…,N}. To construct the transition rates of the process, suppose there are currently n individuals of type A1. We first consider the addition of a new individual of type A1, so that n → n + 1. For this to happen, the individual that dies must be of type A2. If the parent of the replacement is one of the n of type A1, the parent contributes its allele without mutation, and this happens with probability 1 − u. If the parent of the replacement is one of the N − n of type A2, the parent contributes its allele, which then mutates with probability υ. Therefore, the total rate of addition is
(56) |
for n = 0,…,N with λn = 0 when n > N. Likewise, the removal of an individual of type A1 can happen when one of the n individuals of type A1 is chosen for replacement. If the parent of the replacement is one of the N − n of type A2, the parent contributes A2 without mutation, with probability 1 − υ. If the parent is one of the n of type A1, the allele must mutate to A2 with probability u. The total rate of removals becomes
(57) |
for n = 1,…,N with μ0 = λN = 0 and μn = 0 when n > N. Note that if υ > 0, then λ0 > 0 so the A1 allele cannot go extinct. Also, if u > 0, then μN > 0, so the A1 allele cannot be fixed in the population.
Karlin and McGregor (1962) derive the relevant polynomials and measure for the Moran process described above, but without selection, so that α = β. Donnelly (1984) gives expressions for the transition probabilities in the case where α = β = 1, noting that when selection is introduced (via differing α and α), his approach is no longer fruitful. Using our technique, computation of the transition probabilities under selection is straightforward. The upper panel of Figure 5 shows the probability of fixation by time t. The lower panel shows the finite-time fixation probability of A1, Pm,100(t), with u = 0 so the state n = 100 is absorbing.
Since the state space in the Moran model is finite, it is natural to consider the matrix exponentiation method discussed in the Introduction. We write the stochastic transition matrix as
(58) |
where λn and μn are defined by (56) and (57), respectively. In our experience, the matrix exponentiation method often works well, and its computational cost is similar to that of our error-controlled method. However, it is highly sensitive to rate matrix conditioning. For example, Figure 6 shows a comparison of transition probabilities from the error-controlled method and the matrix exponentiation method for the Moran model with N = 100, α = 210, β = 20, u = 0:002, and υ = 0. In evolutionary terms, this means that mutation from A1 to A2 is impossible, and the A2 haplotype suffers from low fitness. Computationally, this has the effect of making μn small for most n, and hence the rate matrix grows ill-conditioned.
Although the rate matrix in this example is nearly defective, this choice of parameter values is not unreasonably extreme. For example, researchers in population genetics often wish to test the hypothesis that selection occurs in a dataset. They fit parameters for models with selection (full model) and without selection (restricted model) and perform a likelihood ratio test of this hypothesis. If the estimates of β and u in the full model are small, they may be unable to reliably compute the probability (likelihood) of the data, given the estimated parameter values under the full model.
3.4 A frameshift-aware indel model
Thorne et al (1991) introduce a BDP modeling insertion and deletion of nucleotides in DNA for applications in molecular evolution. The authors model the process of sequence length evolution by assuming that a new nucleotide can be inserted adjacent to every existing nucleotide, and every existing nucleotide is subject to deletion, at a constant per-nucleotide rate. This corresponds to the simple BDP with λn = nλ and μn = nμ. If a sequence has m nucleotides at time 0 and there are n nucleotides at time t later, the probability of this event is Pm,n(t).
However, an important aspect of biological sequence evolution is conservation of the structure and biophysical properties of proteins that result from transcription and translation of DNA sequences. After coding DNA is transcribed into RNA, ribosomes translate 3-nucleotide chunks (codons) of the RNA into a single amino acid residue, that is then joined to the end of a growing protein polymer. Insertions or deletions (indels) in a DNA sequence that result in a shift in this triplet code are called “frame-shift” mutations. It is likely that a frame-shift indel occurring in a protein-coding DNA sequence results in a protein that is prematurely terminated or possesses structural and chemical characteristics unlike the ancestral protein. Insertions or deletions whose length is a multiple of three should be more common. We seek to model this behavior in a novel way: suppose the indel process is a BDP similar in spirit to the one presented by Thorne et al (1991), and the rate of insertion and deletion of nucleotides depends on the number of nucleotides already inserted, modulo (mod) 3:
(59) |
Here we assume that β2 > β0, β1, and γ1 > γ0, γ2 so that transitions to state n such that n − 1 = 0 mod 3 occur at a faster rate per nucleotide. The linear-periodic nature of these birth and death rates make solution of the orthogonal polynomials and measure corresponding with this BDP difficult. The approximant method of Murphy and O’Donohoe also fails here for large n. However, using our error-controlled method, numerical results are readily available. Figure 7 shows P1,n(t) for n = 0,…,50 at various times t. Note that the distribution of the number of inserted bases has peaks at the integers mod three. Finally, it is worth noting that the dearth of tractable BDPs for indel events has been a major deterrent in statistical sequence alignment and we are actively exploring solutions to this problem using our error-controlled method.
4 Conclusion
Traditionally the simple BDP with linear rates has dominated modeling applications, since its transition probabilities and other quantities of interest find analytic expressions. However, increasingly sophisticated models in ecology, genetics, and evolution, among other fields, may necessitate more advanced computational methods to handle processes whose birth and death rates do not easily yield analytic solutions. We have demonstrated a flexible method for finding transition probabilities of general BDPs that works for arbitrary sets of birth and death rates {λn} and {μn}, and does not require additional analytic information. This should prove useful for rapid development and testing of new models in applications. For simple models whose solution is available, we find that our method agrees with known solutions and remains robust for large starting and ending states and long times t. It is our hope that the method presented here will assist researchers in understanding the properties of increasingly rich and realistic models.
Acknowledgments
We are grateful to Ken Lange for helpful comments. This work was supported by National Institutes of Health grants GM086887 and T32GM008185, and National Science Foundation grant DMS0856099. A software implementation of all methods in this paper is available from FWC.
5 Appendix
5.1 Approximant method
Murphy and O’Donohoe (1975) approximate the inverse Laplace transform of (15) by first truncating the continued fraction as a rational approximant through a partial fractions sum. To illustrate the pitfalls of this approach, we derive the inversion expressions presented by Murphy and O’Donohoe and analyze their properties. We provide an example to show that this technique can become numerically unstable. We first seek to uncover the truncation error in the time domain of the transition probabilities. If we truncate the continued fractions (15) at depth k, we have
(60) |
For concreteness, suppose in what follows that n ≥ m. Note that the denominator of the second equation is simply Bn+k. Let be the numerator of the continued fraction in the second equation in (60), so
(61) |
where satisfies , and
(62) |
Note also that the difference between truncated estimates in the Laplace domain (s) is
(63) |
This yields the generalized determinant formula
(64) |
and at a root si of Bn+k(s), we have
(65) |
Now if s1, s2,…,sn are the roots of Bn(s), we have, using the previous line and a partial fractions decomposition of (60), the formula for the Laplace transform of the transition probability Pm,n(t), truncated at k,
(66) |
since we only require the values of An+k(s) and Bn(s) at the zeros of Bn+k(s). Then inverse transforming, an approximate formula for the transition probability Pm,n(t) is
(67) |
The roots of Bn(s), used in (66) and (67), are often found numerically as follows. Consider the characteristic polynomial det (B̃n + sI) of the matrix
(68) |
It is clear that the nth partial denominator Bn(s) = det(B̃n + sI), and this quantity is zero when −s is an eigenvalue of the matrix B̃n. Therefore, the negatives of the eigenvalues of B̃n are the roots of Bn(s). Furthermore, B̃n can be transformed into a real symmetric matrix via a similarity transform and hence Bn(s) has precisely n roots, all of which are simple, real, and negative. One usually finds these eigenvalues via the QR algorithm or similar numerical techniques (Press 2007). However, the iterative eigendecomposition of (68) generates small errors in the eigenvalues for large n + k. These errors are amplified in the product in the denominator of each summand in (67), resulting in a sum with both positive and negative terms that may be very large. Klar et al (2010) encounter similar instability in this algorithm. Their solution is to find the roots of the terms in the numerator and compute each summand as a product of individual numerators and denominators in an attempt to keep roundoff error in the product from accumulating. So, if z1,…,zn+k are the roots of An+k then (67) becomes
(69) |
This procedure does improve the numerical stability of the computation, but requires two eigendecompositions of possibly large matrices for every evaluation of Pm,n(t), increasing the computational cost and, for large m and n, the roundoff error. In our opinion, it is more advantageous to avoid truncation of the continued fraction (9) at a pre-specified index, and instead evaluate the continued fraction until convergence during numerical inversion. Figure 1 shows how approximant methods fail for large n.
5.2 A power series method
Parthasarathy and Sudhesh (2006a) present exact solutions by transforming continued fractions such as (9) into an equivalent power series. Wall (1948) shows that Jacobi fractions of this type can always be represented by an equivalent power series. However, the small radius of convergence of power series expressions for transition probabilities can limit their usefulness for long times or large birth or death rates. Parthasarathy and Sudhesh show that P0,n(t) has a power series representation given by
(70) |
where
(71) |
with A(0, n) = 1 (Parthasarathy and Sudhesh 2006a,b). Here, a2n = λn and a2n+1 = μn in the notation used in their papers. This approach is unique because it yields an exact analytic expression for the transition probabilities of a general BDP. However, the radius of convergence of the power series depends on the specified rates, and this radius may be quite small. To illustrate the pitfalls of this approach, consider an = (n + 1) λ, corresponding to the BDP with λn = (2n + 1) λ and μn = 2nλ (Parthasarathy and Sudhesh 2006a, Example 4.6). The power series for the transition probability in this process becomes
(72) |
Then the radius of convergence R of the power series is given by
(73) |
And so the series diverges when 2λt > 1. To illustrate the limitations of the power series approach, note that in this process, the transition intensity from 0 to 1 is λ, so the expected first-passage time from 0 to 1 is (T0,1) = 1/λ. Therefore, we cannot evaluate (72) when t is greater than (T0,1)=2. If n is much greater than 1, we may be unable to reliably evaluate P0,n(t) for times near (T0,n).
Contributor Information
Forrest W. Crawford, Email: fcrawford@ucla.edu, Department of Biomathematics, University of California Los Angeles Los Angeles, CA 90095-1766 USA
Marc A. Suchard, Email: msuchard@ucla.edu, Departments of Biomathematics, Biostatistics and Human Genetics, University of California Los Angeles Los Angeles, CA 90095-1766 USA
References
- Abate J, Whitt W. The Fourier-series method for inverting transforms of probability distributions. Queueing Syst. 1992a;10:5–87. [Google Scholar]
- Abate J, Whitt W. Numerical inversion of probability generating functions. Oper Res Lett. 1992b;12:245–251. [Google Scholar]
- Abate J, Whitt W. Numerical inversion of Laplace transforms of probability distributions. ORS J Comput. 1995;7(1):36–43. [Google Scholar]
- Abate J, Whitt W. Computing Laplace transforms for numerical inversion via continued fractions. INFORMS J Comput. 1999;11(4):394–405. [Google Scholar]
- Allee WC, Emerson AE, Park O. Principles of Animal Ecology. Saunders; Philadelphia: 1949. [Google Scholar]
- Bailey NTJ. The Elements of Stochastic Processes with Applications to the Natural Sciences. Wiley; New York: 1964. [Google Scholar]
- Bankier JD, Leighton W. Numerical continued fractions. Am J Math. 1942;64(1):653–668. [Google Scholar]
- Blanch G. Numerical evaluation of continued fractions. SIAM Rev. 1964;6(4):383–421. [Google Scholar]
- Bordes G, Roehner B. Application of stieltjes theory for s-fractions to birth and death processes. Adv Appl Probab. 1983;15(3):507–530. [Google Scholar]
- Craviotto C, Jones WB, Thron WJ. A survey of truncation error analysis for Padé and continued fraction approximants. Acta Appl Math. 1993;33:211–272. [Google Scholar]
- Cuyt A, Petersen V, Verdonk B, Waadeland H, Jones W. Handbook of Continued Fractions for Special Functions. Springer; Berlin/Heidelberg: 2008. [Google Scholar]
- Dennis B. Allee effects in stochastic populations. Oikos. 2002;96(3):389–401. [Google Scholar]
- Donnelly P. The transient behaviour of the Moran model in population genetics. Math Proc Cambridge. 1984;95(02):349–358. [Google Scholar]
- Feller W. Wiley series in probability and mathematical statistics. Wiley; New York: 1971. An Introduction to Probability Theory and its Applications. [Google Scholar]
- Flajolet P, Guillemin F. The formal theory of birth-and-death processes, lattice path combinatorics and continued fractions. Adv Appl Probab. 2000;32(3):750–778. [Google Scholar]
- Grassmann W. Transient solutions in Markovian queues : An algorithm for finding them and determining their waiting-time distributions. Eur J Oper Res. 1977a;1(6):396–402. [Google Scholar]
- Grassmann WK. Transient solutions in Markovian queueing systems. Comput Oper Res. 1977b;4(1):47–53. [Google Scholar]
- Guillemin F, Pinchon D. Excursions of birth and death processes, orthogonal polynomials, and continued fractions. J Appl Probab. 1999;36(3):752–770. [Google Scholar]
- Ismail MEH, Letessier J, Valent G. Linear birth and death models and associated La-guerre and Meixner polynomials. J Approx Theory. 1988;55(3):337–348. [Google Scholar]
- Karlin S, McGregor J. The classification of birth and death processes. Trans Am Math Soc. 1957a;86(2):366–400. [Google Scholar]
- Karlin S, McGregor J. The differential equations of birth-and-death processes, and the Stieltjes moment problem. Trans Am Math Soc. 1957b;85(2):589–646. [Google Scholar]
- Karlin S, McGregor J. Linear growth, birth and death processes. J Math Mech. 1958a;7(4):643–662. [Google Scholar]
- Karlin S, McGregor J. Many server queueing processes with Poisson input and exponential service times. Pacific J Math. 1958b;8(1):87–118. [Google Scholar]
- Karlin S, McGregor J. On a genetics model of Moran. Math Proc Cambridge. 1962;58(02):299–311. [Google Scholar]
- Kendall DG. On the generalized “birth-and-death” process. Ann Math Stat. 1948;19(1):1–15. [Google Scholar]
- Kingman JFC. The coalescent. Stat Proc Appl. 1982a;13(3):235–248. [Google Scholar]
- Kingman JFC. On the genealogy of large populations. J Appl Probab. 1982b;19:27–43. [Google Scholar]
- Klar B, Parthasarathy PR, Henze N. Zipf and Lerch limit of birth and death processes. Probab Eng Inform Sc. 2010;24(01):129–144. [Google Scholar]
- Krone SM, Neuhauser C. Ancestral processes with selection. Theor Popul Biol. 1997;51:210–237. doi: 10.1006/tpbi.1997.1299. [DOI] [PubMed] [Google Scholar]
- Lentz WJ. Generating Bessel functions in Mie scattering calculations using continued fractions. Appl Opt. 1976;15(3):668–671. doi: 10.1364/AO.15.000668. [DOI] [PubMed] [Google Scholar]
- Levin D. Development of non-linear transformations for improving convergence of sequences. Int J Comput Math. 1973;3(B):371–388. [Google Scholar]
- Lorentzen L, Waadeland H. Continued Fractions with Applications. North-Holland, Amsterdam: 1992. [Google Scholar]
- Mederer M. Transient solutions of Markov processes and generalized continued fractions. IMA J Appl Math. 2003;68(1):99–118. [Google Scholar]
- Mohanty S, Montazer-Haghighi A, Trueblood R. On the transient behavior of a finite birth-death process with an application. Comput Oper Res. 1993;20(3):239–248. [Google Scholar]
- Moran PAP. Random processes in genetics. Math Proc Cambridge. 1958;54(01):60–71. [Google Scholar]
- Murphy JA, O’Donohoe MR. Some properties of continued fractions with applications in Markov processes. IMA J Appl Math. 1975;16(1):57–71. [Google Scholar]
- Novozhilov AS, Karev GP, Koonin EV. Biological applications of the theory of birth-and-death processes. Brief Bioinform. 2006;7(1):70–85. doi: 10.1093/bib/bbk006. [DOI] [PubMed] [Google Scholar]
- Numerical Recipes Software. Derivation of the Levin transformation. Numerical recipes webnote No 6 URL. 2007 http://www.nr.com/webnotes?6.
- Parthasarathy PR, Sudhesh R. Exact transient solution of a state-dependent birth-death process. J Appl Math Stoch Anal. 2006a;82(6):1–16. [Google Scholar]
- Parthasarathy PR, Sudhesh R. A formula for the coefficients of orthogonal polynomials from the three-term recurrence relations. Appl Math Lett. 2006b;19(10):1083–1089. [Google Scholar]
- Press WH. Numerical Recipes: the Art of Scientific Computing. Cambridge University Press; New York: 2007. [Google Scholar]
- Renshaw E. Cambridge Studies in Mathematical Biology. Cambridge University Press; 1993. Modelling Biological Populations in Space and Time. [Google Scholar]
- Rosenlund SI. Transition probabilities for a truncated birth-death process. Scand J Stat. 1978;5(2):119–122. [Google Scholar]
- Sharma OP, Dass J. Multi-server Markovian queue with finite waiting space. Sankhya Ser B. 1988;50(3):428–431. [Google Scholar]
- Tan WY, Piantadosi S. On stochastic growth processes with application to stochastic logistic growth. Stat Sinica. 1991;1:527–540. [Google Scholar]
- Taylor H, Karlin S. An Introduction to Stochastic Modeling. Academic Press; San Diego: 1998. [Google Scholar]
- Thompson IJ, Barnett AR. Coulomb and Bessel functions of complex arguments and order. J Comput Phys. 1986;64:490–509. [Google Scholar]
- Thorne J, Kishino H, Felsenstein J. An evolutionary model for maximum likelihood alignment of DNA sequences. J Mol Evol. 1991;33(2):114–124. doi: 10.1007/BF02193625. [DOI] [PubMed] [Google Scholar]
- Wall HS. University Series in Higher Mathematics, D. Van Nostrand Company, Inc; New York: 1948. Analytic Theory of Continued Fractions. [Google Scholar]
- Wallis J. Oxoniae e Theatro Shedoniano. Vol. 1. Georg Olms Verlag; Hildeshein, New York: 1695. Opera Mathematica. 1972. [Google Scholar]
- Yule A mathematical theory of evolution, based on the conclusions of Dr. J. C. Willis, F.R.S. Philos T R Soc Lon B. 1925;213:21–87. [Google Scholar]