Skip to main content

This is a preprint.

It has not yet been peer reviewed by a journal.

The National Library of Medicine is running a pilot to include preprints that result from research funded by NIH in PMC and PubMed.

ArXiv logoLink to ArXiv
[Preprint]. 2025 Jul 8:arXiv:2405.17032v3. Originally published 2024 May 27. [Version 3]

EXACT PHYLODYNAMIC LIKELIHOOD VIA STRUCTURED MARKOV GENEALOGY PROCESSES

AARON A KING 1, QIANYING LIN 2, EDWARD L IONIDES 3
PMCID: PMC11160859  PMID: 38855555

Abstract

We show that each member of a broad class of Markovian population models induces a unique stochastic process on the space of genealogies. We construct this genealogy process and derive exact expressions for the likelihood of an observed genealogy in terms of a filter equation, the structure of which is completely determined by the population model. We show that existing phylodynamic methods based on either the coalescent or the linear birth-death processes are special cases. We derive some properties of filter equations and describe a class of algorithms that can be used to numerically solve them. Our results open the door to statistically efficient likelihood-based phylodynamic inference for a much wider class of models than is currently possible.

1. Introduction

When the genome of an infectious agent accumulates mutations on timescales similar to those of transmission and infection progression, the resulting pattern of differences among genomes contains information on the history of the pathogen’s passage through individual hosts and the host population. As Grenfell et al. (2004) observed, one can extract this information to gain insight into the structure and dynamics of the host-pathogen system. In particular, one can formalize mathematical models of transmission, estimate their parameters, and compare their ability to explain data, following standard statistical paradigms. This collection of tasks is known as phylodynamic inference; Alizon (2024) provides a recent review.

A common approach to phylodynamic inference involves building a mathematical linkage between the tree-like genealogy or phylogeny that expresses the relationships of shared ancestry among sampled genomes and a model of the dynamics of the transmission system. Various linkages are possible, but, to attain maximal statistical efficiency (i.e., lose the least information), it is desirable to be able to compute the likelihood function for models of interest. The likelihood function is the probability density of a given set of data, conditional on a given model, viewed as a function of the parameters of that model. While various kinds of data may be available, we focus here on the case where the data are a set of genomic sequences. Notationally, if the data, S, is a set of genome sequences, Φ a genealogical tree relating these sequences, E a model of sequence evolution, and D a dynamic transmission model, then the full likelihood is

(D,E)=f(SD,E)=f(SΦ,E)f(ΦD)dΦ,

where the integral is taken over all possible genealogies and we somewhat loosely use the symbol f for the various distinct probability densities, the nature of each of which is clear from its arguments. In this expression, f(SΦ,E) is typically the Felsenstein (2004) phylogenetic likelihood. The function f(ΦD), which links the phylogeny to the dynamic model, is the phylodynamic likelihood. In the Bayesian context, the phylodynamic likelihood is sometimes referred to as a tree prior (Möller et al., 2018; Volz & Siveroni, 2018). Its computation has remained out of reach, except in several special cases. This paper presents theory that facilitates its computation for a very broad range of dynamic models.

With few exceptions, existing approaches to the phylodynamic likelihood have been based on one of two mathematical idealizations. The first is the Kingman (1982a) coalescent, by which the likelihood of a given genealogy is computed using a reverse-time argument. This computation provides the exact likelihood for a genealogy resulting from a particular, constant population-size, dynamic model (the Moran model, e.g., Moran, 1958; Kingman, 1982b; Möhle, 2000; King et al., 2020, 2022). Extensions of this approach develop approximate likelihoods for the case when the population size varies as a function of time (Griffiths & Tavaré, 1994; Drummond et al., 2005) or according to an SIR process (Volz et al., 2009; Rasmussen et al., 2011), as long as the population size is large and the sample-fraction remains negligible. The second idealization is the linear birth-death process, for which the likelihood is available in closed form (Stadler, 2010). Linearity in this context amounts to the assumption that distinct lineages do not interact: it is the resulting self-similarity of genealogies that renders the likelihood analytically tractable. Extensions of this approach develop approximations via linearization of nonlinear processes or restriction to scenarios in which population growth is nearly linear (e.g., MacPherson et al., 2021). Although the tractability of these approaches is appealing, concern naturally arises as to validity of the approximations in specific cases, the biases introduced by them, and the amount of information in data left uncaptured by these approximate methods. For this reason, there is interest in improved phylodynamic inference techniques.

What would an ideal phylodynamic inference method look like? First, it would allow us to ask the questions we wish to ask. Since the set of scientifically interesting hypotheses is not contained within the set of statistically convenient models, an ideal phylodynamic inference methodology would put no restrictions on the form of the models that it can accommodate. In particular, since nonlinearity, nonstationarity, noise, and measurement error are prominent and ubiquitous in epidemiology, such a method would accommodate nonlinear, time-inhomogeneous, stochastic transmission models. Moreover, because many of the most scientifically and practically important uncertainties concern heterogeneities in transmission rates and the susceptibility, behavior, age, and location of hosts, it would accommodate host populations structured by these and other factors. Second, it would be both statistically efficient and robust to model misspecification. In particular, it would achieve maximal statistical efficiency by being based on the exact phylodynamic likelihood, which would also facilitate objective comparison among parameterizations and models. At the same time, model predictions would be robust to small deviations from the model assumptions. Finally, an ideal inference method would be computationally efficient. If numerical computations were absolutely required for its use, these would scale well with model complexity and data volume.

Of course, there is no hope for the realization of such an ideal method. In particular, in selecting methodology, one must navigate trade-offs between statistical efficiency and robustness, and between computational expense and fidelity of model to question. With respect to these trade-offs, far more attention has been paid to date on relatively inexpensive approaches that are restricted to models that can only approximate the motivating questions to a greater or lesser extent. The present paper offers a complementary perspective: we develop mathematical expressions, and corresponding numerical algorithms, for the phylodynamic likelihood of almost arbitrarily complex models. Our focus on the exact likelihood offers maximum information capture, even as the computations it involves are somewhat delicate. Numerical examples are postponed to Appendix C, and computational scalability is discussed in §5.

While the theory presented here greatly expands the class of models for which exact likelihood is computable, it is limited to models with discrete structure. Thus, while structuring factors such as age, stage of infection progression, and spatial location are most naturally expressed in terms of continuous variables, to apply the results presented here, one would have to discretize these factors. We suspect that this limitation may often be relatively painless in practice, since discretely structured models have repeatedly proved their value in epidemiology. In particular, compartmental models offer great flexibility and have often been used as approximations when continuous structure leads to uncomfortably high model dimension.

To connect a model at the level of a population with genealogies based on samples taken from individual hosts, it is necessary to make assumptions about the individuals in the population. The simplest such assumption is that the individuals that are identical with respect to the population dynamics are fully statistically identical. That is, that they are exchangeable. In a compartmental model, this is tantamount to the assumption that the residence times of the individuals within each compartment are identically distributed, though not independent. Although exchangeability is indeed an additional assumption, it is so natural that it is frequently unrecognized as such, and one often reads statements to the effect that exchangeability of individuals is a consequence of the Markovian assumption. Nonetheless, since it adds minimal additional structure, it is the natural assumption, and the one we will make in this paper.

From the mathematical point of view, the essential difficulty in determining expressions for the likelihood of a genealogy generated by a given population process is the fact that a genealogy’s structure is determined by events occurring at widely separated times. Existing approaches to phylodynamic inference employ one of a few tricks to get around this non-locality. In particular, both coalescent- and linear birth-death process-based approaches construct arguments in reverse time that depend on restrictions on the form of the population process. The main mathematical contribution of the present paper is to show how one can reformulate the phylodynamic likelihood in such a way that all needed computations are time-localized without placing restrictive assumptions on the population process. In particular, models for which forward simulation is possible but reversal of transition densities is intractable can be treated in this way.

In the following, we take as our starting point a population model in the form of a discretely structured continuoustime Markov process. We show how such a process uniquely induces several stochastic processes in the space of genealogies. We go on to show that exact likelihoods for these genealogies can be computed by solving a filter equation. In particular, for each given population-level model there is a specific filter equation. We then show that our approach generalizes both the coalescent- and linear birth-death-process-based approaches. Indeed, the filter equations for the models on which these approaches are based can be solved to obtain the familiar likelihood formulae. In appendices, we develop the properties of filter equations generally, provide a sequential Monte Carlo algorithm that can be used when numerical integration is needed for their solution, and work out the filter equations and their solutions in two examples.

Code sufficient for the reproduction of all the figures in this paper are freely available for download at https://github.com/kingaa/structured-genealogy-process-paper. An archival version of these will be stored on Zotero upon publication of a peer-reviewed version of this paper. The open-source R package phylopomp (https://github.com/kingaa/phylopomp) implements the simulation and likelihood-computation algorithms employed here.

2. Mathematical preliminaries

2.1. Notation.

Throughout the paper, we will adopt the convention that a bold-face symbol (e.g., X), denotes a random element. We will be concerned with a variety of stochastic processes, in both discrete and continuous time. In both cases, we will use a subscript to indicate the time parameter: e.g., Xt or Gk, where t takes values in the non-negative reals + and k in the non-negative integers +. In the case of continuous-time processes, we will find ourselves needing to refer to their left- or right-limits. Accordingly, if Φt is any random process, let

Φ˜tlimstΦsandΦtlimstΦs.

We will typically assume that the random processes treated here are right-continuous with left limits (i.e., càdlàg, so that Φt=Φt). Note that, in this case, Φ˜t is left-continuous with right limits (càglàd).

If Φt,t+ is a pure jump process, knowledge of its sample path is equivalent to knowledge of the number, Kt, of jumps it has taken as of time t, the jump times Tˆk, and the embedded chain ΦˆkΦTˆk,k=0,,Kt. In particular, if we adopt the convention that Tˆ0=0 and TˆKt+1=t, then Φt=Φˆk for tTˆk,Tˆk+1, k=0,,Kt.

2.2. Population process.

We are motivated by the desire for exact phylodynamic inference methods for as wide a class of epidemiological models as possible. In particular, we would like to be able to formulate and parameterize an arbitrary compartmental model and to quantify its ability to explain data using likelihood. Fig. 1 depicts a few of the simplest such models in order to give a sense of the kinds of complexities that can arise. Of course, with the ability to entertain models with countably many compartments, much greater complexity is possible. In particular, one can model not only complex infection progression, but also strain structure, behavioral structure, age structure, and spatial structure using compartmental models. As is well known, one can discretize continuous structure-variables and employ the linear chain trick to accommodate non-exponential residence times. While the utility of these approximations will vary, a very wide range of model assumptions lie within the scope of the theory presented here.

Figure 1.

Figure 1.

Examples of discretely-structured population models. Demes are shaded. Compartments containing infectious hosts are outlined in green. Curved green lines connect transmission rates with the compartments whose occupancies control their modulation; each such connection gives rise to a nonlinearity in the model. (A) An SEIRS model. Susceptible individuals (S), once infected, enter a transient incubation phase (E) before they become infectious (I). Upon recovery (R), individuals experience immunity from reinfection. If this immunity wanes, they re-enter the susceptible compartment. Pathogen lineages are to be found in hosts within the E and I compartments only. Accordingly, there are two demes: 𝔻={E,I}. If there is exactly one lineage per host, then the occupancy, nXt=nEXt,nIXt, is the integer 2-vector giving the numbers of hosts in the respective compartments. See §2.6 for definition and discussion of demes and deme occupancy. (B) In this four-deme model, two distinct pathogen strains compete for susceptibles. (C) A three-deme model according to which, after an incubation period, hosts may develop asymptomatic infection (IA). If they do not recover, symptomatically infected hosts (IS) can progress to hospitalization (H) and death (D). (D) A three-deme model with heterogeneity in transmission behavior. Contagious individuals move randomly between low-transmission (IL) and high-transmission (IH) behaviors.

We will refer to the stochastic process defined by the given model as the population process. We will assume that the population process is a time-inhomogeneous Markov jump process, Xt,t+, taking values in some space 𝕏. In earlier work (King et al., 2022), we limited ourselves to the case 𝕏=d, but here we assume only that 𝕏 is a complete metric measure space with a countable dense subset. The population process is completely specified by its initial-state density, p0, and its transition rates α. In particular, we suppose that

ProbX0=p0(x)dx (1)

for all measurable sets 𝕏. For any t+,x,x𝕏, we think of the quantity αt,x,x as the instantaneous hazard of a jump from x to x. More precisely, the transition rates have the following properties:

αt,x,x0,𝕏αt,x,xdx<,

for all t+ and x,x𝕏 and that, as a function of time, α is càdlàg and continuous almost everywhere. Henceforth, we understand that integrals are taken over all of 𝕏 unless otherwise specified. Let Kt be the number of jumps that X has taken by time t. We assume that Kt is a simple counting process so that

Prob[Kt+Δ=n+1Kt=n]=Δα(t,x,x)dx+o(Δ),
Prob[Kt+Δ>n+1Kt=n]=o(Δ),
Prob[Xt+Δ{x}Xt=x]=Δ{x}α(t,x,x)dx+o(Δ),
Prob[Xt+Δ=xXt=x]=1Δα(t,x,x)dx+o(Δ).

We further assume that Xt is non-explosive, i.e., that ProbKt<=1 for all t<.

2.3. Kolmogorov equations.

The above may be compactly summarized by stating that if v(t,x) satisfies the Kolmogorov forward equation (KFE),

vt(t,x)=vt,xαt,x,xdxv(t,x)αt,x,xdx,v(0,x)=p0(x), (2)

for t[0,T], then v(t,x)dx=ProbXt for every t[0,T] and measurable 𝕏. Eq. 2 is sometimes called the master equation for Xt. The adjoint form of the KFE is the Kolmogorov backward equation,

Fs(s,x)=αt,x,xFs,xF(s,x)dx,F(T,x)=f(x). (3)

If F satisfies Eq. 3 for s[0,T] and x𝕏, then F(s,x)=𝔼fXTXs=x for all t[0,T] and x𝕏.

2.4. Inclusion of jumps at deterministic times.

For modeling purposes, it is sometimes desirable to insist that certain events occur at specified times. For example, if samples are collected at specific times in such a way that the timing itself conveys no information about the process, one might wish to condition on the sampling time. We can expand the class of population models to allow for this as follows. Suppose that S=s1,s2,,+ is a sequence of times. Let us postulate that, at each of these times, an event occurs at which Xt jumps according to a given probability kernel π. In particular, for any state x𝕏 and measurable 𝕏,πsi,x, is the probability that the jump at time si is to , conditional on X˜si=x. With this notation, the KFE for the process becomes

vt(t,x)=v(t,x)α(t,x,x)dxv(t,x)α(t,x,x)dx,tS, (4)
v(t,x)dx=v˜(t,x)π(t,x,dx)dx,tS. (5)

Note that Eq. 4 is identical to Eq. 2; we call this the regular part of the KFE. We refer to Eq. 5 as the singular part of the KFE. In this notation, πt,x,dx/dx is the density (i.e., Radon-Nikodym derivative) of π with respect to the base measure on 𝕏.

As a matter of notation, one can represent Eqs. 4 and 5 as a single equation in the form of Eq. 2. In particular, if in Eq. 2 we make the substitution

αt,x,xdxαt,x,xdx+sSδ(t,s)πt,x,dx,

we obtain an equation which we can view as shorthand for Eqs. 4 and 5. Here, δ(t,s) is a one-sided Dirac delta function.

2.5. Jump marks.

It will be useful to divide the jumps of the population process Xt into distinct categories which differ with respect to the changes they induce in a genealogy. For this purpose, we let 𝕌 be a countable set of jump marks such that

αt,x,x=u𝕌αut,x,x.

Fig. 2 shows an example for which 𝕌 has five elements. In the following, sums over u are to be taken over the whole of 𝕌 unless otherwise indicated.

Figure 2.

Figure 2.

Markov state transition diagram for the SEIRS model depicted in Fig. 1A. The state, x, is characterized by four numbers, S,E,I, and R. From a given state x, there are five possible kinds of jumps xx. Accordingly, the set, 𝕌, of jump marks has five elements. In the terminology of §3.2, each of these is of a different type: Trans (transmission) is of birth type, Prog (progression) is of migration type, Recov (recovery) is of death type, Sample (sampling) is of sample type, and Wane (loss or waning of immunity) is of neutral type. Note that, in this formulation, when a sampling event occurs, the state does not change.

Let us define the jump mark process, Ut, to be the mark of the latest jump as of time t. As usual, we take the sample paths of Ut to be càdlàg. Observe that Xt and Xt,Ut are Markov processes, but that Ut is not.

2.6. Demes and deme occupancy.

Our first goal in this paper is to show how a given population process induces a stochastic process on the space of genealogies. At each time, this genealogy will represent the relationships of shared ancestry among a population of lineages extant at that time. To accommodate the structure of the population, this population of lineages will itself be subdivided into discrete categories. In particular, we suppose that there are a countable set of subpopulations, within each of which individual lineages are exchangeable. We call these subpopulations demes and let 𝔻 be an index set for them. We note that other authors have used different terminology for the same concept, including “colony”, “type”, “state”, and “population” (Takahata, 1988; Notohara, 1990; Boskova et al., 2014; Volz & Siveroni, 2018; Barido-Sottani et al., 2020; Seidel et al., 2024; Vaughan & Stadler, 2025). Fig. 1 illustrates this concept in the context of several specific models.

We define the deme occupancy function n:𝔻×𝕏+ so that for i𝔻,x𝕏,ni(x) is the number of lineages in deme i when the population is in state x.

2.7. Examples.

The class of population models to which the theory presented here applies is very broad. In particular, it encompasses the entire class of compartmental models with time-dependent flow rates. Here, to give a sense of this breadth, we briefly describe a few models of interest.

SIRS model.

King et al. (2022) developed formulae for the exact likelihood of a genealogy induced by an SIRS model. The theory developed in this paper applies, but since there is only one deme in this model, it is a simple case. In Appendix C, we illustrate the theory by working it out in detail for this model.

SEIRS model.

Modifying the SIRS model by incorporating an incubation period results in the SEIRS model, which has two demes (Fig.1A): 𝔻={E,I}. We can take the state space to be +4: the state x=(S,E,I,R) is defined by the numbers of hosts in each of the four compartments. The deme occupancy function in this case is n(x)=(E,I). In Appendix C, we work out the theory for this model in detail.

Two-strain competition model.

A simple model for the competition of two pathogen strains is depicted in Fig. 1B. In this model, the state vector consists of seven numbers: x=S,E1,E2,I1,I2,R1,R2. There are four demes 𝔻=E1,E2,I1,I2 and the occupancy function is n(x)=E1,E2,I1,I2.

Complex infection progression.

Fig. 1C depicts a model in which infections are heterogeneous with respect to the severity of the disease they engender. There are three demes (𝔻=E,IA,IS). Asymptomatic infections (IA) are unobservable, while symptomatic infections (IS) may develop into hospitalized cases (H) and deaths (D).

Superspreading model.

Compartmental models can be used to capture heterogeneities of various kinds. Fig. 1D depicts a model with behavioral heterogeneity. There are three demes (𝔻=E,IL,IH). Hosts in the low-transmitting IL compartment have fewer contacts than those in the high-transmitting IH compartment, and individuals move between these compartments as they engage in bouts of risky or cautious behavior.

Kingman coalescent and Moran model.

The Kingman (1982a) coalescent is one of the two foundations upon which most existing phylodynamic approaches have been constructed. It is the ancestral process for the Moran model, in which a fixed population of n lineages experiences events at times distributed according to a rate-μ Poisson process. At each such event, an individual lineage selected uniformly at random dies and is replaced by the offspring of a second randomly selected lineage. In §4.3.1, we show that the Kingman coalescent likelihood is a special case of the theory presented in this paper.

Linear birth-death model.

The linear birth-death process, the second basis for widely-used phylodynamic methods, is also a special case of the theory presented here. For this process, we have 𝕏=+ and there is a single deme. Xt represents the size of a population and n(x)=x. In §4.3.2, we derive exact expressions for the likelihood under this model.

2.8. History process.

Consider the Markov process (Xt,Ut). We define its history process, Ht, to be the restriction of the random function sXs,Us to the interval [0,t]. Note that Ht is itself trivially a Markov process, since it contains its own history. Alternatively, one can identify Ht with the sequence Tˆk,Xˆk,Uˆkk=0Kt. In particular, conditional on Ht, both Xt and Ut are deterministic, as are Kt, the embedded chains, Xˆk,Uˆk, and the point process of event times Tˆk. The probability measure on the space of histories can be expressed in terms of these:

ProbdHt=p0Xˆ0dXˆ0k=1KtαUˆkTˆk,Xˆk1,XˆkdXˆkdTˆkexpk=0KtTˆkTˆk+1uαut,Xˆk,xdxdt, (6)

where again, by convention, Tˆ0=0 and TˆKt+1=t.

If H is a potential value of a history process, Ht, we define t(H) to be the right endpoint of its domain and use the notation ev(H)Tˆ1,,TˆKt[0,t(H)] to denote the set of its jump times.

3. Genealogy processes

3.1. Genealogies.

A genealogy, G, encapsulates the relationships of shared ancestry among a set of lineages that are extant at some time t(G)+ and perhaps a set of samples collected at earlier times (Fig. 3). A genealogy has a tree- or forest-like structure, with four distinct kinds of nodes: (i) tip nodes, which represent labeled extant lineages; (ii) internal nodes, which represent events at which lineages diverged and/or moved from one deme to another; (iii) sample nodes, which represent labeled samples; and (iv) root nodes, at the base of each tree. Each node a is associated with a specific time, t(a). In particular, if a is a tip node in G, then t(a)=t(G); if a is a sample node, then t(a)t(G) is the time at which the sample was taken. Moreover, if node a is ancestral to node a, then t(a)ta and tat(a) is the distance between a and a along the genealogy. Without loss of generality we assume that t(a)=0 for all root nodes a. We let ev(G) denote the set of all internal and sample node-times of the genealogy G; we refer to these as genealogical event times.

Figure 3.

Figure 3.

A genealogy, G, specifies the relationships of shared ancestry (via its tree-structure) and deme occupancy histories (via the coloring of its branches) of a set of lineages extant at some time t(G), as well as some samples gathered at earlier times. Here, t(G)=10 and there are two demes, 𝔻={blue, yellow}. Tip nodes, denoting extant lineages, are shown as black dots; sample nodes are shown as blue dots; internal nodes are indicated in green. Note that internal nodes occur not only at branch-points, but also inline (i.e., along branches). Wherever a lineage moves from one deme (color) to another, an internal node occurs; the converse does not necessarily hold.

Importantly, a genealogy informs us not only about the shared ancestry of any pair of lineages, but also about where in the set of demes any given lineage was at all times. Accordingly, we can visualize a genealogy as a graph, the nodes and edges of which are painted with a distinct color for each deme (Fig. 3). Note that a genealogy will in general have branch-point nodes, i.e., internal nodes with more than one descendant, but may also have internal nodes with only one descendant. We refer to such nodes as inline nodes. These occur whenever the color changes along a branch, but can also occur without a color-change.

Formally, we define a genealogy, G, to be a triple, (T,Z,Y), where T=t(G)+ is the genealogy time, Z specifies the genealogy’s tree structure, and Y gives the coloring. In particular, let 𝕃 be a countable set of labels-referring to samples and/or extant lineages—and let partit (𝕃) be the set of all collections of finite, mutually-disjoint subsets of 𝕃. That is, an element zpartit(𝕃) is a partition of the finite set z𝕃. Partition fineness defines a partial order on partit(𝕃). Specifically, for z,zpartit(𝕃), we say zz if and only if for every bz there is bz such that bb. The tree structure of G is a càdlàg map Z:[0,T]partit(𝕃) that is monotone in the sense that t1t2 implies Zt1Zt2. An element bZt is a set of labels; it represents the branch of the tree that bears the corresponding lineages. We use the notation ev(Z) to denote the set of times at which Z is discontinuous. Note that ev(Z) includes the times of all tip, sample, and branch-point nodes, but excludes root and non-sample inline nodes. Therefore, ev(Z)ev(G).

The third element of G specifies the coloring of branches and locations of tip, sample, and internal nodes (including inline nodes). Mathematically, if G=(T,Z,Y), then Y is a càdlàg function that maps each point on the genealogy to a deme and a non-negative integer. In particular, if t[0,T] and a is the label of any tip or sample node, Yt(a)=Ytd(a),Ytm(a)𝔻×+, where Ytd(a) is the deme in which the lineage of a is located at time t and Ytm(a) is the number of internal or sample nodes encountered along the lineage of a in going from time 0 to time t. In particular, Ytm(a) is a simple counting process, with Y0m(a)=0 for all a. Since a,abZt implies Yt(a)=Yta, one can equally well think of Yt as a map Zt𝔻×+. Given a tree Z, we let Y(Z) denote the set of colorings Y that are compatible with Z. We moreover define Yt(Z)YtYY(Z). Formally speaking, Y(Z) is a fiber bundle over Z, each Yt(Z) being a fiber.

It will sometimes be convenient to make use of notation whereby the tree structure of genealogy G is GZ and the coloring is GY, so that G=t(G),GZ,GY.

3.2. Event types.

To see how events in the population process leave a trace in the genealogy, we assume that, at each jump in the population process, a corresponding change occurs in the genealogy, according to whether lineages branch, die, move between demes, or are sampled. For this purpose, there are five distinct pure types of events:

  1. Birth-type events result in the branching of one or more new lineages from an existing lineage. Examples of birth-type events include transmission events, speciations, and actual births. Importantly, we assume that all new lineages arising from a birth event share the same parent and that at most one birth event occurs at a time, almost surely. While it is possible to relax this assumption, the resulting notational complexities are nontrivial, so we postpone consideration of this more general case.

  2. Death-type events result in the extinction of one or more lineages. Examples include recovery from infection, death of a host, and species extinctions. We allow for the possibility that multiple lineages, potentially in multiple demes, die simultaneously.

  3. Migration-type events result in the movement of a lineage from one deme to another. Spatial movements, changes in host age or behavior, and progression of an infection can all be represented as migration-type events. In a migration-type event, one or more lineages within exactly one deme may move simultaneously, and they may move to different demes. Again, while it possible to relax the assumption that exactly one deme is the source of all migrating lineages within any one event, we postpone consideration of this case for the present.

  4. Sample-type events result in the collection of a sample from a lineage. We allow for the possibility that multiple samples are collected simultaneously, though we require that, in this case, each extant lineage is sampled at most once and that all sampled lineages be in the same deme. It is possible to allow for simultaneous sampling of multiple demes but, again, we postpone consideration of this case to ease the exposition.

  5. Neutral-type events result in no change to any of the lineages.

Fig. 2 depicts an example with jumps of all five pure types. It is not necessary that an event be of a pure type; compound events partake of more than one type. For example, a sample/death-type event, in which a lineage is simultaneously sampled and removed, has been employed (Leventhal et al., 2014), as have birth/death events in which one lineage reproduces at the same moment that another dies (e.g., the Moran (1958) process). In combining the pure types, the main restriction is that, at any compound event, all parent lineages must be drawn from the same deme. Beyond this, the theory presented here places few restrictions on the complexity of the events that can occur by combining events of the various pure types.

3.3. Genealogy process.

We now show how a given population process induces a stochastic process, Gt, on the space of genealogies. In the case of unstructured population processes (i.e., those having a single deme), King et al. (2022) gave a related construction that is equivalent to the one presented here.

At each jump in the population process, a change is made to the genealogy, according to the mark, u, of the jump (Fig. 4). In particular:

Figure 4.

Figure 4.

Event types differ by their effects on the genealogy. This can be seen by examining the local structure of the genealogy in the neighborhood of a jump. (A) A birth-type jump results in the branching of one or more child lineages from the parent. There can be only one parent, though the demes of the child lineages may differ from that of their parent. Here, a parent of the blue deme sires one child lineage in each of the blue and yellow demes. The production of an event is an integer vector, with one entry for each deme. The production of this event is therefore r=rblue,ryellow=(2,1). The deme occupancy of an event is the number of lineages in each deme just to the right of the event. The deme occupancy at this event is therefore n=nblue,nyellow=(3,5). (B) A death-type event causes the extinction of a lineage. Since internal nodes without children are recursively removed, the affected branch is dropped. The production of this event is r=(0,0) and the deme occupancy is n=(3,4). (C) A migration-type event results in the movement of one or more lineages from one deme to another. Here, one lineage moves from the yellow to the blue deme. The production of this event is r=(1,0), i.e., the production is 1 for the blue deme and 0 for the yellow. The deme occupancy is n=(6,2). (D) In a sample-type event, one or more sample nodes (blue circles) are inserted. Here, there are two samples, one in each of the blue and yellow demes. Accordingly, r=(1,1) and n=(2,6). (E) A neutral-type event has no effect on the genealogy and zero production in all demes: r=(0,0),n=(5,3). (F) The theory presented here allows for compound events. As an example, here a birth/death-type event occurs, wherein one yellow lineage is extinguished and a blue lineage simultaneously sires a blue child. For this event, we have r=(2,0) and n=(6,2). (G) Here, a compound sample/death-type event with r=(0,0) and n=(2,5) occurs. A blue lineage is sampled and simultaneously extinguished. Note that recursive removal does not occur, since sample nodes are never removed. (H) A compound birth/migration-type event with r=(4,0) and n=(6,2).

  1. If u is of birth-type (Fig. 4A), it results in the creation of one new internal node, call it b. A tip node, a, of the appropriate deme is chosen with uniform probability from among those present and b is inserted so that its ancestor is that of a, while a takes b as its ancestor. One new tip node, of the appropriate deme, is created for each of the children, all of which take b as their immediate ancestor.

  2. If u is of death-type (Fig. 4B), one or more tip nodes of the appropriate demes are selected with uniform probability from among those present. These are deleted. Next, non-sample internal nodes without children are recursively removed. Sample nodes are never removed.

  3. At a migration-type event (Fig. 4C), the appropriate number of migrating lineages are selected at random with uniform probability, from among those present in the appropriate deme. For each selected lineage, one new branch node is inserted between the selected tip node and its ancestor. The color of the descendant branch changes accordingly.

  4. At a sample-type event (Fig. 4D), the appropriate number of sampled lineages are selected at random from among the tip nodes, with uniform probability according to deme. One new sample node is introduced for each selected lineage: each is inserted between a selected tip node and its ancestor.

  5. At a neutral-type event (Fig. 4E), no change is made to the genealogy.

  6. Finally, events of compound type (e.g., Fig. 4FH) are accommodated by combining the foregoing rules.

In each of these events, the new node or nodes that are introduced have node-times equal to the time of the jump.

3.3.1. Emergent lineages and production.

At each event, the lineages which descend from a node inserted at that event are said to emerge from the event. Thus, after a birth-type event, the emerging lineages include all the new offspring as well as the parent. Likewise, at pure migration- or sample-type events, each migrating or sampled lineage emerges from the event. At pure death-type events, no lineages emerge. In general, at an event of mark u, there are riu emergent lineages in deme i. We require that riu be a constant, for each u and i. Thus there is a function r:𝕌×𝔻+, such that riu lineages of deme i emerge from each event of mark u. Since, in applications, one is free to expand the set of jump-marks 𝕌 as needed, this is not a restriction on the models that the theory can accommodate. We say ruriui𝔻 is the production of an event of mark u. Note that the lineages that die as a result of an event do not count in the production but that a parent lineage that survives the event does count.

3.3.2. Conditional independence and exchangeability.

Application of these rules at each jump of Xt constructs a chain of genealogies Gˆk. In particular, at each jump-time Tˆk, the genealogy Gˆk1 is modified according to the jump-mark Uˆk to yield Gˆk. We view Gˆk,k=0,1,2,, as the embedded chain of the continuous-time genealogy process Gt. It is very important to note that, conditional on (Xˆk,Uˆk), the number of parents and number of offspring in each deme is determined and the random choice of which lineages die, migrate, are sampled, or sire offspring is independent of these choices at any other times and independent of (Xˆj,Uˆj) for all jk. Moreover, by assumption, the lineages within each deme are exchangeable: any lineage within a deme is as likely as any other lineage in that deme to be selected as a parent or for death, sampling, or migration. Finally, note that Gt does not have the Markov property, though Xt,Ut,Gt and Xt,Gt do. In passing, we observe that, if instead of dropping tip nodes at death events we were to retain them as we do samples, the resulting genealogy—which we might call the complete genealogy—would have the Markov property.

3.4. Pruned and obscured genealogies.

The process just described yields a genealogy that relates all extant members of the population, and all samples. Moreover, it details each lineage’s complete history of movement through the various demes. However, the data we ultimately wish to analyze will be based only on samples. Nor, in general, will the histories of deme occupancy be observable. A generative model must account for this loss of information. We therefore now describe how genealogies are pruned to yield sample-only genealogies and then obscured via the erasure of color from their branches (Fig. 5).

Figure 5.

Figure 5.

Unpruned, pruned, and obscured genealogies from a single realization of the genealogy process induced by the SEIRS model depicted in Figs. 1 and 2. (A) A realization of the unpruned genealogy process Gt is shown at t=10. Tip nodes, corresponding to lineages alive at time t=10 are indicated with black points. Blue points represent samples; green points, internal nodes. Branches are colored according to the deme in which the corresponding lineage resided at that point in time: blue denotes E and yellow, I. (B) The genealogy is pruned by deleting all tip nodes and then recursively pruning away childless internal nodes. Sample nodes are never removed. (C) A pruned genealogy is obscured by effacing all deme information from lineage histories: the colors are erased, as are all inline nodes. See the text (§§3.1, 3.4.1, and 3.4.4) for more detail.

3.4.1. Pruned genealogy.

Given a genealogy G, one obtains the pruned genealogy, P=prune(G) by first dropping every tip node and then recursively dropping every childless internal node (Fig. 5AB). In a pruned genealogy only internal and sample nodes remain, and sample nodes are found at all of the leaves and possibly some of the interior nodes of the genealogy. Observe that a pruned genealogy is a colored genealogy: it retains information about where among the demes each of its lineages was through time (Fig. 5B). Note also that a pruned genealogy P is characterized by its time, t(P) and the functions PY and PZ just as an unpruned genealogy is. Crucially, since it contains within itself all of its past history, the pruned genealogy process Pt=pruneGt is Markov, even though the unpruned genealogy process, Gt, is not.

3.4.2. Lineage count and saturation.

In the following, we will find that we need to count the deme-specific numbers of lineages present in a given pruned genealogy at a given time. Accordingly, suppose P=(T,Z,Y) is a pruned genealogy and suppose t[0,T]. Let i denote the number of lineages in deme i at time t and ii𝔻+𝔻. Clearly, depends only Yt. Therefore, we can define as a function such that, whenever P=(T,Z,Y) is a pruned genealogy, Yt is the vector of deme-specific lineage counts at time t. We refer to as the lineage-count function (cf. Fig. 6).

Figure 6. Lineage count and saturation.

Figure 6.

Each panel shows the neighborhood of a single event in the unpruned genealogy (top row) and the corresponding pruned genealogy (bottom row). Pruning consists of the removal of all branches that are not ancestral to some sample. In the bottom row of panels, pruned branches are indicated using broken lines. (A) A birthtype event with production r=rblue,ryellow=(1,1) occurs. (B) Suppose that pruning results in the removal of the dashed lineages. Then the lineage count at this event-time is =blue,yellow=(2,2). The saturation is s=(0,1) since only a single, yellow lineage emerges from the event. (C) A migration-type event with production r=(0,1) occurs. (D) After pruning, =(2,2) and s=(0,1). (E) A sample-type event occurs in which two blue lineages are sampled (production =(2,0)). (F) After pruning, =(2,2) and s=(1,0). Observe that in panels B and D, the local structures of the pruned genealogies are identical, though they arise from events of different type.

We will also have occasion to refer to the deme-specific number of lineages emerging from a given event. In particular, given a node time t in a pruned genealogy P=(T,Y,Z), the number si of lineages of deme i emerging from all nodes with time t is well defined and we can write ssii𝔻. Like the lineage-count function, s depends only on the local structure of P. However, s depends not only on Yt, but also on Y˜t. Thus, we can define the saturation function such that, whenever P=(T,Y,Z) is a pruned genealogy, sY˜t,Yt is the integer vector of deme-specific numbers of emerging lineages at time t. Fig. 6 illustrates.

3.4.3. Compatibility.

Suppose P is a pruned genealogy, with t(P)=T and t[0,T]. The local structure of P at t is, in general, compatible with only a subset of the possible jumps 𝕌. For example, if there is a branch node or a sample node at t, then it is compatible only with birth-type or sample-type jumps, respectively. Similarly, if a lineage moves from deme i to deme i at t, then u must be either of ii migration type or of a birth type with parent in i and riu>0. To succinctly accommodate all possibilities, let us introduce the indicator function Q such that Q=1 if the local genealogy structure—which is captured by the values of PY just before and at t—is compatible with an event of type u and Q=0 otherwise. That is, Quy,y=1 if and only if there is a feasible genealogy, G=(T,Z,Y), and history, H, and a t[0,T] such that, given GT=G and HT=H, we have Ut=u,Y˜t=y, and Yt=y. We refer to Q as the compatibility indicator.

3.4.4. Obscured genealogy.

The obscured genealogy is obtained by discarding all information about demes and events not visible from the topology of the tree alone (Fig. 5BC). In particular, if P=(T,Z,Y) is a pruned genealogy, we write obs(P)=(T,Z) to denote the obscured genealogy.

3.5. Binomial ratio.

The statement of the theorems to come is made easier with the following definition. For n,r,,s+𝔻, we define the binomial ratio

nrsΠi𝔻niirisiΠi𝔻niri,ifinii,risi0,0,otherwise.

where ab=a!b!(ab)! is the binomial coefficient. Observe that nrs[0,1]. Moreover, in consequence of the Chu-Vandermonde identity, we have

s+𝔻nrss=1,

whenever nii,ri0 for all i.

4. Results

4.1. Likelihood for pruned genealogies.

Our first result will be an expression for the likelihood of a given pruned genealogy given the history of the population process.

Theorem 1. Suppose P=(T,Z,Y) is a given pruned genealogy. Define

ϕux,y,yn(x)yrusy,yQuy,y, (7)

where n is the deme occupancy (§2.6), ru is the production (§3.3.1), and s are the lineage-count and saturation functions, respectively (§3.4.2), Q is the compatibility indicator (§3.4.3), and the binomial ratio is as defined in §3.5. Then

ProbPT=PHT=H=𝟙{ev(H)ev(P)}tev(H)ϕUtXt,Y˜t,Yt.

The proof is given in Appendix A.

Next, we show how the likelihood of a pruned genealogy, unconditional on the history, can be computed. For this, we use the filter equation technology developed in Appendix B. In particular, the following theorem follows immediately from Theorem 1 and Lemma B2.

Theorem 2. Suppose that P=(T,Z,Y) is a given pruned genealogy. Suppose that w=w(t,x) is càdlàg in t and satisfies the initial condition w(0,x)=p0(x) and the filter equation

wt(t,x)=Σuwt,xαut,x,xϕux,Y˜t,YtdxΣuw(t,x)αut,x,xdx,tev(P),w(t,x)=Σuw˜t,xαut,x,xϕux,Y˜t,Ytdx,tev(P), (8)

where ϕ is defined in Eq. 7. Then the likelihood of P is

=w(T,x)dx.

Alternatively, one can express the likelihood of a pruned genealogy using the adjoint form of the filter equation (see Appendix B.3).

Corollary 3. If P=(T,Z,Y) is a given pruned genealogy and F=F(s,x) is càglàd in s and satisfies the final condition F(T,x)=1 and the adjoint filter equation

Fs(s,x)=Σuα˜u(s,x,x)[ϕu(x,Ys,Ys)F(s,x)F(s,x)]dx,sev(P),F(s,x)=Σuαu(s,x,x)ϕu(x,Ys,Ys)F(s,x)dx,sev(P), (9)

where 0sT and ϕ is defined in Eq. 7, then the likelihood of P is

=F(0,x)p0(x)dx.

Remark 1. Note that the likelihood given by the foregoing expressions is the likelihood of a given genealogy in which the samples are ordered and that, while this order should be compatible with time-ordering, it may not be completely determined by it. In particular, if n samples are taken at one time, there are n! possible orderings of the samples, each of which has an identical likelihood. In consequence, the likelihood given above will differ by a factor of n! from the likelihood computed ignoring ordering of samples. From the standpoint of parameter estimation, this is immaterial, since factors that depend only on the data drop out of the score function. This consideration is relevant, however, in the context of model comparison.

4.2. Likelihood for obscured genealogies.

Our next result concerns the likelihood of a given obscured genealogy conditional on the history.

Theorem 4. Suppose that (T,Z) is a given obscured genealogy. Let q and π be probability kernels, such that for all x𝕏 and yY0(Z),

q(x,y)0,yY0(Z)q(x,y)=1,

and, for all u𝕌,t+,x,x𝕏,y,yYt(Z),

πut,x,x,y,y0,yYt(Z)πut,x,x,y,y=1.

Suppose moreover that πut,x,x,y,y>0 whenever αut,x,xQuy,y>0 and that q(x,y)>0 whenever ProbP0Y=yX0=x>0. Then there is a stochastic jump process yt with sample paths in Y(Z) such that Xt,Ut,yt is Markov and

ProbPTZ=ZHT=H=𝟙{ev(H)ev(Z)}𝔼1qX0,y0tev(H)ϕUtXt,y˜t,ytπUtt,X˜t,Xt,y˜t,yt,

where ϕ is defined in Eq. 7 and the expectation is taken over the sample paths of yt.

Proof. First, observe that, since obs is a deterministic operator,

ProbPTZ=ZHT=H=𝔼𝟙PTZ=ZHT=H. (10)

Our strategy will be to evaluate Eq. 10 using a change of measure: we will propose pruned genealogies compatible with Z as sample paths from a stochastic process driven by Xt and evaluate the the expectation in Eq. 10 by a suitably weighted expectation over these paths. Conditional on HT=H, the initial distribution q and probability kernel π generate a Markov chain, yˆk such that

Probyˆ0HT=H=qX0,yˆ0,Probyˆkyˆk1,HT=H=πUˆkTˆk,Xˆk1,Xˆk,yˆk1,yˆk.

The required process yt is the unique càdlàg process with event times Tˆk and yˆk as its embedded chain. This construction of yt obviously guarantees that ev(H)ev(y)ev(Z) and that Xt,Ut,yt is Markov.

Now, for yY(Z), let us define C(y)=(T,Z,y). Then, by construction, obs (C(y))=(T,Z) and, conversely, for every pruned genealogy P satisfying t(P)=T and PZ=Z,CPY=P. Moreover, the conditions on the kernels q and π guarantee that, if ProbPT=PHT=H>0 and PZ=Z, then Proby=PYHT=H>0. We therefore have that

ProbPTZ=ZHT=H=𝔼ProbPT=C(y)HT=Hπ(yH),

the expectation being taken with respect to the random process y. Here, by definition,

π(yH)=qX0,y0tev(H)πUtt,X˜t,Xt,y˜t,yt.

The result then follows from Theorem 1.

Note that, since Yt(Z) is finite, it is permissible, for example, to choose q and π to be uniform.

The final result shows how to compute the likelihood of an obscured genealogy. It is an immediate consequence of Theorem 4 and Lemma B2.

Theorem 5. Let V=(T,Z) be a given obscured genealogy. Then there are probability kernels q and π as in Theorem 4 such that if

βut,x,x,y,y=αut,x,xπut,x,x,y,y,Ψut,x,x,y,y=ϕux,y,yπut,x,x,y,y,

and if w=w(t,x,y) satisfies the initial condition w(0,x,y)=p0(x)𝟙{q(x,y)>0} and the filter equation

wt=Σuywt,x,yβut,x,x,y,yΨut,x,x,y,ydxΣuyw(t,x,y)βut,x,x,y,ydx,tev(Z),w(t,x,y)=Σuyw˜t,x,yβut,x,x,y,yΨut,x,x,y,ydx,tev(Z),

then the likelihood of V is

=yYT(Z)w(T,x,y)dx.

Lemma B3 shows how this can be computed via sequential Monte Carlo. As before, there is also an adjoint form of Theorem 5, to wit:

Corollary 6. Let V=(T,Z) be a given obscured genealogy and let β and Ψ be defined as in Theorem 5. Suppose F is càglàd and satisfies the final condition F(T,x,y)=1 for all x𝕏,yYT(Z) and also the adjoint filter equation

Fs=Σuyβ˜u(s,x,x,y,y)[Ψu(s,x,x,y,y)F(s,x,y)F(s,x,y)]dx,sev(Z),F(s,x,y)=Σuyβu(s,x,x,y,y)Ψu(s,x,x,y,y)F˜(s,x,y)dx,sev(Z),

for 0sT. Then the likelihood of V is

=yY0(Z)F(0,x,y)p0(x)dx.

4.3. Special cases.

4.3.1. Moran model and the Kingman coalescent.

In the Moran model (Moran, 1958; King et al., 2020), events occur according to a rate μ Poisson process. At each event, a compound birth-death jump occurs so that the population size, n, remains constant (cf. Fig. 4F). If we let Xt be the number of events that have occurred by time t, then Xt is a simple counting process, which we can use to define the state of the population process. Its KFE is then

vt=μv(t,x1)μv(t,x),v(0,x)=1,x=0,0,x>0.

Since there is only a single deme, and since nothing depends on the state, in writing the corresponding filter equation (Theorem 5), we can take w to be independent of both x and y.

In the classical case (Kingman, 1982a), m samples are taken simultaneously at a single time, T. Then, if B is the set of branch-times and (t) is the number of lineages in the genealogy at time t, upon summing over x and y, the filter equation reads

w(0)=1,wt=μw(t)1((t)2)(n2)μw(t),tB,w(t)=μ(n2)w˜(t),tB. (11)

Integrating Eqs. 11 and taking logarithms yields

log=|B|logμ(n2)μ(n2)i=1mi2si, (12)

where the si𝟙{(t)=i}dt are the durations of the coalescent intervals, i.e., intervals between successive branch-points. We recognize Eq. 12 as the expression for the Kingman (1982a) coalescent likelihood (e.g., Wakeley, 2009).

More generally, if in addition samples are taken according to a rate-ψ Poisson process such that the set of sample-times in the genealogy is S=S0S1, where S0,S1 are the sets of times of terminal and inline samples, respectively, then the filter equation reads

w(0)=1,wt=μ((t)2)(n2)w(t),tSB,w(t)w˜(t)=μ(n2),tB,ψ1(t)n,tS0,ψn,tS1. (13)

Integrating Eqs. 13 yields

log|S|logψ=tS0log1(t)nS1logn+|B|logμ(n2)μ(n2)i=1i2si, (14)

in agreement with the result of the very different derivation of King et al. (2020).

4.3.2. Linear birth-death model.

In this model, the state variable, Xt, is the size of a population at time t. All individuals face the same per-capita birth and death rates, which are λ and μ, respectively. Accordingly, the Kolmogorov backward equation for this model is

Fs=λx[F(s,x+1)F(s,x)]+μx[F(s,x1)F(s,x)].

Stadler (2010) considered the case where samples are taken through time at a uniform per-capita rate ψ and lineages extant at time T are sampled with probability ρ. Let B denote the set of branch-times in an observed genealogy, let S0 and S1 be, respectively, the sets of terminal and inline sample times prior to time T, and suppose n lineages are sampled at time T. Since there is only a single deme, and since nothing depends on the genealogy coloring, in writing the corresponding filter equation, we can apply Corollary 6 and take F to be independent of y. After summing over y, the regular part of the adjoint filter equation then reads

Fs(s,x)=λx1((s)2)(x+12)F(s,x+1)+μxF(s,x1)(λ+μ+ψ)xF(s,x), (15)

which holds for x(s) and sBS0S1{T}. The singular part is

F(s,x)=2λx+1F(s,x+1),sB,ψ(x(s))F(s,x),sS0,ψF(s,x),sS1,xn(1ρ)xnρn,s=T. (16)

We note that F(s,x)=0 when x<(s). Let us make the ansatz

F(s,x)=C(s)G(s)x˜(s)H(s)˜(s)K(x,˜(s)), (17)

where G,H are smooth functions and C is càglàd and piecewise constant, with discontinuities only at genealogical events, so that

F(s,x)=C(s)G(s)x(s)H(s)(s)K(x,(s)).

Putting these into the first three cases of Eq. 16 yields conditions on C and K that are satisfied when

K(x,)=x!(x)!andC(s)C(s)=2λH(s),sB,ψG(s)H(s)1,sS0,ψ,sS1.

To satisfy the last case of Eq. 16, we note that ˜(T)=n and therefore impose the conditions

G(T)=1ρ,H(T)=1,C(T)=ρnn!. (18)

Finally, upon substituting the ansatz into Eq. 15, we obtain for sBS0S1{T},

1FFs=(x)GGHH=λx(1(2)(x+12))x+1x+1G+μxxxG1(λ+μ+ψ)x=λ(x+)G+μ(x)G1(λ+μ+ψ)x.

If this is to hold for all x and , we must have

GG=λG+μG1(λ+μ+ψ),HH=2λG(λ+μ+ψ). (19)

In passing, we note that Eqs. 19 are central to the original derivation of Stadler (2010). Eqs. 18 and 19 form a final-value problem that can be solved by elementary means to obtain closed-form expressions for G(s) and H(s). Corollary 6 then states that =F(0,x)p0(x)dx. In particular, conditional on X0=x, we have

=x!(x(0))!ρnn!G(0)x(0)H(0)(0)ψS1eB(2λH(e))eS0ψG(e)H(e)1. (20)

Stadler (2010, Thm. 3.5) derives an expression for this quantity in the special case x=(0)=1, which is equivalent up to the factor of n! explained in Remark 1.

The foregoing represents an independent verification of the correctness of the theory in the case of the simple linear birth-death process with constant sampling through time and one bulk-sampling event. It should be clear, however, that even within the context of the unstructured, linear, birth-death process, the theory presented here readily accommodates complexities such as time-varying sampling rates, multiple bulk-sampling events at specified or random times, and time-varying birth and death rates.

5. Discussion

The theory presented here represents a generalization of the existing coalescent and birth-death-process approaches to phylodynamic inference. Importantly, because it allows computation of the likelihood via strictly forward-in-time computations, it permits consideration of models for which time-reversal arguments are not available. Moreover, inasmuch as the formulae of Theorem 5 can be efficiently computed via sequential Monte Carlo, explicit expressions for transition probabilities are not needed: it is sufficient to be able to simulate from the population process. This feature of the algorithms—known as the plug-and-play property (He et al., 2010)—further expands the class of population models that can be confronted with data.

In particular, the theory gives us the freedom to choose models with many demes. For deterministic population models, Volz (2012) and Rasmussen et al. (2014) showed how one could accommodate discrete population structure. Their procedures involve solving a large number of differential equations backward in time, relying on the time-reversibility of deterministic dynamics. In general, this time-reversibility is not available for stochastic processes.

Some existing methods put rather severe limits on the form of the sampling model and, as Volz & Frost (2014) pointed out, misspecification of the sampling model can lead to large inferential biases. With the theory presented here, essentially arbitrary specification of the sampling model is possible. In particular, one can posit sampling at a rate which is an arbitrary function of time and state and include discrete sampling events as well. It is also possible to condition on the existence of samples.

If sequential Monte Carlo algorithms are used to compute the likelihoods of Theorem 5, then it is straightforward to simultaneously assimilate information from both time-series and genealogical data. One can therefore supplement traditional incidence, disease, or mortality time series with genealogical data to improve inference.

A limitation of the theory is that the population models are assumed to be pure jump processes, which allows consideration of demographic stochasticity and environmental stochasticity modeled by jumps involving multiple individuals (Bretó & Ionides, 2011), but disallows stochastic processes with a diffusive component. However, we anticipate that it will be possible to incorporate the full range of Markovian environmental stochasticity via extension of this theory to population models containing both diffusion and jump components.

Similarly, the theory presented here assumes that at most one birth event can occur at a time and that at most one deme can migrate or be sampled at a time (though multiple migrators or samples are permitted). These restrictions are not essential, and the proof of Theorem 1 can be adapted to accommodate relaxations of these assumptions. This will be developed in a sequel.

The price of the theory’s flexibility is primarily computational. When sequential Monte Carlo is used to evaluate the likelihood in Theorem 5, the computational effort scales linearly with the number of samples. In its most straightforward implementation—using an event-driven algorithm (e.g., Gillespie, 1977)—it scales nonlinearly with population size in general. However, stochastic simulation schemes are available that scale independently of population size (Higham, 2008). On the other hand, the importance sampling underlying Theorem 5 will in general require effort that is exponential in the number of demes. For models with many demes, therefore, approaches for ameliorating or circumventing this curse of dimensionality may be necessary. Critically, the substantial freedom one has in the choice of the importance-sampling kernel π can be exploited for this purpose. In particular, since it is permissible to “borrow information” from the future by means of the importance sampling, there is hope for highly efficient algorithmic computation.

Acknowledgments

This work was supported by grants from the U.S. National Institutes of Health, (Grant #1R01AI143852 to AAK, #1U54GM111274 to AAK and ELI) and a grant from the Interface program, jointly operated by the U.S. National Science Foundation and the National Institutes of Health (Grant #1761603 to ELI and AAK). QL acknowledges the support of the Michigan Institute for Data Science.

Appendix A. Proof of Theorem 1.

We are given a pruned genealogy P=(T,Z,Y) and a history H and wish to compute ProbPT=PHT=H. First, note that if ev(H)ev(P), then H and P are incompatible and ProbPT=PHT=H=0. Similarly, if any event of H is incompatible with the local structure of P in the sense of §3.4.3, then ProbPT=PHT=H=0. In either case, the conclusion of the theorem follows. Let us therefore suppose that neither of these conditions hold.

We can always construct a time-respecting, but otherwise arbitrary ordering of the sample nodes. Let Pj represent the genealogy spanned by the first j samples in this ordering. Since each Pj contains Pj for all j<j,Pj is a Markov chain. Therefore, we have the factorization

Prob[PH]=jProbPjPj1,H.

Each factor, ProbPjPj1,H, can itself be factorized. In particular, suppose H and Pj1 are given and suppose that it is the K-th event in H that introduces the j-th sample. The j-th lineage extends backward in time until it either coalesces with Pj1 or reaches t=0 (Fig. A1). Moreover, since P is compatible with H, nothing can happen to this lineage between events of H. Therefore, we proceed backward, event by event, as follows. Since the type of event K is given, the color of the j-th lineage just prior to that event is known. At each subsequent event, the lineage either emerges from the event or does not. Moreover, if the lineage does emerge from the event, the color prior to the event is determined and the color remains unchanged if it does not. Suppose that lineage j is in deme i just to the right of event k<K and that the deme-i occupancy and production are ni,ri, respectively. Let ij,sij be the lineage count and saturation at this event in Pj1. Then the new lineage can be any one of the nii lineages as yet unaccounted for. Of these, risij emerge from the event. Therefore, the probability that lineage j emerges from the event is risij/niij and the probability that it does not is niriij+sij/niij. Let qjk be the former if lineage j does in fact emerge from the event and the latter if it does not. Then ProbPjPj1,H=kqjk and Prob[PH]=jkqjk.

Figure A1. Embedded chain of the pruned genealogy process.

Figure A1.

Three successive states of the embedded chain of the pruned genealogy process are shown. At each step, a new lineage is added in a sampling event. This lineage extends backward until it either coalesces with the pre-existing genealogy or reaches t=0. Theorem 1 is derived by computing the probability that it coalesces at each possible point, conditional on the history of the population process.

Now fix k and consider the cumulative product m=1jqmk. Clearly 1,k=s1,k=0 and, if lineage j has not already coalesced to the right of k, then j+1,k=j,k+1. Moreover, if j emerges from k, then sj+1,k=sj,k+1 and sj+1,k=sj,k if it does not. Therefore, as we accumulate each successive lineage j, we move one step to the right in the following diagram.

graphic file with name nihpp-2405.17032v3-f0008.jpg

At each step, the lineage count increases by 1 and the saturation either increases by a unit or stays the same. The probability of each option is indicated on the corresponding arrow. Although there are multiple paths by which the process may arrive at the final lineage count and saturation, the product of the probabilities along each path is the same:

(niirisi)(niri).

Moreover, since each of the options is independent of the others,

jqjk=nrs,

the latter being the binomial ratio defined in §3.5.

Alternatively, one can reason as follows. Conditional on HT=H, at each time tev(H), a jump of mark Ut occurred, with a production of rUt=rii𝔻, resulting in a deme-occupancy of nXt=nii𝔻. In P, at time t, there are i=iYt lineages in deme i, of which si=siY˜t,Yt are emergent. By assumption, at each genealogical event, lineages within a deme are exchangeable: each has an identical probability of being involved. This exchangeability implies that each lineage present in a deme at time t was equally likely to have been one of the emergent lineages. In particular, at time t, the probability that si of the i deme-i lineages were among the ri of ni lineages emergent in the unpruned genealogy process is the same as the probability that, upon drawing i balls without replacement from an urn containing ri red balls and niri black balls, exactly si of the drawn balls are red, namely

niirisiisi(niri).

Because the lineages are labeled, each of the isi equally probable sets of si lineages is distinct; just one of these is the one present in P. Moreover, since, again conditional on HT=H, the identities of the lineages involved in a genealogical event are random and independent of the identities selected at all other events, we have established that

ProbPT=PHT=H=tev(H)nXtYtrUtsY˜t,Yt.

Returning to the possibility that H is incompatible with P, since ProbPT=P=0 if either any QUt=0 or ev(P)ev(H), we obtain the result. □

Appendix B. Filter equations.

B.1. Definition.

The likelihoods that appear in Theorems 2 and 5 are integrals over large sets of histories. As such, explicit expressions for them are not available, and we require mathematical tools to allow us to manipulate these quantities and devise algorithms for their numerical solution. The filter equations we introduce here are suitable for these purposes, and we devote this appendix to exposing their essential properties. This extremely convenient formalism has, to our knowledge, not been thoroughly exploited in the context we introduce here, though we note their resemblance to the constructions of Ogata (1978), Puri & Tuan (1986), Kliemann et al. (1990), and Giesecke & Schwenkler (2018).

Definition. Let Xt be a continuous-time Markov process with KFE

ut(t,x)=ut,xβt,x,xdxu(t,x)βt,x,xdx. (B1)

Suppose that B:+×𝕏2+ and λ:+×𝕏 are are given measurable functions. Let S+ be locally finite (i.e., S[0,t] is finite for all t>0). Then the system of equations

wt(t,x)=w(t,x)β(t,x,x)B(t,x,x)dxw(t,x)β(t,x,x)dxλ(t,x)w(t,x),tS, (B2)
w(t,x)=w˜(t,x)β(t,x,x)B(t,x,x)dx,tS, (B3)

is called the filter equation generated by β, with boost B, decay λ, and observed event times S. The process Xt is said to be the driver of the filter equation. Eq. B2 is the regular part of the filter equation; Eq. B3 is known as the singular part.

Remark 2. Trivially, a Kolmogorov forward equation is itself a filter equation with boost 1, decay 0, and S=.

B.2. Properties.

The following results show how filter equations allow one to integrate over random histories. First, Lemma B1 shows how one integrates over the full space of histories using a regular filter equation. Lemma B2 builds on this when the set of histories is restricted.

Lemma B1. Suppose that B:+×𝕏2+ is measurable. Let Vt be an +-valued random process satisfying

𝔼VtHt=Ht=eevHtBe,X˜e,Xe.

Let the family of measures λt on 𝕏 be defined by

λt()=𝔼Vt𝟙Xt,

for measurable , and let w(t,x) be the density of λt, i.e., λt(dx)=w(t,x)dx. In particular, 𝔼Vt=λt(𝕏)=w(t,x)dx. Then w satisfies the initial condition w(0,x)=p0(x) and the regular filter equation,

wt=wt,xαt,x,xBt,x,xdxw(t,x)αt,x,xdx. (B4)

Proof. Since ProbV0=1=1,λ0()=ProbX0, which implies that w(0,x)=p0(x). For t>0 and Δ>0, the expectation can be broken into three terms, according to whether Ht has zero, one, or more than one event in (t,t+Δ]. Accordingly, as Δ0,

w(t+Δ,x)=1Δαt,x,xdxw(t,x)+Δαt,x,xBt,x,xwt,xdx+o(Δ).

Forming a difference quotient and taking the limit, we obtain Eq. B4. Note that here we use the assumption that α and B are càdlàg as functions of t. □

When events are known to have occurred at particular times, it is of interest to integrate over those histories that include an event at each of these times. This leads to singular filter equations, as the next lemma shows. Before we state the lemma, some terminology is needed. Let 𝕊 be the space of increasing, locally finite sequences in +, with the topology induced by the Skorokhod metric and Lebesgue measure. For t+ and S𝕊, let StS[0,t]. Thus if S𝕊 and St=sˆ1,,sˆK, then the infinitesimal element of Lebesgue measure at St is dSt=n=1Kdsˆn.

Lemma B2. Suppose that B:+×𝕏2+ is measurable and Vt is an +-valued random process satisfying

𝔼VtHt=Ht=eevHtBe,X˜e,Xe.

Let λt be a family of measures on 𝕏×𝕊 defined by

λt(,S)=𝔼Vt𝟙Xt𝟙S𝒮s.t.evHtSt,

whenever 𝕏 and 𝒮𝕊 are measurable. Let w(t,x,S) be the density of this measure, i.e.,

λt(dxdS)=w(t,x,S)dxdSt.

Then w satisfies

wt(t,x,S)=w(t,x,S)α(t,x,x)B(t,x,x)dxw(t,x,S)α(t,x,x)dx,tS, (B5)
w(t,x,S)=w˜(t,x,S)α(t,x,x)B(t,x,x)dx,tS. (B6)

Proof. The proof proceeds by induction on the cardinality of St. The base case, for which St=, follows immediately from Lemma B1. Assuming that it holds for St<K, one has only to verify Eq. B6. This can be accomplished by integrating Eq. 6 directly. □

Remark 3. In the same way that Eqs. 4 and 5 can be represented as a single equation by means of a Dirac delta notation, the Eqs. B5 and B6 can be collapsed into a more compact form if β is allowed to have atoms at a countable set of time-points and the boost B is adjusted appropriately.

B.3. Adjoint filter equation.

Given driver, boost, and decay functions, a filter equation determines a family of measures on 𝕏. Specifically, suppose that, for st and S locally finite, ws,x,t,x satisfies the filter equation

w(s,x,s,x)=δ(x,x) (B7)
wt(s,x,t,x)=w(s,x,t,ξ)β(t,ξ,x)B(t,ξ,x)dξw(s,x,t,x)β(t,x,ξ)dξλ(t,x)w(s,x,t,x),tS, (B8)
w(s,x,t,x)=w˜(s,x,t,ξ)β(t,ξ,x)B(t,ξ,x)dξ, (B9)

Let ω be the measure whose density is w:

ω(s,x,t,)ws,x,t,xdx.

If f:𝕏 is a measurable function, then one defines its integral with respect to this measure in the usual way:

ω(s,x,t,f)=ωs,x,t,dxfx=ws,x,t,xfxdx.

In particular, ω(s,x,t,f) is itself a measurable function of x and we have the Chapman-Kolmogorov-like relation

ω(s,x,t,f)=ω(s,x,τ,ω(τ,ξ,t,f))dξ=ω(s,x,τ,dξ)ω(τ,ξ,t,f), (B10)

whenever sτt. Let us now fix t and f and write F(s,x)=ω(s,x,t,f). Let us take β,B, and λ to be càdlàg in t and F to be càglàd in s. Applying Eq. B10 we obtain, for Δ>0 and sS,

F(sΔ,x)=1Δβ(sΔ,x,ξ)dξΔλ(sΔ,x)F(s,x)+Δβ(sΔ,x,ξ)B(sΔ,x,ξ)F(s,ξ)dξ+o(Δ).

Taking Δ0 gives

Fs=β˜(s,x,ξ)[B˜(s,x,ξ)F(s,ξ)F(s,x)]dξλ˜(s,x)F(s,x). (B11)

For sS, we have

F(s,x)=ω(s,x,s,dξ)F(s,ξ)=β(s,x,ξ)B(s,x,ξ)F(s,ξ)dξ, (B12)

where F denotes the right-limit of F. Eqs. B11 and B12 constitute the adjoint form of Eqs. B7B9. Together with the final condition F(t,x)=f(x), these determine ω(s,x,t,f) for all st. Note that, when B=1 and λ=0, the adjoint filter equation becomes the familiar Kolmogorov backward equation (Eq. 3) for the driving process.

B.4. Solving filter equations by sequential Monte Carlo.

Filter equations afford a convenient means of computing expectations and likelihoods for pure jump processes. This is facilitated by the following Lemma, the statement of which uses a one-sided Dirac delta function. Specifically, let δv,v be the right-sided Dirac delta function satisfying δv,v=0 for vv and

abf(v)δv,vdv=fv𝟙v[a,b),

whenever f is càdlàg and a<b.

Lemma B3. Eqs. B2 and B3 are satisfied by w(t,x)=0vu(t,x,v)dv, where u(t,x,v) satisfies the KFE

ut(t,x,v)=v[λ(t,x)vu(t,x,v)]+0u(t,x,v)β(t,x,x)δ(v,B(t,x,x)v)dxdv0u(t,x,v)β(t,x,x)δ(v,B(t,x,x)v)dxdv,tS,u(t,x,v)dx=0u˜(t,x,v)π(t,x,dx)δ(v,A(t,x)B(t,x,x)v)dxdv,tS. (B13)

Here, A(t,x)βt,x,xdx and πt,x,dxβt,x,xdx/A(t,x).

Proof. For each tS, we have

wt(t,x)=0vut(t,x,v)dv=00vu(t,x,v)β(t,x,x)δ(v,B(t,x,x)v)dvdxdv00vu(t,x,v)β(t,x,x)δ(v,B(t,x,x)v)dvdxdv+0vv[λ(t,x)vu(t,x,v)]dv.

Here, the non-explosivity assumption guarantees that we can differentiate under the integral sign and exchange the order of integration. Moreover, it ensures that u0 as v. Hence, by evaluating the first integral with respect to v, the second with respect to v, and the third by parts, we obtain

wt(t,x)=vut,x,vβt,x,xBt,x,xdvdxvu(t,x,v)βt,x,xdvdxλ(t,x)vu(t,x,v)dv,

which is simplified to obtain Eq. B2. Similarly, at each tS, we have

w(t,x)dx=00vu˜(t,x,v)π(t,x,dx)δ(v,A(t,x)B(t,x,x)v)dxdvdv=0vu˜(t,x,v)π(t,x,dx)A(t,x)B(t,x,x)dxdv=w˜(t,x)β(t,x,x)B(t,x,x)dxdx.

which is equivalent to Eq. B3

Eqs. B13 are recognizable as the KFE of a certain process (Xt,Vt). In particular, the driver Xt has KFE Eq. B1. Vt is directed by Xt in the sense that V has jumps wherever X does: when X jumps at time t from x to x,V jumps by the multiplicative factor Bt,x,x0. Between jumps, Vt decays deterministically and exponentially at rate λ(t,x). At the known times in S,X jumps according to the probability kernel π and, V jumps by the factor A(t,x)Bt,x,x. If we view Vt as a weight, then Lemma B3 tells us how the Vt-weighted average of Xt evolves in time: this average is simply w(t,x)dx. Thus, Lemma B3 gives a recipe for the integration of Eqs. B5 and B6 in the Monte Carlo sense. A pseudocode representation of this procedure is given in Algorithm B1. This is a simple sequential importance sampling algorithm and as such can be improved upon in many ways (Doucet et al., 2001; Arulampalam et al., 2002; Wills & Schön, 2023). Our purpose here is merely to illustrate the implications of Lemma B3 by showing how the features of Eqs. B2 and B3 translate into computations, in the simplest possible context.

Appendix C. Examples.

C.1. SIRS model.

King et al. (2022) worked out formulae for the exact likelihood of a genealogy induced by an SIRS model. The theory developed in this paper applies, but since there is only one deme in this model, this is a simple case. Its state vector is x=(S,I,R) and its KFE is

vt(S,I,R)=β(S+1)(I1)Nv(t,S+1,I1,R)βSINv(t,S,I,R)+γ(I+1)v(t,S,I+1,R1)γIv(t,S,I,R)+ω(R+1)v(t,S1,I,R+1)ωRv(t,S,I,R).

Here N=S+I+R is the host population size. Note that, though the theory allows for time-dependent event rates, this example is time-homogeneous. This model has one deme and occupancy function n(x)=I. There are four kinds of jumps: transmission, recovery, waning of immunity, and sampling. Accordingly, the marks are 𝕌={Trans, Recov, Wane, Sample}. Table C1 gives αu,ru, and the event type for each of these marks.

Table C1.

Elements of the SIRS model pertinent to the genealogy process. The table shows the rate (αu), jump (xx), production (ru), and event type for each of the model’s four marks (u).

u αu xx' ru Event type
Trans βSIN (S,I)(S1,I+1) 2 pure birth
Recov γI (I,R)(I1,R+1) 0 pure death
Wane ωR (S,R)(S+1,R1) 0 neutral
Sample ψI xx 1 pure sample

Given an obscured genealogy Z, let ev(Z)=BS0S1, where B is the set of branch-times, and S0,S1 are the sets of sample-times with saturations 0 and 1, respectively. Since there is only one deme, paintings of Z can differ only in number and position of inline, internal nodes along branches. Each of these can only correspond to

Algorithm B1.

Sequential Monte Carlo filter.

The following is a simple Monte Carlo scheme for the filter given by Eqs. B2 and B3. It takes as input an initial time t0, a final time T, and a sequence of observed event times S=t1,,tK. We order the latter so that t0t1<t2<<tKtK+1T. In addition, we are given event rates β, a boost function B, a decay function λ, and the initial distribution of latent states p0. As in Lemma B3, we let
A(t,x)βt,x,xdx,πt,x,dxβt,x,xA(t,x)dx.
For a given, fixed ensemble size, J+, the algorithm returns an unbiased Monte Carlo estimate, ˆ, of the likelihood.

 1: procedure SMCFilter(t0,T,S,β,B,λ,p0,J)
Initialize an ensemble of latent states and weights:
 2:  xjp0(), for j = 1, …, J
 3:  wj ↑ 1, for j = 1, …, J
 4:  for k = 0, …, K do ▷ loop over observed event times
 5:   for j = 1, … , J do ▷ loop over the ensemble
 6:    ttk
 7:    if k > 0 then ▷ singular part (Eq. B3)
 8:     xjπ(t,xj,)
 9:     wjwjA(t,xj)B(t,xj,xj)
10:     xjxj
11:    while t < tk+1 do ▷ regular part (Eq. B2)
12:     ΔExp(A(t,xj)) ▷ Sojourn times are exponentially distributed.
13:     if t + Δ < tk+1 then
14:      xjπ(t,xj,)
15:      tt+Δ
16:      wjwjB(t,xj,xj)exp(λ(t,xj)Δ)
17:      xjxj
18:      tt
19:     else
20:      Δ ← tk+1t
21:      wjwjexp(λ(t,xj)Δ)
22:      ttk+1
23:  ^1Jjwj

u=Trans with s=1. For tev(Z), we can take the importance sampling distribution to be

πu=c,u=Trans,s=0,tev(Z),1c,u=Trans,s=1,tev(Z),0,otherwise.

Here c is an arbitrary probability that does not affect the computation. The relevant binomial ratios are

nrs=(I)(I1)I(I1),u=Trans,s=0,2(I)I(I1),u=Trans,s=1,2I(I1),u=Trans,s=2,II,u=Sample,s=01I,u=Sample,s=1.

Figure C1.

Figure C1.

Likelihood computation for the SiRS model by sequential Monte Carlo. (A) A simulated genealogy for β=4,γ=2,ω=1,ψ=1,S0,I0,R0=(97,3,0). (B) A slice through the likelihood surface at the true parameters in the γ-direction. Each point is a distinct Monte Carlo estimate. The blue curve is a LOESS smooth; the dashed lines bound the Monte Carlo-adjusted 95% confidence interval (Ionides et al., 2017).

This leads, for tev(Z), to the following regular part of the filter equation:

wt=β(S+1)(I1)N(1((t)2)(I2))w(t,S+1,I1,R)βSINw(t,S,I,R)+γ(I+1)w(t,S,I+1,R1)γIw(t,S,I,R)+ω(R+1)w(t,S1,I,R+1)ωRw(t,S,I,R)ψIw(t,S,I,R).

Here, we have summed over the various paintings for u= Trans, s<2. Note the presence of the decay term proportional to ψ. At event-times tev(Z), the singular part of the filter equation reads

w(t,S,I,R)=w˜(t,S+1,I1,R)2β(S+1)NI,tB,w˜(t,S,I,R)ψ(I(t)),tS0,w˜(t,S,I,R)ψ,tS1.

Finally, note that w(t,S,I,R)=0 for all I<(t).

C.2. SEIRS model.

A simple, yet interesting, model with more than one deme is the SEIRS model (Fig. 1A). The state space is +4, with the state x=(S,E,I,R) defined by the numbers of hosts in each of the four compartments. The KFE for the population process is

vt(t,S,E,I,R)=β(S+1)INv(t,S+1,E1,I,R)βSINv(t,S,E,I,R)+σ(E+1)v(t,S,E+1,I1,R)σEv(t,S,E,I,R)+γ(I+1)v(t,S,E,I+1,R1)γIv(t,S,E,I,R)+ω(R+1)v(t,S1,E,I,R+1)ωRv(t,S,E,I,R),

where N=S+E+I+R is the total population size. Note that the terms associated with sampling cancel each other in the KFE, since, with the state space defined as above, sampling has no effect on the state.

This model has two demes: 𝔻={E,I}. Its deme occupancy function is n(x)=(E,I). There are five kinds of jumps: transmission, progression, recovery, waning of immunity, and sampling. The corresponding marks are 𝕌={Trans, Prog, Recov, Wane, Sample}. Table C2 gives αu,ru, and the event type for each of these marks.

Table C2.

Elements of the SEIRS model pertinent to the genealogy process. The table shows the rate αu, jump xx production ru and event type for each of the model’s five marks (u).

u αu xx' ru Event type
Trans βSIN (S,E)(S1,E+1) (1, 1) pure birth
Prog σE (E,I)(E1,I+1) (0,1) pure migration
Recov γI (I,R)(I1,R+1) (0,0) pure death
Wane ωR (S,R)(S+1,R1) (0,0) neutral
Sample ψI xx (0,1) pure sample

Table C3.

Elements of a scheme for numerically computing the likelihood under the SEIRS model. The regular portion of the filter equation holds in between genealogical events (i.e., for tBS0S1 the singular portion describes the effect of these events tBS0S1 Each line corresponds to a potential event. An event with mark u and saturation s has the boost given by the binomial ratio shown (third column). The yy column depicts the proposed painting schematically, and π is the probability of that proposal. Blue is used for the E deme and yellow for the I deme. For each line, the filter equation contains m terms. An asterisk(*) stands for cases not explicitly mentioned.

graphic file with name nihpp-2405.17032v3-t0011.jpg

In the application of Theorem 5 and Corollary 6, one has wide latitude in the selection of the kernels π and q. Table C3 gives a particular set of choices that are naïve in the sense that they refrain from borrowing information from the future. Such a naïve filter is always available, though it will rarely be optimal.

Using the choices of Table C3, we proceed to write down a filter equation for the SEIRS model. As previously, given an obscured genealogy, let B be the set of its branch times, S0 be the set of tip-sample times, and S1 be the set of inline sample times. Then for tBS0S1, the filter equation reads:

wt(t,S,E,I,R,y)=β(S+1)IN(1EE)(1II)w(t,S+1,E1,I,R,y)+k=1Iβ(S+1)IN1E(1II)w(t,S+1,E1,I,R,y˜2k)+k=1Iβ(S+1)IN1I(1EE)w(t,S+1,E1,I,R,y˜3k)βSINw(t,S,E,I,R,y)+σ(E+𝟙){EE}(1II)w(t,S,E+1,I1,R,y)+k=1Eσ(E+𝟙){EE}1Iw(t,S,E+1,I1,R,y˜6k)σEw(t,S,E,I,R,y)+γ(I+𝟙){II}w(t,S,E,I+1,R1,y)γIw(t,S,E,I,R,y)+ω(R+1)w(t,S1,E,I,R+1,y)ωRw(t,S,E,I,R,y)ψIw(t,S,E,I,R,y). (C1)

Here, y˜jk refers to the coloring of the tree immediately preceding the proposal indicated on line j of Table C3. The integer k specifies the particular branch on which the change occurs.

The singular portion of the filter equation has one component for each distinct type of genealogical event:

w(t,S,E,I,R,y)=β(S+1)IN1EIw˜t,S+1,E1,I,R,y˜10+β(S+1)IN1EIw˜t,S+1,E1,I,R,y˜11,tB,ψIIw˜t,S,E,I,R,y˜15,tS0,ψw˜t,S,E,I,R,y˜18,tS1. (C2)

In addition to Eqs. C1 and C2, the quantity w should satisfy the condition w(t,S,E,I,R,y)=0 whenever E<E or I<I.

A variety of importance-sampling kernels q,π are permissible under the terms of Theorem 5. With a particular choice of importance-sampling kernel, the filter equation uniquely specifies a sequential Monte Carlo algorithm for estimating the likelihood. The specific choices made in Table C3 underlie the results displayed in Fig. C2. Some numerical results obtained using this scheme are presented in Fig. C2.

Figure C2.

Figure C2.

Likelihood computation for the SEIRS model by sequential Monte Carlo, using the scheme of Table C3. (A) Simulated genealogy for β=3,σ=1,γ=0.5,ψ=0.02, ω=0.08,S0,E0,I0,R0=(70,1,0,50). (B) Likelihood slice in the σ-direction. Each point represents the estimate of an independent sequential Monte Carlo computation. The blue curve shows a LOESS smooth; the dashed vertical lines enclose the Monte Carlo-adjusted 95% confidence interval (Ionides et al., 2017).

Contributor Information

AARON A. KING, Department of Ecology & Evolutionary Biology, Center for the Study of Complex Systems, and Department of Mathematics, University of Michigan, Ann Arbor, MI 48109 USA and Santa Fe Institute, 1399 Hyde Park Road, Santa Fe, NM 87501 USA

QIANYING LIN, Theoretical Biology and Biophysics, Los Alamos National Laboratory, Los Alamos, NM 87545 USA.

EDWARD L. IONIDES, Department of Statistics, University of Michigan, Ann Arbor, MI 48109 USA

References

  1. Alizon S. (2024) Phylodynamics. In Didier G. & Guindon S. (eds.), Models and Methods for Biological Evolution, pp. 259–282. Hoboken, New Jersey: Wiley. DOI: 10.1002/9781394284252.ch11 [DOI] [Google Scholar]
  2. Arulampalam M. S., Maskell S., Gordon N., & Clapp T. (2002) A tutorial on particle filters for online nonlinear, non-Gaussian Bayesian tracking. IEEE Trans Signal Process 50:174–188. DOI: 10.1109/78.978374 [DOI] [Google Scholar]
  3. Barido-Sottani J., Vaughan T. G., & Stadler T. (2020) A multitype birth-death model for Bayesian inference of lineage-specific birth and death rates. Systematic Biology 69:973–986. DOI: 10.1093/sysbio/syaa016 [DOI] [PMC free article] [PubMed] [Google Scholar]
  4. Boskova V., Bonhoeffer S., & Stadler T. (2014) Inference of epidemiological dynamics based on simulated phylogenies using birth-death and coalescent models. PLoS Computational Biology 10:e1003913. DOI: 10.1371/journal.pcbi.1003913 [DOI] [PMC free article] [PubMed] [Google Scholar]
  5. Bretó C. & Ionides E. L. (2011) Compound Markov counting processes and their applications to modeling infinitesimally over-dispersed systems. Stochastic Processes and their Applications 121:2571–2591. DOI: 10.1016/j.spa.2011.07.005 [DOI] [Google Scholar]
  6. Doucet A., de Freitas N., & Gordon N. (eds.) (2001) Sequential Monte Carlo Methods in Practice. New York: Springer. DOI: 10.1007/978-1-4757-3437-9 [DOI] [Google Scholar]
  7. Drummond A. J., Rambaut A., Shapiro B., & Pybus O. G. (2005) Bayesian coalescent inference of past population dynamics from molecular sequences. Molecular Biology and Evolution 22:1185–1192. DOI: 10.1093/molbev/msi103 [DOI] [PubMed] [Google Scholar]
  8. Felsenstein J. (2004) Inferring Phylogenies. Sunderland, Mass.: Sinauer. [Google Scholar]
  9. Giesecke K. & Schwenkler G. (2018) Filtered likelihood for point processes. Journal of Econometrics 204:33–53. DOI: 10.1016/j.jeconom.2017.11.011 [DOI] [Google Scholar]
  10. Gillespie D. T. (1977) Exact stochastic simulation of coupled chemical reactions. Journal of Physical Chemistry 81:2340–2361. DOI: 10.1021/j100540a008 [DOI] [Google Scholar]
  11. Grenfell B. T., Pybus O. G., Gog J. R., Wood J. L. N., Daly J. M., Mumford J. A., & Holmes E. C. (2004) Unifying the epidemiological and evolutionary dynamics of pathogens. Science 303:327–332. DOI: 10.1126/science.1090727 [DOI] [PubMed] [Google Scholar]
  12. Griffiths R. C. & Tavaré S. (1994) Sampling theory for neutral alleles in a varying environment. Philosophical Transactions of the Royal Society of London, Series B 344:403–410. DOI: 10.1098/rstb.1994.0079 [DOI] [PubMed] [Google Scholar]
  13. He D., Ionides E. L., & King A. A. (2010) Plug-and-play inference for disease dynamics: measles in large and small populations as a case study. Journal of the Royal Society, Interface 7:271–283. DOI: 10.1098/rsif.2009.0151 [DOI] [PMC free article] [PubMed] [Google Scholar]
  14. Higham D. J. (2008) Modeling and simulating chemical reactions. SIAM Review 50:347–368. DOI: 10.1137/060666457 [DOI] [Google Scholar]
  15. Ionides E. L., Breto C., Park J., Smith R. A., & King A. A. (2017) Monte carlo profile confidence intervals for dynamic systems. Journal of the Royal Society, Interface 14:20170126. DOI: 10.1098/rsif.2017.0126 [DOI] [PMC free article] [PubMed] [Google Scholar]
  16. King A. A., Lin Q., & Ionides E. L. (2020) The sampled Moran genealogy process. arXiv 2002.11184. DOI: 10.48550/ARXIV.2002.11184 [DOI] [Google Scholar]
  17. King A. A., Lin Q., & Ionides E. L. (2022) Markov genealogy processes. Theoretical Population Biology 143:77–91. DOI: 10.1016/j.tpb.2021.11.003 [DOI] [PMC free article] [PubMed] [Google Scholar]
  18. Kingman J. F. C. (1982a) The coalescent. Stochastic Processes and their Applications 13:235–248. DOI: 10.1016/0304-4149(82)90011-4 [DOI] [Google Scholar]
  19. Kingman J. F. C. (1982b) On the genealogy of large populations. Journal of Applied Probability 19:27–43.DOI: DOI: 10.2307/3213548 [DOI] [Google Scholar]
  20. Kliemann W. H., Koch G., & Marchetti F. (1990) On the unnormalized solution of the filtering problem with counting process observations. IEEE Transactions on Information Theory 36:1415–1425. DOI: 10.1109/18.59936 [DOI] [Google Scholar]
  21. Leventhal G. E., Günthard H. F., Bonhoeffer S., & Stadler T. (2014) Using an epidemiological model for phylogenetic inference reveals density dependence in HIV transmission. Molecular Biology and Evolution 31:6–17. DOI: 10.1093/molbev/mst172 [DOI] [PMC free article] [PubMed] [Google Scholar]
  22. MacPherson A., Louca S., McLaughlin A., Joy J. B., & Pennell M. W. (2021) Unifying phylogenetic birth-death models in epidemiology and macroevolution. Systematic Biology 71:172–189. DOI: 10.1093/sysbio/syab049 [DOI] [PMC free article] [PubMed] [Google Scholar]
  23. Möhle M. (2000) Ancestral processes in population genetics—the coalescent. Journal of Theoretical Biology 204:629–638. DOI: 10.1006/jtbi.2000.2032 [DOI] [PubMed] [Google Scholar]
  24. Möller S., du Plessis L., & Stadler T. (2018) Impact of the tree prior on estimating clock rates during epidemic outbreaks. Proceedings of the National Academy of Sciences 115:4200–4205. DOI: 10.1073/pnas.1713314115 [DOI] [PMC free article] [PubMed] [Google Scholar]
  25. Moran P. A. P. (1958) Random processes in genetics. Mathematical Proceedings of the Cambridge Philosophical Society 54:60–71. DOI: 10.1017/s0305004100033193 [DOI] [Google Scholar]
  26. Notohara M. (1990) The coalescent and the genealogical process in geographically structured population. Journal of Mathematical Biology 29. DOI: 10.1007/bf00173909 [DOI] [PubMed] [Google Scholar]
  27. Ogata Y. (1978) The asymptotic behaviour of maximum likelihood estimators for stationary point processes. Annals of the Institute of Statistical Mathematics 30:243–261. DOI: 10.1007/bf02480216 [DOI] [Google Scholar]
  28. Puri M. L. & Tuan P. D. (1986) Maximum likelihood estimation for stationary point processes. Proceedings of the National Academy of Sciences 83:541–545. DOI: 10.1073/pnas.83.3.541 [DOI] [PMC free article] [PubMed] [Google Scholar]
  29. Rasmussen D. A., Ratmann O., & Koelle K. (2011) Inference for nonlinear epidemiological models using genealogies and time series. PLoS Computational Biology 7:e1002136. DOI: 10.1371/journal.pcbi.1002136 [DOI] [PMC free article] [PubMed] [Google Scholar]
  30. Rasmussen D. A., Volz E. M., & Koelle K. (2014) Phylodynamic inference for structured epidemiological models. PLoS Computational Biology 10:e1003570. DOI: 10.1371/journal.pcbi.1003570 [DOI] [PMC free article] [PubMed] [Google Scholar]
  31. Seidel S., Stadler T., & Vaughan T. G. (2024) Estimating pathogen spread using structured coalescent and birth-death models: A quantitative comparison. Epidemics 49:100795. DOI: 10.1016/j.epidem.2024.100795 [DOI] [PubMed] [Google Scholar]
  32. Stadler T. (2010) Sampling-through-time in birth-death trees. Journal of Theoretical Biology 267:396–404. DOI: 10.1016/j.jtbi.2010.09.010 [DOI] [PubMed] [Google Scholar]
  33. Takahata N. (1988) The coalescent in two partially isolated diffusion populations. Genetical Research 52:213–222. DOI: 10.1017/s0016672300027683 [DOI] [PubMed] [Google Scholar]
  34. Vaughan T. G. & Stadler T. (2025) Bayesian phylodynamic inference of multitype population trajectories using genomic data. Molecular Biology and Evolution 42:msaf130. DOI: 10.1093/molbev/msaf130 [DOI] [PMC free article] [PubMed] [Google Scholar]
  35. Volz E. M. (2012) Complex population dynamics and the coalescent under neutrality. Genetics 190:187–201. DOI: 10.1534/genetics.111.134627 [DOI] [PMC free article] [PubMed] [Google Scholar]
  36. Volz E. M. & Frost S. D. W. (2014) Sampling through time and phylodynamic inference with coalescent and birth-death models. Journal of the Royal Society, Interface 11:20140945. DOI: 10.1098/rsif.2014.0945 [DOI] [PMC free article] [PubMed] [Google Scholar]
  37. Volz E. M., Kosakovsky Pond S. L., Ward M. J., Leigh Brown A. J., & Frost S. D. W. (2009) Phylodynamics of infectious disease epidemics. Genetics 183:1421–1430. DOI: 10.1534/genetics.109.106021 [DOI] [PMC free article] [PubMed] [Google Scholar]
  38. Volz E. M. & Siveroni I. (2018) Bayesian phylodynamic inference with complex models. PLoS Computational Biology 14:e1006546. DOI: 10.1371/journal.pcbi.1006546 [DOI] [PMC free article] [PubMed] [Google Scholar]
  39. Wakeley J. (2009) Coalescent Theory: An Introduction. New York: W. H. Freeman. [Google Scholar]
  40. Wills A. G. & Schön T. B. (2023) Sequential Monte Carlo: a unified review. Annual Review of Control, Robotics, and Autonomous Systems 6. DOI: 10.1146/annurev-control-042920-015119 [DOI] [Google Scholar]

Articles from ArXiv are provided here courtesy of arXiv

RESOURCES