Predicting the diversity of early epidemic spread on networks

The interplay of biological, social, structural and random factors makes disease forecasting extraordinarily complex. The course of an epidemic exhibits average growth dynamics determined by features of the pathogen and the population, yet also features significant variability reflecting the stochastic nature of disease spread. In this work, we reframe a stochastic branching process analysis in terms of probability generating functions and compare it to continuous time epidemic simulations on networks. In doing so, we predict the diversity of emerging epidemic courses on both homogeneous and heterogeneous networks. We show how the challenge of inferring the early course of an epidemic falls on the randomness of disease spread more so than on the heterogeneity of contact patterns. We provide an analysis which helps quantify, in real time, the probability that an epidemic goes supercritical or conversely, dies stochastically. These probabilities are often assumed to be one and zero, respectively, if the basic reproduction number, or R0, is greater than 1, ignoring the heterogeneity and randomness inherent to disease spread. This framework can give more insight into early epidemic spread by weighting standard deterministic models with likelihood to inform pandemic preparedness with probabilistic forecasts.


I. INTRODUCTION
By the time of this writing, the COVID-19 pandemic had reached every corner of the world. Public health efforts are now focused on identifying new clusters of outbreaks and their risk of causing new epidemic waves, much like they did at the beginning of the pandemic. As large outbreaks soared early on in a handful of countries, sporadic clusters of confirmed cases dotted regions in the United States. Data surrounding new clusters or waves tend to consist of low numbers of cases highly sensitive to noise, sparking concern and uncertainty at the expected progression of the epidemic.
The first confirmed case of COVID-19 in the US was reported on January 21st, 2020 in the state of Washington [1]. Three subsequent cases were later identified in Washington; two hospitalizations on February 19th [2], and two deaths on February 26th, one week later [3]. Then, on February 28th, a high school closed immediately after one of its students tested positive for a strain that had been associated with the January 21st case [4]. With limited knowledge of active cases, it was nearly impossible to predict the current and future severity of the outbreak.
One critical question in Washington after over a month with only a handful of detected cases, was whether this chain of events suggested a single tree of very few local transmissions, or multiple distinct introduction events from abroad. Despite decades of disease modeling, the community was ill-equipped to answer this question. The problem is challenging in part because of inadequate testing at the time, and also because well-established disease models often operate on deterministic mechanisms designed to describe the average behavior of large epidemics and not the random, discrete nature of small transmission chains. The looming question of whether a local COVID-19 outbreak would die off by itself or become a disaster, can only be modeled using tools capturing the stochasticity, or randomness, of person-to-person contact. To accurately model the potential outcomes of an epidemic based on limited case data, tools that capture the random nature of disease spread along with the structure of the population are required.
In this paper, we analyze the diversity of early epidemic courses. In doing so, we also hope to provide analytical tools to inform disease forecasts by accounting for the heterogeneity and stochastic nature of disease transmission.
Since the introduction of mean-field epidemic models, deterministic models of disease spread have continued to evolve in complexity and detail. Kermack and McKendrick's early work [5][6][7] gave rise to compartmental models, in which the population under study is divided into two or more states. Perhaps the most widely known of these models is the susceptible-infectious-recovered (SIR) model, where the population is divided into susceptible, infectious, and recovered states (or compartments) and the trajectory of the sizes of each compartment can be tracked analytically over time [8,9]. The standard compartmental model assumes homogeneous mixing of the population and is deterministic, meaning that a given set of initial conditions and disease transmission rates always leads to the same expected outcome. A common extension to compartmental models is to relax the assumption of homogeneous mixing. One method for doing so is to derive mean-field equations for an epidemic process over contact networks, thereby introducing heterogeneous structure into the population [10]. Similarly, it is possible to partition the population based on traits such as age, risk behaviors, or location and define how these partitions mix [11][12][13][14]. While these approaches introduce more realistic contact behavior into a model, they fail to account for the inherently stochastic nature of disease spread; something of particular importance early in an outbreak.
Models based on stochastic processes address the shortcoming of deterministic outcomes in the standard mean field compartment models. A commonly used approach is that of branching processes. Bienayme-Galton-Watson processes are one widely used example, as they provide a good approximation of more general stochastic epidemic models [15]. Beyond Bienayme-Galton-Watson processes, there exist a number of extensions such as including population structure, multiple types of hosts/pathogens, and considering time to be continuous rather than discrete [16,17]. In these branching process models the basic reproduction number, R 0 , the probability of an outbreak, and the final proportion of population infected (in a "supercritical" model) are typically tractable to compute. While these are all important, a shortcoming of most branching models is the difficulty of tracking the trajectory of outbreaks through time and knowing whether it matches the continuous time dynamics of real epidemics. Stochastic differential equations are an alternative modeling approach that allow one to track outbreak trajectories, as well as often finding threshold conditions for the occurrence of an outbreak or the existence of an endemic equilibrium [18][19][20]. Like all models, stochastic differential equations have drawbacks; the most relevant is standard formulations do not allow for stochastic extinction if R 0 > 1.
Another common approach in disease modeling is times series analysis, more statistical in nature than mechanistic models. This theory can be applied to assist in estimating the parameters of compartmental models or to combine ensembles of compartmental models to increase prediction accuracy [21,22]. Independently of compartmental models, time series analysis can be used to study covariates of disease occurrence (e.g. weather), estimate the future variability in observed cases, or to make epidemic forecasts [23][24][25]. A necessary requirement for the effective use of many time series methods however is data. When facing sparse incidence numbers, and in the absence of historical data, the methods become problematic and thus are not suitable for emerging diseases.
Agent-based models are another family of models used for tracking epidemic progression, in which agents, or in-dividuals in the population, are tracked throughout the course of the epidemic. Agents are parameterized with individual attributes, capturing the heterogeneity of the population and aspects from compartmental models are used to categorize the state of each agent [26,27]. While there is great power in adjusting various attributes for different epidemic conditions and environmental factors, most of these models are computationally expensive and need a copious amount of information to generate the entire collection of agents [26][27][28][29][30][31], making them ill-suited for modeling early epidemic spread with a handful of cumulative case counts and sparsely available data.
Early in an outbreak, we often face the unique challenge of modeling disease spread while taking into account the heterogeneity of the population and the stochastic nature of disease spread, including stochastic extinction, without substantial amounts of data. The heterogeneous contact structure found in populations is accounted for by network models, and a first approximation for a relevant contact structures in a novel outbreak can be taken from past outbreaks of similar diseases. Including a sufficient number of possible states will typically account for heterogeneity in host and pathogen type. The randomness of transmission is modeled with stochastic processes, many of which easily permit stochastic extinction.
The above considerations naturally lead to percolation theory, which can be used to analyze stochastic compartmental disease models on networks. Percolation models unite contact heterogeneity and stochasticity under a single modeling framework [32]. An underlying contact network acts as the substrate for disease to propagate through, resulting in a directed network of transmission [33][34][35]. The resulting epidemic percolation networks can be analyzed using branching process theory [36,37] which model stochastic transmission between individuals using an underlying offspring distribution. Branching processes are especially useful for early epidemic modeling, as they allow for stochastic behavior of spread as well as stochastic extinction [38]. Specifically, the method of probability generating functions (PGFs) can be used to analyze branching processes on percolation networks [37][38][39]. Consequently, there have been many recent applications of this framework designed specifically for COVID-19 [40][41][42][43][44][45].
The PGF formalism is traditionally used for estimating quantities that pertain to the predicted end of an epidemic -such as the probability of infecting a macroscopic fraction of the population and distribution of final outbreak sizes -but not how risk and outbreak sizes change dynamically over time. Kenah and Robins show how modified percolation models (epidemic percolation networks) have a final state isomorphic to a network-based SIR models [33]. Most bond percolation frameworks differ from SIR dynamics as SIR transmission events are correlated through the distribution of the infectious period of each infected individual whereas percolation models assume independent contacts and trans-mission events. More importantly, percolation models integrate over time to map transmission dynamics (which occur in continuous time) to discrete bond percolation (which occur in discrete time with a fixed probability of transmission).
In 2009, Noël et al. [46] offered a novel method for tracking the stochasticity of outbreak sizes by epidemic generations, allowing us to incorporate discrete time into the percolation-framework model. In this paper, we show how the generation-based PGF formalism also succeeds in tracking emerging epidemic size in continuous time, by validating the PGF approach with event-driven simulations on networks. This result allows us to use PGFs and early disease data to quantify epidemic risk and survival probability.

A. Probability generating functions
PGFs succinctly encode a probability distribution in a power series representation so that the methods of power series analysis can be applied [47]. PGF theory naturally extends to disease modeling, where the distribution under study encapsulates a disease transmission network, framed as a bond percolation problem where the bond occupation probability T is the probability of an infected individual infecting one of their contacts over the course of the entire epidemic [37,39]. Typically, this approach is used to solve for the average behavior of the system; we can solve for quantities such as the critical transmissibility at which the entire connected population will become infected, or the distribution of outbreak sizes. However, an increasing necessity of disease modeling is to model early epidemic spread, analyzing early cases to predict whether an outbreak will become large before it actually happens. In 2009, Noël et al. [46] developed the epidemic PGF modeling theory further to model the sizes of progressive epidemic generations, demonstrated in Fig. 1.
The foundations for both aforementioned generating function methodologies are the same, beginning with the underlying contact network. In a contact network, we represent a collection of individuals as nodes and their contacts between each other with edges. We say that two nodes are neighbors if they are in contact, i.e. connected by an edge. A node's degree is how many neighbors it has. The degree distribution of a network is the probability distribution for the number of neighbors of one node. Under an SIR disease modeling framework, nodes begin as susceptible, and become infectious if it is infected by one of its neighbors, which occurs with probability T .
The framework introduced by Noël et al. uses PGFs to describe generations of infection as a piece-wise generating function, which can then be studied using branching process techniques. First we introduce what an epi- demic generation is. We say a node belongs to generation g if it became infected via a neighbor belonging to generation g − 1. Assuming an infinite-size random network drawn from a specific degree distribution (a process known as the configuration model [48]), each chain of infections stemming from an initial infected case, patient zero, can be considered uncorrelated. This uncorrelated assumption follows from configuration models having locally treelike structure, thus every subsequent case to be treated as a node that was reached by following a random edge. In this way, each node in each generation can be treated as independent from all other nodes in its generation. Thus, for each node in generation g, the PGF describing the distribution of cases that node will cause over the course of the epidemic is given by where G g (x; T ) is the distribution, in PGF notation, of the secondary cases caused by a single node in generation g. Now, we will provide the derivations used to obtain this framework using the underlying network, generating functions, and branching process theory.
Using PGF notation, we will refer to the original underlying network degree distribution as G 0 (x), which we write as The kth coefficient of Eq. (2), p k , is the probability of randomly choosing a node with degree k from the network. The average degree of the network is denoted as k , derived by the first derivative of the generating function as To study the progression of an epidemic, we are interested in the distribution of infections from each subsequently infected node. Before introducing transmission probability, we work first with the aforementioned degree distribution to understand how many infections each node could cause through each generation. Assuming an initial infectious node, patient zero, we know G 0 (x) is the distribution of contacts for them, but that distribution is different for anyone patient zero infects. This phenomenon is known as the friendship paradox; the degree of a node chosen by following a random edge is on average, larger than the degree of the node selected at random whose edge we followed. In this context, patient zero has a degree distribution of G 0 (x), but the node who patient zero first infects has a degree distribution known as the excess degree distribution, denoted as G 1 (x) in PGF notation. To obtain G 1 (x), we are interested in the degree of nodes provided that we arrive there by following the edge from one of its neighbors. So, this means the resulting distribution will exclude that neighbor, reducing every node's degree by 1, and multiplied by the number of ways they could have been reached, which is the original degree. This algorithm surmounts to taking the derivative of G 0 (x), so that we have the excess degree distribution and where the derivative is divided by the average degree of the network k in order to normalize the distribution tuned to the original node. The coefficients q k represent the probability of reaching a node with degree k from a randomly chosen edge.
Returning to the percolation problem, we incorporate disease transmissibility T to transform the excess degree distribution into a secondary case distribution. The probability that a single infectious node infects l neighbors given it has degree k, or k neighbors, is given by From this we can derive the PGF for the number of infections caused by patient zero, which we denote G 0 (x; T ) for short, given by From G 0 (x; T ), G 1 (x; T ) can be calculated in a parallel fashion as G 1 (x) is from G 0 (x). The PGF G 1 (x; T ) is now the probability distribution of the number of infections caused by a single node, i.e., the secondary case distribution.
We now present how to study the evolution of the distribution of cumulative cases for the percolation model following Noël et al. Let s be the number of cumulative cases at generation g and let m be the number of infectious nodes strictly belonging to generation g. (Note that in this way, s is the sum of all m values from generation 0 up to and including generation g.) We let the probability of having s total infections by the end of the g-th generation with m becoming infected (and thus being infectious) during that generation be denoted as ψ g sm [46]. This has an associated probability generating function, given by over all s, m.
We know the distribution of infections following from a single infectious node in generation g − 1 is generated by G g−1 (1 + (x − 1)T ) (from Eq. (6)). The PGF of a finite sum of independent processes is the product of their PGFs, and as discussed above, each node in generation g − 1 can be treated independently. Thus, if we assume the state in generation g − 1 is given by the pair (s , m ), then the probability of spawning m new infectious nodes in generation g is generated by where the equality occurs as a result of the right side describing the probability of m infectious nodes in generation g assuming m such nodes at g − 1 from branching process theory. For a given state (s , m ) in generation g − 1, m new infections will result in s + m cumulative infections in generation g. So, having m new infections occurs with probability ψ g−1 s m P (m|s , m ), where the ψ g−1 s m term is the probability of being in the state (s , m ) at generation g − 1. Now, we can re-write the entire PGF for the state space of (s, m) at generation g as This defines a recurrence relation when g ≥ 1. Taking Ψ 0 0 = xy as the assumption that there is only one initial infectious individual, then ψ 0 sm = δ s1 δ m1 . Our primary focus in this paper will be on the distribution of cumulative infections s in each generation g. We derive a generating function for this quantity by taking the marginal distribution over y of Eq. (9). We let the coefficient p g s be defined as the probability of having s cumulative cases at generation g. To derive p g s , we wish to take the sum over all values of m for which the state s, m holds at generation g. To do so, we set the counting variable y of new cases simply equal to 1. As such, the coefficients p g s are generated by Now the generating function in Eq. (11) defines a probability distribution over s for each generation g, and is our main quantity under study. The analytical distributions are illustrated in Fig. 2 along with event-driven simulations to validate the theory.

B. Simulations of continuous SIR dynamics
For a realistic model of the spread of disease in a population, we simulate a stochastic disease process of an SIR epidemic on synthetic contact networks in continuous time [49]. We use an event-driven framework, which is advantageous for epidemic modeling, because it is much faster compared to a brute-force time-step simulation due to its leveraging of the Markovian dynamics of infectious and recovery periods of individuals [50][51][52]. Recall in the SIR model that nodes inhabit the susceptible, infectious, and recovered states as the disease progresses, where nodes become infected if one of their infectious neighbors transmits to them. The standard SIR model is governed by two rate parameters; β, the rate per unit time of an infectious node transmitting to other nodes, and γ, the rate per unit time of an infected node recovering. In a continuous time event-driven simulation, infection and recovery are Poisson processes occurring at rates β and γ respectively, and relate back to the percolation framework by defining transmissibility T = β/(β + γ).
We draw a random network from a given degree distribution, and begin the simulation algorithm by assuming a random initial infectious node, patient zero, with degree k 0 . Patient zero could either recover before transmitting to any of its neighbors, or infect one or more of its neighbor nodes. The stochastic process governing the behavior of a single infected node is the superposition of k + 1 Poisson processes, wherek is the number of susceptible neighbors, and with one extra process governing the time until recovery. Say patient zero infects Neighbor 1, who has k 1 neighbors. Then with two infectious nodes, the stochastic process encompassing all possible events is a Poisson process with rate (k 0 − 1)β +k 1 β + 2γ, and so on as more nodes become infected. Each possible event given by the sub-processes is the first to occur with probability i/(kβ+γ) where i ∈ {β, γ}, with the Poisson process rate term fromk reducing if an infection event occurs, and stopping entirely if the contagious node recovers. The disease process for the whole population is a natural extension of that described above, with each node assumed identical apart from degree. The evolution of the unmitigated disease process from here is intuitive, either eventually all the infectious nodes recover or the whole connected population becomes infected.
Computationally, the above process is simulated by generating a random network from a given degree distribution using a large enough number of nodes, N , such that average degree k N . As we cannot simulate numerically on an infinite network, the best choice for N is the largest value the numeric simulation can support. A node is randomly selected to be patient zero, and the disease spread proceeds via stochastic event-driven simulation, often known as the Gillespie algorithm [53]. Continuous time is tracked using a random variable τ , known as the waiting time, which is exponentially distributed with parameter the sum of the rates of all the potential infection and recovery events. Each competing process is the first to occur with probability of its own rate divided by the sum of all rates of that process type, as described by the Poisson process above. The simulation is advanced via this algorithm until either there are no more infectious nodes or until there are no more susceptible nodes, and allows for obtaining the resulting evolution of the disease spread in terms of both generations of infection and continuous time.

III. RESULTS
We employ the generational size distribution theory to explore the evolution of epidemic size on a variety of network structures, and compare the generating function theory against continuous-time simulations. We use the event-driven simulation framework so that we can track the progression of the epidemic in both continuous time as well as the generation sizes corresponding with the branching process, which allows us to validate the theoretical distributions, as well as introduce a preliminary prediction for the expected continuous time emergence of successive generations. Then, we use the PGF framework to measure the probability of an epidemic surviving, or continuing on, past an arbitrary generation, depending on the characteristics of the network and disease.

A. Time evolution on homogeneous and heterogeneous networks
In Fig. 2 we show the probability distributions of cumulative infections by the specific generation for two network models. It is noteworthy that this modeling method holds for configuration model networks with varying types of degree distributions. Here, we show the results on a modified power law network and an Erdős-Rényi (ER) network both used in Ref. [46]. The ER network has mean degree and excess degree k = q = 2.5, while the modified power law has mean degree k = 1.79 and average excess degree q = 3.04, a more heterogeneous distribution. We demonstrate that the distributions of outbreak size appear to be more a result of the stochastic nature of the disease spread, rather than the structure of the network, though the structure does play a role in the shape of the distribution.
Our results convey that there is not one clear trajec-tory of a typical large outbreak, in contrast to traditional results with deterministic modeling. Instead, the stochastic nature of epidemic size is captured by a long tail in the distribution of cumulative cases over each epidemic generation. One unique aspect of this paper is that we validate this result using continuous-time simulations showing the same shape and long tail in outbreak size distributions as our analytical results. We do anticipate the simulated distributions and analytical distributions to vary from each other due to a few factors including the finite-size effects of simulated networks, and the fact that we compare a discrete analysis with a continuoustime process, but the general behavior appears consistent throughout the different generations.
We also find that on both the heterogeneous network and the homogeneous network, there is a high probability of an outbreak going extinct before growing large, however, if it does take off, the distribution levels off over the space of epidemic size. That is to say, if indeed an epidemic takes off and has arrived at generation six, via a transmission chain of length six, there is an almost equal probability of having anywhere from 50 to 500 cumulative cases by the time generation six is reached. We emphasize that these results display the unpredictability in early stages of epidemics, even ignoring the difficulty of estimating model parameters, it is near impossible to infer with much confidence how many infections there may actually be in the population.

B. Generations of infection in continuous time
While the behavior of the epidemic in our formalism is described by generations of infection, most applications of disease models desire descriptions of the dynamics in continuous time. We find early agreement from our model of generational infections with a distribution in continuous time, described in terms of the expected time of emergence of an arbitrary generation g. The agreement is surprising since one might not expect a consistent relationship between a generation number and the expected time of its emergence given the observed heterogeneity of early spread in Fig 2. Yet, by defining the emergence of generation g as the time its first member is infected, we find a simple linear relationship that allows us to map the PGF framework to continuous time.
We can show that the expected time of emergence of an arbitrary generation g is given by where q = G 1 (1) is the average excess degree of the network. We arrive at this expression for E[t(g)] via a simple argument over the Poisson process governing how nodes in generation g−1 can lead to the first cases of generation g. Each node of generation g − 1 can recover at rate γ but also has on average q neighbors they can infect at rate β. Therefore, the first event around them will occur lines) correspond to increments of g/ q β, the predicted generational emergence times, and the bottom tick marks (and solid vertical lines) correspond to the average empirical time at which that generation g emerged, for an example network. If the average time of emergence was greater than its respective g/ q β value, that is, after the predicted time, the difference is highlighted in green. If the average empirical time was less than that predicted, the difference is highlighted in yellow.
at a combined rate α = q β +γ and will lead to a case in generation g with probability T q = q β/( q β + γ). The first infectious node in generation g −1 can therefore lead to the emergence of generation g after 1/α with probability T q ; if not, or the second node in generation g − 1 could lead to the emergence of generation g with probability T q (1 − T q ) after 2/α (approximate delay between the first and second node of generation g − 1 plus the expected time to generation g); and so on for the third node and beyond. This sequence of possibilities can be summarized by an arithmetico-geometric sum, In Fig. 3, we demonstrate in practice how the expected time of emergence of consecutive generations falls in line with the predicted time measure. To show intuitively why we see this phenomenon, we show the time evolution of the active epidemic generations. We track time in two ways; in continuous time following the event-driven process discussed in Sec. II B, and also in terms of the FIG. 4. Probability of epidemic survival as a function of contact structure. The contour plot shows the initial probability of epidemic survival for negative binomial distributions of infections over a range of possible R0 values (average transmissions per case) and dispersion parameter k (inverse of heterogeneity). The box highlights estimates for COVID-19 based on data from Wuhan, China [54]. We assume an epidemic generation of g = 4 and s = 16 cases which corresponds to the epidemic growing from 1 case to 16 over 4 generations. Using a serial interval of 4 days, the average of the estimated range for COVID-19 [55], this tracks to roughly over two weeks of spread. Similarly, in the state of Washington, the first recorded case of COVID-19 occurred on January 21st, 2020 but following cases were only identified on February 19th and increased to 18 by March 2nd. This figure illustrates how these cumulative case data could have been used in real time with our theoretical tools to estimate epidemic risk. expected time of emergence of each generation g, in the form t = g/ q β. We define a generation to be active if it contains one or more nodes who are not recovered and have susceptible neighbors at time t in the simulation. We illustrate the number of total and active generations over time, as well as the number of active nodes belonging to each generation, which helps clarify the roles each generation plays in causing the next wave of infection over a given interval in continuous time.
Having an understanding of the time at which a generation will emerge acts as a complement to the probabilities of extinction and cumulative cases discussed in Sec. III A and III C. Equipped with the distributions describing the stochasticity of outbreaks, the expected time mapping can be a tool for analysis of the dynamics of the worst-case scenarios when an outbreak does occur.

C. Probability of pandemics or stochastic extinction
The PGF generational theory can also be used to measure the probability that an emerging epidemic has a chance of dying off on its own, or "surviving". Deterministic models always predict that an epidemic will occur if R 0 > 1, that is, if the average number of secondary infections caused by an infectious individual is more than one. In reality, there is a non-zero chance the outbreak will die off by chance, shown in Fig. 4. Branching process models have been used in theoretical epidemiology for estimating such probabilities [56][57][58]. However, simple branching process models are Markovian in the number of active infections, m. This is problematic in an applied setting as cumulative cases, s, are often the available data. Moreover, we show that conditioned on reaching generation g, the probability of the outbreak going extinct after generation g rather than becoming an epidemic is path dependent in the sense that the value of s at g changes the extinction probability, shown in Fig. 5.
To utilize the extinction probabilities, we want to look specifically at the variable ρ g s , the probability that given s cumulative cases at generation g the epidemic will go extinct, or die off, sometime afterwards. Given that the evolution of m occurs as a branching process with the offspring PGF given by Eq. (6), one can easily compute the probability of extinction of a single infection chain, p e , as the solution of p e = G 1 (p e ; T ) using branching process theory [38]. The distribution of probabilities of reaching (s, m) in the state space for each g is given by ψ g sm , as discussed in Section II A. We define a new distribution, that of the probability of the outbreak still being in existence in generation g, bỹ Thus, ρ g s , the probability of the epidemic going extinct given it has arrived at s cases by generation g is given by The probability of epidemic survival for an epidemic being active in generation g with s cumulative infections is then given by 1 − ρ g s . We illustrate an example of how the survival probabilities change depending on the underlying network and disease parameters in Fig. 4.

D. Epidemic probability and COVID-19 data
We now apply the epidemic survival probability theory to early incidence of COVID-19 cases in the US. This allows us to look at the evolution over time of public health risk, while taking into account the stochastic elements of the early spread. We assume a distribution of secondary infections parameterized as a negative binomial with R 0 , the basic reproductive number, and k, the dispersion parameter of the contact network [54]. Together, these parameters determine the average behavior of disease spread where k is responsible for the variation in secondary cases, in turn affecting the likelihood of superspreading events [59][60][61]. A low dispersion parameter k (high heterogeneity) means that a select few cases may cause the majority of secondary infections [62], which in our framework here might correspond to a single case leading to an extreme increase in cases in the next generation. For that reason, it is often assumed that the early spread of an epidemic is highly sensitive to superspreading events [63]. Yet, as shown in Fig. 2, heterogeneity in contact structure actually has less of an impact on the distribution of outcomes than the inherent stochasticity of transmission.
In Fig. 4 we show the probability of epidemic survival (that is, the probability of an epidemic continuing to grow) with a fixed generation g = 4 and fixed cumulative cases s = 16 over a range of R 0 and k values, highlighting parameter estimates for COVID-19 [62]. Despite the relatively low number of cases after several generations, clearly affected by the lack of testing resources at the time, the chances of the epidemic stochastically dying out were already close to a simple coin flip. In Fig. 5, we show the inverse problems: fixing disease parameters and varying temporal variables. We set R 0 = 2.5 and k = 0.1, falling within the range of values for COVID-19, and track seven US states over time to observe where their disease progression state falls in the probability space of epidemic survival.
Guided by the results shown in Fig. 3, we proceed knowing that our model predicts generations to emerge in linear increments of time. We use the serial interval of 4 days, taken from the window for COVID-19 [55] to correspond with successive generational emergence. We observe that several states hovered around a low probability of epidemic survival at low early cases, but very quickly crossed to a much higher bracket where natural extinction of the disease spread is virtually impossible. The states of Washington and Massachusetts each took only two generations to cross from sub to supercritical epidemic survival probability, even derived from limited data and poor testing at the time. The extraordinary leap in epidemic probability from just one generation to the next explain, in part, why it was so hard for public health systems to react and adapt to the spread of COVID-19.

IV. DISCUSSION
Temporal models of disease spread often fall in one of three categories. (i) Compartmental models that are deterministic in nature as they rely on ordinary differential FIG. 5. Probability of epidemic continuing on as a function of case counts and time. As a simple comparison, we use early data from the COVID-19 pandemic and show a selection of U.S. states following unique timelines from the first recorded case onward. This simple visualization is not meant as a validation but only to explore how quickly our predictions for the probability of the epidemic not dying off changes as an epidemic grows. To calculate these probabilities, we use a negative binomial distribution of secondary infections with k = 10 −1 , R0 = 2.5 along with data from the COVID-19 Repository by the CSSE at Johns Hopkins [64,65]. The first data point for each state shown correspond to the first date on which 1 or more cases were recorded. Raw data of cumulative case counts are used, and plotted on the same range of epidemic generations for purposes of comparison, despite an evident variability in the duration of generation length. Using a serial interval of 4 days, progressive generations are shown along the horizontal axis (generation two corresponds to 8 days, for example). On the vertical axis, the cumulative case counts for each state are plotted. We see how a state's proclivity to the epidemic taking off changes over the course of successive generations. Several states such as California, Massachusetts, and Washington had a lower probability of epidemic survival early on, then crossed the band into a higher likelihood over a short time span. Although the data used in this figure does not take into account factors such as missing count data, it serves as a visualization of how sharply the interplay of generation of epidemic and cumulative cases demarcate the probability of the epidemic continuing. equations, where uncertainty only stems from our imperfect knowledge of model parameters, rather than from the inherent randomness of disease transmission. (ii) Complicated agent-based models that lose the tractability of analytical models, which require significant amount of data to parametrize and do not produce explicit likelihood of outcomes. (iii) Time series analyses that can produce probabilistic forecasts. This last approach can produce useful predictions by ignoring transmission mechanisms or contact structure, but that perspective also precludes it from evaluating potential interventions that affect individual parameters or contact structure.
In this paper, we have shown that analysis of branching processes often used to only study the final state of epidemic models can actually combine the strengths of these different approaches by including stochasticity, contact heterogeneity and even individual characteristics [33,39,66]. The reason this framework is usually used to solely predict the probability and final size of an epidemic is that the mathematical treatment involves integrating over contacts and therefore time [54]. However, we provided a first demonstration that the predictions made over generations by the branching process are actually very close approximation of continuous time epidemic dynamics on equivalent contact networks. This result alone justifies a large body of work and creates a foundation for analytical, probabilistic, epidemic forecasts based on PGFs.
Our probabilistic and temporal forecasts allowed us to uncover the diversity of epidemic courses, in the form of an unusually broad distribution of potential transmission trees over time. We have also shown that these flat distributions emerge on both homogeneous (e.g. Erdős-Rényi graphs) and heterogeneous (e.g. scale-free) contact networks. This phenomenon is therefore driven by the stochasticity of disease transmission rather than by the complexity of the contact structure. This broad likelihood of early disease incidence justifies our use of a stochastic branching process, whereas deterministic models would typically track only the average or expected number of cases which is a poor description of flat distributions.
Our framework currently rests on a few assumptions. By building our framework on a configuration model, we ignore potentially important structural correlations. The PGF framework itself can be extended, data permitting, to include such correlations like degree-degree assortativity [67,68], clustering [69,70], and more general structures [71,72]. All of these generalizations of the PGF framework still rely, at some level, on a treelike approximation, but this approach has been shown to capture most important network features [73].
We also assume that there are a finite number of active generations at any given time and that the distribution of contacts and transmission probability do not change over time. This first assumption was tested in Fig. 3 where we show that a simple network-based serial interval provides a reasonable approximation for time of emergence of epidemic generations in the continuous dynamics, illustrating both why and how we can align the generation-based branching process with the underlying temporal dynamics.
Our assumptions on the constant contact patterns and transmissibility provide a great road map for future work. In Eq. (1), we formulate our PGFs on a per generation basis, which would allow us to change these patterns over time to model adaptive behavior or top-down interventions (e.g. lockdowns limiting contacts or masks reducing transmissibility). Certain network interventions have been shown to alter the dynamics of epidemic outcomes in interesting ways, such as contact tracing [45,74] or vaccination roll-outs [75,76]. Specifically, when interventions are targeted around key individuals (e.g. hubs [77]) or affect different subset of the population differently [66], one can see the emergence of smeared transitions when epidemics mostly spread in specific subgraphs with subcritical spillover in other populations [78]. Modeling interventions under a generational PGF framework would provide probabilistic forecasts not only of disease dynamics but also of the impact and timing of particular interventions.
Importantly, our results on the diversity of epidemic courses highlight how little information can actually be gathered from early incidence data. In Fig. 2, we see that the same disease in the same population can be roughly as likely to produce 40 or 400 cases after 10 epidemic generations.
Finally, our results on epidemic survival show how quickly a situation can move from an uncertain outbreak to supercritical exponential growth. Due to both the randomness of disease spread and the imperfect COVID-19 testing protocols from early 2020, most states in the US moved from below 20% survival probability of the epidemic to above 80% in about two epidemic generations (2 weeks or less).
Altogether, our results stress the danger of justifying a lack of intervention with slow trends in early disease spread data. Little can be learned about transmission mechanisms and dynamics from the first few epidemic generations. The distribution of epidemic courses is mostly driven by the inherent randomness of transmission, and the window in which the dynamics settle into their subcritical or supercritical behavior tends to be unfortunately narrow, which leaves little room for fast adaptive responses.
Faced now with emergence of variants of COVID-19 around the world, the current situation is reminiscent of the scenario in the state of Washington during January of 2020 -sporadic clusters of cases with an unclear growth trajectory. We see from the data in Washington, as well as many other states and countries, how quickly cases explode and what that means for the likelihood of controlling the epidemic without external intervention efforts. Slow initial disease growth does not preclude a rapid increase shortly thereafter.