Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 Edge-based compartmental modelling for infectious disease spread Joel C. Miller, Anja C. Slim and Erik M. Volz J. R. Soc. Interface published online 5 October 2011 Supplementary data "Data Supplement" http://rsif.royalsocietypublishing.org/content/suppl/2011/10/04/rsif.2011.0403.DC1.htm l References This article cites 45 articles, 9 of which can be accessed free http://rsif.royalsocietypublishing.org/content/early/2011/10/04/rsif.2011.0403.full.html# ref-list-1 Article cited in: http://rsif.royalsocietypublishing.org/content/early/2011/10/04/rsif.2011.0403.full.html#related-url s P<P Published online 5 October 2011 in advance of the print journal. Subject collections Articles on similar topics can be found in the following collections biomathematics (321 articles) Email alerting service Receive free email alerts when new articles cite this article - sign up in the box at the top right-hand corner of the article or click here Advance online articles have been peer reviewed and accepted for publication but have not yet appeared in the paper journal (edited, typeset versions may be posted when available prior to final publication). Advance online articles are citable and establish publication priority; they are indexed by PubMed from initial publication. Citations to Advance online articles must include the digital object identifier (DOIs) and date of initial publication. To subscribe to J. R. Soc. Interface go to: http://rsif.royalsocietypublishing.org/subscriptions Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 J. R. Soc. Interface doi:10.1098/rsif.2011.0403 Published online Edge-based compartmental modelling for infectious disease spread Joel C. Miller1,2,*, Anja C. Slim and Erik M. Volz3 1 Center for Communicable Disease Dynamics, Department of Epidemiology, Harvard School of Public Health, Boston, MA 02115, USA 2 Fogarty International Center, National Institutes of Health, Bethesda, MD 20892-2220, USA 3 Department of Epidemiology, University of Michigan, Ann Arbor, MI 48109-2029, USA The primary tool for predicting infectious disease spread and intervention effectiveness is the mass action susceptible – infected – recovered model of Kermack & McKendrick. Its usefulness derives largely from its conceptual and mathematical simplicity; however, it incorrectly assumes that all individuals have the same contact rate and partnerships are fleeting. In this study, we introduce edge-based compartmental modelling, a technique eliminating these assumptions. We derive simple ordinary differential equation models capturing social heterogeneity (heterogeneous contact rates) while explicitly considering the impact of partnership duration. We introduce a graphical interpretation allowing for easy derivation and communication of the model and focus on applying the technique under different assumptions about how contact rates are distributed and how long partnerships last. Keywords: infectious disease; network; edge-based compartmental model recipient is susceptible. Recovery to an immune state happens at rate g. The flux of individuals from susceptible to infected to recovered is represented by a flow diagram (figure 1), making the model conceptually simple. This leads to a simple mathematical interpretation, the low-dimensional, ordinary differential equation (ODE) system 1. INTRODUCTION The conceptual and mathematical simplicity of Kermack & McKendrick’s [1,2] mass action susceptible – infected – recovered (SIR) model has made the model the most popular quantitative tool to study infectious disease spread for over 80 years. However, it ignores important details of the fabric of social interactions, assuming homogeneous contact rates and negligible partnership duration. Improvements are largely ad hoc, spanning the range between mild modifications of the model and elaborate agent-based simulations [2 – 7]. Increased complexity allows us to incorporate more realistic effects, but at a price. It becomes difficult to identify which variables drive disease spread or to address sensitivity to changing the underlying assumptions. In this study, we show that shifting our attention to the status of an average partner rather than an average individual yields a surprisingly simple mathematical description, expanding the universe of analytically tractable models. This allows epidemiologists to consider more realistic social interactions and test sensitivity to assumptions, improving the robustness of public health recommendations. We motivate our approach using the standard mass action (MA) SIR model. We are interested in the susceptible S(t), infected I(t) and recovered R(t) proportions of the population as time t changes. Under MA assumptions, an infected individual causes new infections at rate b^ SðtÞ, where b^ is the per-infected transmission rate and S is the probability that the S_ ¼ b^IS; and _ ¼ gI : R The dot denotes differentiation in time. An ODE system allows for easy prediction of details such as early growth rates, final sizes and intermediate dynamics. Using S þ I þ R ¼ 1, we re-express this as S_ ¼ b^IS; I ¼1S R and _ ¼ gI : R ð1:1Þ The product IS measures the proportion of partnerships that are from an infected individual to a susceptible individual. The MA model often provides a reasonable description of epidemics; however, it has well-recognized flaws, which cause the frequency of infected to susceptible partnerships to vary from IS. We highlight two. It neglects both social heterogeneity, variation in contact rates which can be quite broad [8,9], and partnership duration, implicitly assuming all partnerships are infinitesimally short. Because of these omissions, model predictions can differ from reality. For example, owing to social heterogeneity, early infections tend to have more partnerships [10] and may cause more infections than ‘average’ individuals, enhancing the early spread over that predicted by the MA model [11– 15]. When partnership duration is significant, an infected individual may have already infected its partners, reducing its *Author for correspondence ( joel.c.miller.research@gmail.com). Electronic supplementary material is available at http://dx.doi.org/ 10.1098/rsif.2011.0403 or via http://rsif.royalsocietypublishing.org. Received 22 June 2011 Accepted 13 September 2011 I_ ¼ b^IS gI 1 This journal is q 2011 The Royal Society Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 2 Edge-based compartmental modelling ^ S b IS I gI J. C. Miller et al. R Figure 1. Mass action flow diagram. The flux of individuals from susceptible to infected to recovered for the standard mass action model. Each compartment accumulates and loses probability at the rates given on the arrows. (Online version in colour.) ability to cause new infections. Because of these assumptions, the MA model predicts the same results for a sexually transmitted disease in a completely monogamous population, a population with serial monogamy, and a population with wide variation in contact levels with mean one. Intuitively, we expect these to produce dramatically different epidemics, but no existing mathematical theory allows analytical comparisons. Over the past 25 years, attempts have been made to eliminate these assumptions without sacrificing analytical tractability. With few exceptions (notably Volz & Meyers [16]), these make an ‘all-or-nothing’ assumption about partnership duration: partnerships are fleeting and never repeated or they never change. With fleeting partnerships, social heterogeneity is introduced by adding multiple risk groups to the MA model: in extreme cases, there are arbitrarily many subgroups (the mean field social heterogeneity model) [2,17– 20]. This model is relatively well understood and can be rigorously reduced to a handful of equations. With permanent partnerships, social heterogeneity is introduced through static networks [12– 14,21,22]. Static network results typically give the final size but no dynamic information. Some attempts to predict dynamics with static networks use pair approximation techniques [23] relying on approximation of network structures. More rigorous approaches avoid these approximations, but are more difficult [24– 27]. Of these, only Volz [24] yields a closed ODE system, (see also [28,29]). This model lacks an illustration like figure 1, hampering communication and further development. Finite, non-zero partnership duration is typically handled through simulation, which is often too slow to effectively study parameter space. Although no coherent mathematical structure to study social heterogeneity and partnership duration exists, there have been studies collecting these data in real-world contexts [9,10,30,31]. Typically, the resulting measurements have been reduced to average contact rates to make the mathematics tractable. Much of the available and potentially relevant detail is therefore discarded because existing models cannot capture the detail collected. We find that the appropriate perspective allows us to develop conceptually and mathematically simple models that incorporate social heterogeneity and (arbitrary) partnership duration. This provides a unifying framework for existing models and allows an expanded universe of models. Our goal in each case is to calculate the susceptible, infected or recovered proportions of the population, but we find that this can be answered more easily using an equivalent problem. We ask the question, ‘what is the probability that a randomly chosen test node u is susceptible, infected or recovered?’ Because u is chosen randomly, the probability that J. R. Soc. Interface u is susceptible equals the proportion susceptible S(t), and similarly for I and R. If we know S(t), then the _ ¼ gI , I ¼ 1 2 S 2 R determine initial conditions and R I(t) and R(t) as in equation (1.1). The probability that u is susceptible is the probability that no partner has ever transmitted infection to u. The method to calculate this is the focus of this study. This probability depends on how many partners u has, the rate its partners change, and the probability that a random partner is infected at any given time. Because a random partner is likely to have more partners than a random individual, knowing the infected fraction of the population does not give the probability that a partner of u is infected. We focus on the probability that a random partner is infected rather than the probability a random individual is infected. Once we calculate this, it is straightforward to calculate that the probability u is susceptible. The resulting edge-based compartmental modelling approach significantly increases the effects we can study compared with MA models, but with only a small complexity penalty. In this study, we consider the spread of epidemics in two general classes of networks: actual degree networks (based on configuration model networks [32 – 34]) and expected degree networks (based on mixed Poisson network; commonly called Chung-Lu networks [35 – 37]). In both cases, we can consider static and dynamic networks. In actual degree networks, a node is assigned k stubs where k is a random non-negative integer assigned independently for each node from some probability distribution. Edges are created by pairing stubs from different nodes. In expected degree networks, a node is assigned k, where k is a random non-negative real number. Edges are assigned between two nodes u and v with probability proportional to kukv. We develop exact differential equations for the large population limit, which we compare with simulations. Detailed descriptions of the simulation techniques are given in the electronic supplementary material. For many assumptions about population structure, the equations we derive are equivalent to those found by others. These previous equations have not been widely used. We speculate that this is because the derivation underlying the earlier equations are not for the faint of heart, and consequently the models have been conceptually difficult as well. The main result of this study is a conceptual shift, after which the derivations become straightforward, and the equations become simpler. We summarize the populations we consider in table 1. We begin by analysing the simplest edge-based compartmental model in detail, exploring epidemic spread in a static network of known degree distribution, a configuration model (CM) network. To derive the equations, we introduce a flow diagram that leads to a simple mathematical formulation. We next consider disease spreading through dynamic actual degree networks and then static and dynamic expected degree networks. The template shown here allows us to derive a handful of ODEs for each of these populations. Unsurprisingly, the stronger our assumptions, the simpler our formulation becomes. We neglect heterogeneity within the population other than the contact rates, assume that the disease has a Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 Edge-based compartmental modelling J. C. Miller et al. 3 Table 1. Populations to which we apply edge-based compartmental models. model population structure section configuration model (CM) static network with specified degree distribution, assigned using the probability mass function P(k). dynamic network for which each node’s degree remains a constant value, assigned using P(k). dynamic fixed-degree network incorporating gaps between partnerships; a node may wait before replacing a partner. static network with specified distribution of expected degrees k assigned using the probability density function r(k). dynamic network with degrees varying in time with averages assigned using r(k). population with a distribution of contact rates assigned using P(k) or r(k) and negligible partnership duration. 2 dynamic fixeddegree (DFD) dormant contact (DC) mixed Poisson model (MP) dynamic variabledegree (DVD) mean field social heterogeneity (MFSH) 3.2 3.3 4.1 4.3 3.1 and 4.2 very simple structure and assume that the population is at statistical equilibrium prior to disease introduction. 2. CONFIGURATION MODEL EPIDEMICS We demonstrate our approach with CM networks. A CM network is static with a known degree distribution (the distribution of the number of partners). We create a CM network with N nodes as follows: we assign each node u its degree ku with probability P(ku) and give it ku stubs (half-edges). Once all nodes are assigned stubs, we pair stubs randomly into edges representing partnerships. The probability a randomly selected node u has degree k is P(k). In contrast, the probability a stub of u connects to some stub of v is proportional to kv. So the probability a randomly selected partner (or neighbour) of u has degree k is Pn ðkÞ ¼ kPðkÞ : kK l See earlier studies [15,38] for more detail. A sample CM network is shown in figure 2. We assume that the disease transmits from an infected node to a partner at rate b. If the partner is susceptible, then it becomes infected. Infected nodes recover at rate g. Throughout, we assume a large population, a small initial proportion infected, a small initial proportion of stubs belonging to infected nodes and a growing outbreak. Our equations become correct once J. R. Soc. Interface Figure 2. A sample configuration model network. Half the nodes have degree 3 and half degree 1. Partners are chosen randomly. The probability a partner has degree 3 is three times the probability it has degree 1. In general, the probability a partner has degree k is Pn(k) ¼ kP(k)/kKl. (Online version in colour.) the number of infections NI has grown large enough to behave deterministically, whereas the proportion infected I is still small. Until stochastic effects are unimportant, other methods such as branching process approximations [39] (which apply in large populations with small numbers infected) may be more useful. To calculate S(t), I(t) and R(t), we note that these are the probabilities that a random test node u is in each state. We calculate S(t) by noting that it is also the probability none of u’s partners has yet transmitted to u. We would like to treat each partner as independent, but the probability that one partner v has become infected is affected by whether another partner w of u has transmitted to u as u could infect v. Accounting for this directly requires considerable bookkeeping. A simpler approach removes the correlation by assuming that u causes no infections. This does not alter the state of u: the probabilities we calculate for u will be the proportion of the population in each state under the original assumption that u behaves as any other node, and so this yields an equivalent problem. Further discussion of this modification is given in the electronic supplementary material. We define u(t) to be the probability that a randomly chosen partner has not transmitted to u. Initially, u is close to 1. For large CM networks, partners of u are independent. So given its degree k, u is susceptible at time tP with probability s(k,u(t)) ¼ u(t)k. Thus, SðtÞ ¼ k PðkÞsðk; uðtÞÞ ¼ cðuðtÞÞ; where X cðxÞ ¼ PðkÞx k k is the probability generating function [40] of the degree distribution (such functions have many useful P properties, k1 , of which we use three: its derivative is k kPðkÞx P k2 kðk 1ÞPðkÞx and its second derivative is k c 0 (1) ¼ kKl). For many important probability distributions, c takes a simple form, which simplifies our examples. Combining with the flow diagram for S, I and R in figure 3, we have _ ¼ gI ; R S ¼ cðuÞ and I ¼ 1 S R: To calculate the new variable u, we break it into three parts: the probability that a partner v is susceptible at time t, fS; the probability that v is infected at Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 4 Edge-based compartmental modelling (a) fS = y ¢(q) y ¢(1) fI J. C. Miller et al. fR g fI bf I (b) gI S = y (q) I R 1−q Figure 3. Edge-based compartmental modelling for configuration model (CM) networks. The flow diagram for a static CM network. (a) The fS, fI and fR compartments represent the probability that a partner is susceptible, infected or recovered and has not transmitted infection. The 1 2 u compartment is the probability that it has transmitted. The fluxes between the f compartments result from infection or recovery of a partner of the test node and the fI to 1 2 u flux results from a partner transmitting infection to the test node. (b) S, I and R represent the proportion of the population susceptible, infected and recovered. We can find S explicitly, and I and R follow as in the mass action model. (Online version in colour.) time t but has not transmitted infection to u, fI; the probability that v has recovered by time t but did not transmit infection to u, fR. Then u ¼ fS þ fI þ fR. Initially, fS and u are approximately 1 while fI and fR are small (they sum to u 2 fS). The flow diagram for fS, fI, fR and 1 2 u (figure 3) shows the probability fluxes between these compartments. The rate an infected partner transmits to u is b; so the fI to 1 2 u flux is bfI. We conclude u_ ¼ bfI . To find fI, we will use fI ¼ u 2 fS 2 fR and calculate fS and fR explicitly. The rate at which an infected partner recovers is g. Thus the fI to fR flux is gfI. This is proportional to the flux into 1 2 u with the constant of proportionality g/b. As fR and 1 2 u both begin as approximately 0, we have fR ¼ g(1 2 u)/b. To find fS, recall a partner v has degree k with probability Pn(k) ¼ kP(k)/kKl. Given k, v is susceptible with probability uk21 (we disallow transmission from u; so k 2 1 nodes can infect v). A weighted average gives fS ¼ X k Pn ðkÞuk1 ¼ X kPðkÞ c 0 ðuÞ k1 : u ¼ k kK l c 0 ð1Þ 0 c ðu Þ g ð1 uÞ c0 ð1Þ b and u_ ¼ bfI : Thus our equations become 0 c ðuÞ þ gð1 uÞ; u_ ¼ bu þ b 0 c ð1Þ S ¼ cðuÞ and I ¼ 1 S R: R0 ¼ b kK 2 K l : b þ g kK l ð2:3Þ We want the expected final size if an epidemic occurs. We set u_ ¼ 0 in equation (2.1) and solve uð1Þ ¼ g b c 0 ðuð1ÞÞ þ b þ g b þ g c 0 ð1Þ ð2:4Þ 2.2. Example ð2:2Þ This captures substantially more population structure than the MA model with only marginally more complexity. This is the system of Miller [28] and is equivalent to that of Volz [24]. It improves on approaches of earlier studies [25,26], which require either O(M ) or O(M 2) ODEs, where M is the ( possibly unbounded) maximum degree. This derivation is simpler than Volz [24] because we choose variables with a conserved quantity, simplifying the bookkeeping. The edge-based compartmental modelling approach we have introduced forms the basis of our study. J. R. Soc. Interface One of the most important parameters for an infectious disease is its basic reproductive number R0, the average number of infections caused by a node infected early in an epidemic. When R0 , 1 epidemics are impossible, while when R0 . 1 they are possible, though not guaranteed. For this model, we find that R0 is (see the electronic supplementary material) ð2:1Þ and _ ¼ gI ; R 2.1. R0 and final size for u(1). If R0 . 1 then this has two solutions, the larger of which is u ¼ 1 (the pre-disease equilibrium). We want the smaller solution. The total fraction of the population infected in the course of an epidemic is R(1) ¼ 1 2 c(u(1)). These calculations of R0 and R(1) are in agreement with previous observations [11–13,41,42]. When R0 , 1, our approach breaks down: full details are given in the electronic supplementary material. Thus fI ¼ u fS fR ¼ u Depending on the network structure, some details will change. However, we will remain as consistent as possible. We consider a disease with b ¼ 0.6 and g ¼ 1. Figure 4 compares simulations with solutions to our ODEs using four different CM networks, each with 5 105 nodes and average degree kK l ¼ 5, but different degree distributions. In order from latest peak to earliest peak, the networks are: every node has degree 5, the degree distribution is Poisson with mean 5, half the nodes have degree 2 and the other half degree 8 and finally a truncated powerlaw distribution in which P(k) / k 2ne2k/40, where n ¼ 1.418. We see that the degree distribution significantly alters the spread, with increased heterogeneity leading to an earlier peak, but generally a smaller epidemic. Our predictions fit, while the MA model using b^ ¼ bkK l fails. Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 Edge-based compartmental modelling 0.8 0.35 mass action homogeneous Poisson bimodal truncated powerlaw mass action homogeneous Poisson bimodal truncated powerlaw 0.30 0.25 infections cumulative infections 1.0 0.6 0.4 J. C. Miller et al. 5 0.20 0.15 0.10 0.2 0 –5 0.05 0 5 t 10 0 –5 15 0 5 t 10 15 Figure 4. Configuration model (CM) example (§2.2). Model predictions (dashed) match simulated epidemics (solid) of the same disease on four CM networks with kKl ¼ 5 and 5 105 nodes, but different degree distributions. Each solid curve is a single simulation. Time is set so t ¼ 0 when there is 1% cumulative incidence. The corresponding mass action model (short dashes) based on the average degree does not match. (Online version in colour.) (a) (b) Figure 5. Sample mean field social heterogeneity network. (a) One moment in time and (b) an arbitrarily short time later. Half the nodes have degree 3 and the others degree 1. The degrees remain the same, but the edges are all changed. (Online version in colour.) 3. ACTUAL DEGREE MODELS For the CM networks, each node has a specific number of stubs. Edges are created by pairing stubs, and no partner changes occur. In generalizing to dynamic ‘actual degree’ models, we assign each node a number of stubs, but allow edges to break and the freed stubs to create new edges. We consider three limits. In the first, the mean field social heterogeneity (MFSH) model, at every moment a stub is connected to a new partner. In the second, the dynamic fixed-degree (DFD) model, edges last for some time before breaking. When an edge breaks, the stubs immediately form new edges with stubs from other edges that have just broken. In the third, the dormant contact (DC) model, we assume edges break as in the DFD model, but stubs wait before finding new partners. 3.1. Mean field social heterogeneity For the MFSH model, the number of stubs k an individual has is assigned using the probability mass function P(k). At each moment in time, all stubs are rewired to form new edges. A sample network at two times is shown in figure 5. We analyse the MFSH model similarly. We take u as the probability a stub has never transmitted infection to the test node u from any partner. To define fS, fI and fR, we require that the stub has not transmitted infection to u and additionally the current partner is J. R. Soc. Interface susceptible, infected or recovered. As at each moment an individual chooses a new partner, the probability of connecting to a node of a given status is the proportion of all stubs belonging to nodes of that status. We must track the proportion of stubs that belong to susceptible, infected or recovered nodes pS, pI and pR. Because of the rapid turnover of partners, we find that fS is the product of the probability that a stub has not transmitted u with the probability it has just joined with a susceptible partner pS so fS ¼ upS. Similarly, fI ¼ upI and fR ¼ upR. We create flow diagrams as before in figure 6. The S, I and R diagram is unchanged, but the diagram for the f variables and 1 2 u changes. There are no fS to fI or fI to fR fluxes because of the explicit assumption that the partners associated with a single stub any two times are independent. The change in partner status is owing to ending and forming partnerships rather than infection or recovery of the partner. The flux into 1 2 u from fI is bfI as before. We need a new flow diagram for pS, pI and pR similar to that for S, I and R. Stubs belonging to infected nodes become stubs belonging to recovered nodes at rate g, thus p_ R ¼ gpI . We calculate pS explicitly: the probability a stub belongs to a node of degree k is the node is susceptible is uk. Pn(k), and the probability P A weighted average kPn(k)uk gives pS ¼ uc 0 (u)/c 0 (1). Finally, pI ¼ 1 2 pS 2 pR. Combining these observations p_ R ¼ gpI ¼ gfI =u ¼ ðg=bÞu_ =u. So, pR ¼ 2( g/b) ln u (the constant of Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 6 Edge-based compartmental modelling J. C. Miller et al. (a) (b) f S = qp S f I = qp I gI S = y (q) f R = qp R bf I pS= I qy ¢(q) y ¢(1) pI R g pI pR 1−q Figure 6. Mean field social heterogeneity model. The flow diagram for the MFSH model (actual degree formulation). Because partnerships are durationless, partners do not change status while joined to a node; so there is no flux between the f variables (a). The new variables pS, pI and pR (bottom, b) represent the probability that a randomly selected stub belongs to a susceptible, infected or recovered node. We can find pS in terms of u and then solve for pI and pR in much the same way we solve for I and R in the configuration model. We then find that each f variable is u times the corresponding p variable. (Online version in colour.) stubs belong to each class: P(1) = 25/31, P(5) ¼ 5/31 and P(25) = 1/31. Thus integration is 0). We have c ðuÞ g ln u þ pI ¼ 1 pS pR ¼ 1 u 0 c ð1Þ b 0 cðxÞ ¼ and u_ ¼ bupI . Thus u2 c 0 ðuÞ ug ln u; u_ ¼ bu þ b 0 c ð1Þ ð3:1Þ and 25x þ 5x 5 þ x 25 : 31 We set b ¼ g ¼ 1 and compare a simulation in a population of 5 105 with theory in figure 7. 3.2. Dynamic fixed-degree _ ¼ gI ; R S ¼ cðuÞ and I ¼ 1 S R: ð3:2Þ The MFSH model has been considered previously [2,17 –20], with the population stratified by degree. Setting z to be the proportion of all stubs that belong to infected nodes (equivalent to pI above), the pre-existing system is S_ k ¼ bkSk z; and I_ k ¼ bkSk z gIk P kPðkÞIk ; z¼ k kK l where Sk and Ik are the probabilities a random individual with k partners is susceptible or recovered. A known change of variables reduces this to a few equations equivalent to ours. 3.1.1. R0 and final size We find R0 ¼ b kK 2 l ; g kK l ð3:3Þ consistent with previous observations [2]. The total proportion infected is R(1) ¼ 1 2 c(u(1)), where b uð1Þc 0 ðuð1ÞÞ : ð3:4Þ uð1Þ ¼ exp 1 c 0 ð1Þ g Full details are given in the electronic supplementary material. 3.1.2. Example We take a population with degrees 1, 5 and 25. The proportions are chosen such that an equal number of J. R. Soc. Interface The DFD model interpolates between the CM and MFSH models. We assign each node’s degree k as before and pair stubs randomly. As time progresses, edges break. The freed stubs immediately join with stubs from other edges that break, a process we refer to as ‘edge swapping’. The rate an edge breaks is h. A sample network at two times is shown in figure 8. We develop flow diagrams (figure 9) as before. The S, I and R diagram is unchanged. We again track the probabilities pS, pI and pR that a random stub belongs to a susceptible, infected or recovered node, respectively. The diagram is unchanged. The diagram for u and the f variables changes: we have fluxes from fS to fI and fI to fR representing infection or recovery of the partner as in the CM model, but we also have fluxes from fS to fS, fI or fR resulting from edge swapping. We have similar edge swapping fluxes from fI and fR. The flux into fS from edge swapping is hupS. The flux out of fS from edge swapping is hfS. Similar results hold for fI and fR. Our earlier techniques to find fI break down. We solve for fS and fI using ODEs. To complete the system, we need the fS to fI flux. Consider a partner v of our test node u such that: the stub belonging to u never transmitted to u and the stub belonging to v never transmitted to v prior to the u– v edge forming. Given P this, the probability v is susceptible is q ¼ k kPðkÞuk1 =kK l ¼ c0 ðuÞ=c0 (1). Thus, given that v is susceptible, v becomes infected at rate _ 00 ðuÞ=c 0 ð1Þ q_ uc c 00 ðuÞ ¼ : ¼ 0 bf I q c ðuÞ=c 0 ð1Þ c 0 ðuÞ Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 1.0 0.25 0.8 0.20 infections cumulative infections Edge-based compartmental modelling 0.6 0.4 0.2 0 J. C. Miller et al. 7 0.15 0.10 0.05 0 5 10 0 15 5 0 t 10 15 t Figure 7. Mean field social heterogeneity example (§3.1.2). Model predictions (dashed) match a simulated epidemic (solid) in a population of 5 105 nodes. The solid curve is a single simulation. Time is set so t ¼ 0 when there is 1% cumulative incidence. The degree distribution satisfies P(1) ¼ 25/31, P(5) ¼ 5/31 and P(25) ¼ 1/31. (Online version in colour.) (a) (b) Figure 8. Sample dynamic fixed-degree network. (a) One moment in time and (b) a short time later. When edges break, the nodes immediately form new edges with other nodes whose edges break simultaneously. In our simulations, edges break in pairs, but that is not required for the theory. Half of the nodes have degree 3 and the other half have degree 1. (Online version in colour.) hq hqp I hqp R S = y (q) hf S pS = qy ¢(q) y ¢(1) hf I hqp S hf R fS fI bf I f S y ¢¢(q) y ¢(q) fR g fI pI I g pI gI bf I 1−q pR R Figure 9. Dynamic fixed-degree (DFD) model. The flow diagram for the DFD model. Unlike the configuration model case, we cannot calculate fS explicitly, so we must calculate the fS to fI flux. (Online version in colour.) Thus the fS to fI flux is the product of fS, the probability that a stub has not transmitted infection to the test node and connects to a susceptible node, with bfIc 00 (u)/c 0 (u), the rate the node becomes infected given that the stub has not transmitted and connects to a susceptible node. This completes figure 9. The model requires more equations, but remains relatively simple: u_ ¼ bfI ; J. R. Soc. Interface ð3:5Þ 00 c ðuÞ þ hupS hfS ; f_ S ¼ bfI fS 0 c ðuÞ ð3:6Þ 00 c ðuÞ þ hupI ðb þ g þ hÞfI ; f_ I ¼ bfI fS 0 c ðu Þ p_ R ¼ gpI ; pS ¼ uc 0 ðuÞ c 0 ð1Þ pI ¼ 1 pR pS and ð3:7Þ ð3:8Þ Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 J. C. Miller et al. 1.0 0.12 0.8 0.10 infections cumulative infections 8 Edge-based compartmental modelling 0.6 0.4 0.2 0.08 0.06 0.04 0.02 0 –5 0 5 t 10 15 0 –5 20 0 5 t 10 15 20 Figure 10. Dynamic fixed-degree example (§3.2.2). Model predictions (dashed) match the average of 102 simulated epidemics (solid) in a population of 104 nodes. For each simulation, time is chosen so that t ¼ to 3% cumulative incidence. Then, they are 0 corresponds kþr 1 ð1 pÞr pk for r ¼ 4, p ¼ 1/3. (Online version averaged to give the solid curve. The degree distribution satisfies PðkÞ ¼ k in colour.) (a) (b) Figure 11. Sample dormant contact network. (a) One moment in time and (b) a short time later. Half the nodes have five stubs and the other half have two stubs. When edges break, the stubs become dormant. Dormant stubs can join together to form edges. (Online version in colour.) and _ ¼ gI ; R SðtÞ ¼ cðuÞ and I ðtÞ ¼ 1 S R: ð3:9Þ This is simpler than, but equivalent to, the model of Volz & Meyers [16]. 3.2.1. R0 and final size We find b h þ g kK 2 K l h : þ R0 ¼ ðb þ h þ g Þ g kK l g 3.3. Dormant contacts ð3:10Þ We do not find a simple expression for final size. Instead, we must solve the ODEs numerically. Full details are given in the electronic supplementary material. 3.2.2. Example We choose a population having negative binomial degree distribution NB(4,1/3) with size parameter r ¼ 4 and probability p ¼ 1/3. Thus PðkÞ ¼ kþr 1 ð1 pÞr pk . The mean is 2 and the vark iance 3. For negative binomial distributions, c(x) ¼ [(1 2 p)/(1 2 px)]r; so 4 2 cðxÞ ¼ : 3x J. R. Soc. Interface We take b ¼ 5/4, g ¼ 1 and h ¼ 1/2. The equations accurately predict the spread (figure 10). Our simulations are slower because we must track edges; so we have used smaller population sizes. To reduce noise, we perform 250 simulations, averaging the 102 that become epidemics. We finally generalize the DFD model, allowing stubs to enter a dormant phase after edges break. This is the most general model we present. It reduces to any model of this study in appropriate limits [43]. It is appropriate for serial monogomy where individuals to not immediately find a new partner. A node is assigned km stubs using the P probability mass function P(km). We take cðxÞ ¼ km Pðkm Þx km . A stub is dormant or active depending on whether it is currently connected to a partner. The maximum degree of a node is km and the ‘active’ and ‘dormant’ degrees are ka and kd, respectively, ka þ kd ¼ km. In addition to fS, fI and fR, we add fD denoting the probability that a stub is dormant and has never transmitted infection from a partner; so u ¼ fS þ fI þ fR þ fD. Active stubs become dormant at rate h2 and dormant stubs become active at rate h1. A sample network at two times is shown in figure 11. We now develop flow diagrams (figure 12). The diagram for S, I and R is as before. The diagram for u and Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 Edge-based compartmental modelling (a) h1 pS f D p h1f D fD (c) h2f S h2f I fS fI bf I f S y ¢¢(q) y ¢(q) g fI fR pS = f Dy ¢ (q) y ¢ (1) h2xS xS= (q – f D)y ¢ (q) y ¢(1) h1p S S = y (q) h1 p R f D p h1 p I f D p (b) h2(q – f D) J. C. Miller et al. 9 h2x I h2f R xI I gI bf I g xI pI h1p I g pI h2x R 1−q pR xR R h1p R Figure 12. Dormant contact model. A flow diagram accounting for the dormant stage. (a) Movement of stubs between different stages, including dormant. Stubs are classified by whether they have received infection and the status (or existence) of the current partner. (b) The flow of individuals between different states. (c) Movement of stubs between states with stubs classified based on the status of the node to which they belong. (Online version in colour.) the f variables is similar to the DFD model, but with the new compartment fD. The fluxes associated with edge breaking are at rate h2 times fS, fI or fR and go from the appropriate compartment into fD, for a total of h2(u 2 fD). To describe fluxes owing to edge creation, we generalize the definitions of pS, pI and pR to give the probability that a stub is dormant (and thus available to form a new partnership) and belongs to a susceptible, infected or recovered node, with p ¼ pS þ pI þ pR the probability a stub is dormant. The probability that a new partner is susceptible, infected or recovered is pS/p, pI/p and pR/p, respectively. The fluxes associated with edge creation occur at total rate h1fD, with proportions pS/p, pI/p and pR/p into fS, fI and fR, respectively. The flow diagram for the p variables is related to that for the DFD model, but we must account for active and dormant stubs. We use jS, jI and jR to be the probabilities that a stub is active and belongs to each type of node, with 1 2 p ¼ j ¼ jS þ jI þ jR the probability that a stub is active. The pS to jS and jS to pS fluxes are h1pS and h2jS, respectively. Similar results hold for the other compartments. We can use this to show j_ ¼ h2 j þ h1 p ¼ h2 j þ h1 ð1 jÞ from which we can conclude that (at equilibrium) p ¼ h2/ (h1 þ h2) and j ¼ h1/(h1 þ h2). The fluxes from jI and pI to jR and pR, respectively, represent recovery of the node the stub belongs to and so are gjI and gpI, respectively. We can calculate jS and pS explicitly. The probability a dormant stub belongs to a susceptible node is pS ¼ fDc 0 (u)/c 0 (1), where fD is the probability the dormant stub has never received infection, and c 0 (u)/c 0 (1) is the probability that none of the other stubs have received infection. Similarly, the probability that an active stub belongs to a susceptible node is jS ¼ (u 2 fD)c 0 (u)/c 0 (1). We can use pI ¼ p 2 pS 2 pR and jI ¼ j 2 jS 2 jR to simplify the system further. Our new equations are u_ ¼ bfI ; J. R. Soc. Interface ð3:11Þ 00 c ðu Þ pS þ h1 fD h2 fS ; f_ S ¼ bfI fS 0 c ðu Þ p ð3:12Þ 00 c ðuÞ pI þ h1 fD ðh2 þ b þ gÞfI ; ð3:13Þ f_ I ¼ bfI fS 0 c ðuÞ p f_ D ¼ h2 ðu fD Þ h1 fD ; ð3:14Þ 0 c ðuÞ j_ R ¼ h2 jR þ h1 pR þ gjI ; jS ¼ ðu fD Þ 0 c ð1Þ and jI ¼ j jS jR ; ð3:15Þ 0 p_ R ¼ h2 jR h1 pR þ gpI ; pS ¼ fD c ðu Þ c 0 ð1Þ and pI ¼ p pS pR ; h1 h2 j¼ and p ¼ h1 þ h2 h1 þ h2 ð3:16Þ ð3:17Þ and _ ¼ gI ; S ¼ cðuÞ and I ¼ 1 S R: R ð3:18Þ 3.3.1. R0 and final size We can show that R0 ¼ b b þ h2 þ g 2 kKm Km l h1 h2 þ g h1 h2 : þ g ðg þ h 1 þ h 2 Þ kKm l h1 þ h2 g ð3:19Þ However, we have not found a simple final size relation. Details are given in the electronic supplementary material. 3.3.2. Example In figure 13, we consider the spread of a disease through a network with dormant edges. The distribution of km is Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 10 Edge-based compartmental modelling J. C. Miller et al. 0.20 0.8 0.15 infections cumulative infections 1.0 0.6 0.4 0.10 0.05 0.2 0 –5 0 5 t 10 15 0 –5 0 5 t 10 15 Figure 13. Dormant contact example (§3.3.2). The average of 155 simulated epidemics in a population of 5000 nodes (solid) with a Poisson maximum degree distribution of mean 3 compared with theory (dashed). Simulations are shifted in time so that t ¼ 0 corresponds to 3% cumulative incidence and then averaged. Because stochastic effects are not negligible, the individual peaks are not perfectly aligned, so the averaging has a small, but noticeable, effect to reduce and broaden the simulated peak. As population size increases, this disappears. (Online version in colour.) Poisson with mean 3 cðxÞ ¼ e3ð1xÞ : The parameters are b ¼ 2, g ¼ 1, h1 ¼ g and h2 ¼ g/2. Simulations are again slow; so we use a smaller population with 322 simulations, and average the 155 that become epidemics. 4. EXPECTED DEGREE MODELS We now consider SIR diseases spreading through ‘expected degree’ networks. In these networks, each individual has an expected degree k, which need not be an integer. It is assigned using the probability density function r(k). Edges are placed between two nodes with probability proportional to the expected degrees of the two nodes. In the actual degree models, once a stub belonging to u was joined into an edge, it became unavailable for other edges: the existence of a u– v edge reduced the ability of u to form other edges. In contrast, for expected degree models, edges are assigned independently: a u– v edge does not affect whether u forms other edges. Similar to actual degree models, a partner will tend to have larger expected degree than a randomly chosen node. The probability density function for a partner to have expected degree k is rn(k) ¼ kr(k)/kKl. Our approach remains similar. We consider a randomly chosen test node u which cannot infect its partners, and calculate the probability that u is susceptible. We first consider the spread of disease through static ‘mixed Poisson’ (MP) networks (also called Chung-Lu networks), for which an edge from u to v exists with probability kukv/(N 2 1)kKl. We then consider the expected degree formulation of MFSH. Following this, we consider the more general dynamic variable-degree (DVD) model, for which a node creates and deletes edges as independent events, unlike the DFD model where deleted edges were instantly replaced. The MP model produces equations effectively identical to the CM equations. The MFSH equations differ somewhat from the actual degree version, but may be shown to be formally equivalent [43]. The DVD equations are simpler than the DFD equations, and it may be more J. R. Soc. Interface Figure 14. Sample mixed Poisson model network. Half the nodes have expected degree 3 and the other half 1.5. An edge is assigned between two nodes with probability proportional to the product of their expected degrees. (Online version in colour.) realistic because it does not enforce constant degree for an individual. 4.1. Mixed Poisson We now consider the MP model. In this model, each node is assigned an expected degree k using the probability density function r(k). A u– v edge exists with probability kukv/(N 2 1)kKl independently of other edges. We use the name ‘MP’ because at large N the actual degree of nodes with expected degree k is chosen from a Poisson distribution with mean k. The degree distribution is a mixture of Poisson distributions. An example is shown in figure 14. Consider two nodes u and v whose expected degrees are ku and kv ¼ ku þ Dk with Dk 1. Our question is, how much does the additional Dk reduce the probability that v is susceptible? At leading order, it contributes an extra edge to v with probability Dk, and we may assume it contributes at most one additional edge. We define Q to be the probability that an edge has not transmitted infection. With probability QDk there is an additional edge that has not transmitted. The probability the extra Dk either does not contribute an edge or contributes an edge that has not transmitted is 1 2 Dk þ QDk ¼ 1 2 (1 2 Q)Dk. If s(k,t) is the probability that a node of expected degree k is susceptible, then we have s(k þ Dk, t) ¼ s(k, t)[1 2 (1 2 Q)Dk]. Taking Dk ! 0, this becomes @ s/@ k ¼2(1 2 Q)s. Thus, Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 Edge-based compartmental modelling J. C. Miller et al. 11 (a) FS = y¢Q y ¢ (1) FI g FI FR b FI (b) gI S = y (Q) I R 1−Q Figure 15. Mixed Poisson (MP) model. (a) The flux of edges for a static MP network. (b) The flux of individuals through the different stages. (Online version in colour.) s(k,t) ¼ exp[2 k(1 2 Q)] and S(t) ¼ C(Q(t)), where ð1 CðxÞ ¼ ekð1xÞ rðkÞ dk: 0 Note that this is the Laplace transform of r evaluated at 12x. As before, figure 15 gives _ ¼ gI ; R S ¼ Cð Q Þ and I ¼ 1 S R; and we need Q(t). We follow the CM approach almost exactly. The value of Q is the probability that an edge has not transmitted to the test node u. We define FS, FI and FR to be the probabilities that an edge has not transmitted to u and connects to a susceptible, infected or recovered node; so Q ¼ FS þ FI þ FR. To calculate FS, we observe that a partner v of u with expected degree k has the same probability of having an edge to any w = u as any other node of expected degree k because edges are created independently of one another. Thus given k, v is susceptible with probability s(k,t). Taking the weighted Ð1 Ð 1 average over all k gives FS ¼ r ( k )s( k ,t)dt ¼ 0 n 0 k exp[2 k(1 2 Q)]r(k)dk/kKl ¼ C 0 (Q)/C 0 (1). The same techniques as for the CM networks give FR ¼ g(1 2 Q)/b. Our equations are 0 _ ¼ bQ þ b C ðQÞ þ gð1 QÞ; Q C 0 ð1Þ _ ¼ gI ; R S ¼ CðQÞ and I ¼ 1 S R: This is almost identical to CM epidemics except that C and Q replace c and u . This similarity is explained in [43]. 4.1.1. R0 and final size We find 2 R0 ¼ ^ l b kK ; b þ g kK l 2 ^ l is the average of k2 (which equals the averwhere kK 2 age of k 2 k) and kKl is the average of k (which equals the average of k). The total proportion infected by an epidemic is R(1) ¼ 1 2 C(Q(1)), where Qð1Þ ¼ g b C 0 ðQð1ÞÞ : þ b þ g b þ g C 0 ð1Þ Full details are given in the electronic supplementary material. J. R. Soc. Interface 4.1.2. Example We consider a population whose distribution of expected degrees satisfies 81 0k2 > <4 1 rðkÞ ¼ 20 10 k 20 > : 0 otherwise: Half the individuals have an expected degree between 0 and 2 uniformly, and the other half have expected degree between 10 and 20 uniformly. This gives CðxÞ ¼ 1 e20ðx1Þ e10ðx1Þ : e2ðx1Þ 1 þ 5 4ðx 1Þ We take b ¼ 0.15 and g ¼ 1, and perform simulations with a population of size 5 105 generated using the O(N ) algorithm of Miller & Hagberg [44]. We compare simulation and prediction in figure 16. 4.2. Mean field social heterogeneity For the expected degree formulation of the MFSH model, the probability that an edge exists between u and v at time t is kukv/(N 2 1)kKl. Whether this edge exists at one moment is independent of whether it exists at any other moment and what other edges exist. A sample network at two times is shown in figure 17. As before, we consider two nodes whose expected degrees differ by Dk and ask how much the additional Dk reduces the probability of being susceptible. The definition of Q is slightly more problematic here because having an edge at one moment is independent of having one later. So it does not make sense to discuss the probability that an edge did not transmit previously because the edge did not exist previously. Instead, we note that in the MP case, (1 2 Q)Dk could be interpreted as the probability that the additional amount of Dk ever contributed an edge that had transmitted infection. Guided by this, we define Q so that as Dk ! 0, the extra amount of Dk has at some time contributed an edge that transmitted to the node with probability (1 2 Q)Dk. This again leads to ð1 CðxÞ ¼ ekð1xÞ rðkÞdk: e Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 Edge-based compartmental modelling J. C. Miller et al. 1.0 0.10 0.8 0.08 infections cumulative infections 12 0.6 0.4 0.06 0.04 0.2 0 –5 0.02 0 5 10 15 0 –5 20 0 5 10 t 15 20 t Figure 16. Mixed Poisson (MP) example (§4.1.2). Model predictions (dashed) match a simulated epidemic (solid) in a MP network with 5 105 nodes. The solid curve is a single simulation. Time is chosen so that t ¼ 0 corresponds to 1% cumulative incidence. With probability 0.5, expected degrees are chosen uniformly from [0,2], and with probability 0.5 they are chosen uniformly from [10,20]. (Online version in colour.) (a) (b) Figure 17. Sample mean field social heterogeneity network. (a) One moment in time and (b) an arbitrarily short time later. Half the nodes have expected degree 4 and the others expected degree 1. All edges change, and the actual degree varies with time. (Online version in colour.) The flow diagram for S, I and R (figure 18) is unchanged: _ ¼ gI ; R S ¼ CðQÞ and I ¼ 1 S R: To find the evolution of Q, we define FS, FI and FR to be the probabilities that a current edge connects u to a susceptible, infected or recovered node, respectively. The probability that a small extra amount Dk currently contributes an edge and previously had a different edge that transmitted scales like Dk2(1 2 Q). As Dk2 Dk, this is negligible compared with the probability that there is a current edge. We conclude that at leading order, FSDk , FIDk and FRDk give the probability that the Dk contributes a current edge connected to a susceptible, infected or recovered node and there has never been a transmission owing to this extra Dk. We can construct a flow diagram between FS Dk , FIDk, FRDk and (1 2 Q)Dk. Because all of these have Dk in them, we factor it out to just use FS, FI, FR and 1 2 Q. Because edges have no duration, there is no FS to FI or FI to FR flux. Instead, there is flux in and out of these compartments representing the continuing change of edges. The FI to 1 2 Q flux is bFI. Because edges have no duration, the probability that an edge connects to an individual of a given type is the probability a new edge connects to an individual of that type: FS ¼ PS , FI ¼ PI and FR ¼ PR where PS, PI and PR are the probabilities that a newly J. R. Soc. Interface formed edge connects to a susceptible, infected or recovered node, respectively.1 We have PS ¼ C 0 (Q)/C 0 (1) _ =b. _ R ¼ gQ _ R ¼ gPI . As PI ¼ FI, this means P and P Integrating gives PR ¼ g (1 2 Q)/b. So PI ¼ 1 C 0 ðQÞ gð1 QÞ : b C0 ð1Þ _ ¼ bFI ¼ bPI , finally, we have Since Q 0 _ ¼ b þ b C ðQÞ þ gð1 QÞ; Q C 0 ð1Þ and _ ¼ gI ; R S ¼ CðQÞ and I ¼ 1 S R: Under appropriate limits, the MFSH equations in k reduce to those in k and vice versa; so the models are equivalent [43]. Surprisingly, this system differs from the _ equation. MP equations only in the first term of the Q 4.2.1. R0 and final size We find R0 ¼ ^ 2l b kK ; g kK l and the final size is R(1) ¼ 1 2 C(Q(1)), where Q(1) 1 Unlike the actual degree formulation, we do not need a factor of Q in these because the smallness of Dk allows us to assume that there has never been a previous transmission. Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 Edge-based compartmental modelling (a) J. C. Miller et al. 13 (b) gI S = y (Q) FI = PI FS = P S I R FR = PR b FI PS = 1−Q y ¢ (Q) y ¢ (1) PI g PI PR Figure 18. Mean field social heterogeneity (MFSH) model. The flow diagram for a MFSH population (expected degree formulation). This is similar to the actual degree formulation in figure 6. The new variables PS, PI and PR (bottom, b) represent the probability that a newly formed edge connects to a susceptible, infected or recovered node; they can be thought of as the relative rates at which each group forms edges. As the test node does not cause infections, and the probability that a partnership is with a node of a given k is equal to the probability that a new partner will be with a node of the given k, the probability that a current partner has a given state is equal to the probability that a new partner has that state. Thus each F variable equals the corresponding P variable. (Online version in colour.) 0.0007 0.0006 0.08 0.0005 infections cumulative infections 0.10 0.06 0.04 0.0004 0.0003 0.0002 0.02 0.0001 0 –100 –50 0 50 100 150 200 250 300 t 0 –100 –50 0 50 100 150 200 250 300 t Figure 19. Expected degree mean field social heterogeneity (MFSH) example (§4.2.2). Model predictions (dashed) match a simulated epidemic (solid) in a MFSH network with 15 106 nodes. The solid curve is a single simulation. Time is chosen so that t ¼ 0 corresponds to 0.5% cumulative incidence. Expected degrees are chosen with r(k) ¼ ek/(e3 21) for 0, k ,3. (Online version in colour.) solves Q¼ 0 b C ðQ Þ þ 1: 1þ 0 C ð1Þ g Full details are given in the electronic supplementary material. 4.2.2. Example For our example, we take a population with r(k) ¼ ek/ (e3 2 1) for 0 , k , 3 and 0 otherwise, giving CðxÞ ¼ e3x 1 : xðe3 1Þ We take g ¼ 1 and b ¼ 0.435 and compare simulation with theory in figure 19. We choose these parameters to demonstrate that the approach remains accurate for small R0 ¼ 1.04. We use a population of 15 106. There is noise as the epidemic does not infect a large number of people. 4.3. Dynamic variable-degree The DVD model interpolates between the MP model and the expected degree formulation of the MFSH model. Each node is assigned k using r(k) and creates edges at rate kh ( joining to another node also creating an edge). J. R. Soc. Interface Existing edges break at rate h. Thus, a node has expected degree k, though its value varies around k. In fact, it is Poisson-distributed over time. A sample network at two times is shown in figure 20. We define Q such that the probability that a small Dk has ever contributed an edge that has transmitted infection is (1 2 Q)Dk . We again have _ ¼ gI ; R S ¼ CðQÞ and I ¼ 1 S R: We generalize the earlier definitions and define FS, FI and FR to be the probabilities a current edge has never transmitted infection and connects to a susceptible, infected or recovered node. We define PS, PI and PR to be the probabilities a new edge connects to a susceptible, infected or recovered node. We have PS ¼ C 0 (Q)/C 0 (1), PI ¼ 1 2 _ R ¼ gPI . We build the flow diagram PS 2 PR and P for FSDk, FIDk, FRDk and (1 2 Q)Dk. There is flux into FSDk at rate hPSDk because this is the rate at which the Dk leads to edge creation. There is flux out of FSDk at rate hFSDk because existing edges break at rate h, and the probability that such an edge exists is FSDk. Similar fluxes exist for FI and FR. The flux out of FIDk into FRDk is gFIDk as before, and the flux into (1 2 Q)Dk is bFIDk. We factor out Dk and the flow diagrams (figure 21) are defined. Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 14 Edge-based compartmental modelling J. C. Miller et al. (a) (b) Figure 20. Sample dynamic variable-degree network. (a) One moment in time and (b) a short time later. The formation or deletion of an edge has no impact on other edges. Half the nodes have expected degree 4 and the other half 1. (Online version in colour.) hP S hF S hP I hF I hP R hF R S = y (Q) y ¢ (Q) FS = y ¢ (1) FI g FI I gI R FR b FI PS = y ¢ (Q) y ¢ (1) PI g PI PR 1−Q Figure 21. Dynamic variable-degree (DVD) model. The flow diagrams for the DVD model. (Online version in colour.) Because the existence of an edge from the test node u to the partner v has no impact on any other edges v might have, the partners v has—aside from u—are indistinguishable from the partners of another node with the same k, and so they are susceptible with the same probability: FS ¼ PS. The fluxes into and out of FS from edge creation–deletion balance, and the FS to FI flux is simply Ḟ S . Using this and the other fluxes for FI, we conclude Ḟ I ¼ Ḟ S þhPI ðh þ g þ bÞFI . As Ṗ R ¼ gPI and Q̇ ¼ bFI , we can integrate this and find FI ¼ C 0 ðQÞ h ðb þ h þ gÞ hþg þ PR þ Q : C 0 ð1Þ b g b previous transmission occurred for the Dk, whereas for a discrete stub, we cannot neglect previous transmission. 4.3.1. R0 and final size We find R0 ¼ ^ 2l b h þ g kK ; b þ h þ g g kK l The total proportion infected is R(1) ¼ 1 2 C(Q(1)), where b h þ g C 0 ðQð1ÞÞ h þ g h þ Qð1Þ ¼ : bþhþg g b g C 0 ð1Þ _ ¼ bFI can be written in terms of Q and PR. We So Q arrive at Full details are given in the electronic supplementary material. C 0 ðQ Þ þ gð1 QÞ Q̇ ¼ bQ þ b 0 C ð1Þ b þ h 1 Q PR ; g C 0 ðQ Þ and Ṗ R ¼ gPI ; PS ¼ 0 C ð1Þ 4.3.2. Example We choose the same distribution of k as of k in the DFD example, NB(4,1/3). We find 4 2 CðxÞ ¼ : 3 ex1 ð4:1Þ ð4:2Þ PI ¼ 1 PS PR and _ ¼ gI ; R S ¼ CðQÞ and I ¼ 1 S R: ð4:3Þ This is simpler than the DFD case because the arbitrary smallness of Dk allowed us to assume that no J. R. Soc. Interface We take the same parameters b ¼ 5/4, g ¼ 1 and h ¼ 1/2. Figure 22 shows that the equations accurately predict the spread. As in the DFD and DC case, we use an average as the comparison point, taking 240 simulations and averaging the 92 resulting in epidemics. The final size is larger than for the DFD model. Although the average numbers of partners are all the Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 Edge-based compartmental modelling 0.8 infections cumulative infections 1.0 0.6 0.4 0.2 0 –4 –2 0 2 4 6 8 10 0.16 0.14 0.12 0.10 0.08 0.06 0.04 0.02 0 –4 –2 0 t 2 4 J. C. Miller et al. 6 8 15 10 t Figure 22. Dynamic variable-degree example (§4.3.2). Model predictions (dashed) match the average of 92 simulated epidemics (solid) in a population of 104 nodes. For each simulation, time is chosen so that t ¼ 0 corresponds to 3% cumulative incidence. Then, they are averaged to give the solid curve. k is chosen from the same distribution as k in figure 10. (Online version in colour.) same, the increase in transmission routes when an individual has more partners than expected outweighs the decrease when the number is less than expected. The net effect is to increase the final size. 5. DISCUSSION We have introduced a new approach to study the spread of infectious diseases. This edge-based compartmental modelling approach allows us to simultaneously consider the impacts of partnership duration and social heterogeneity. It is conceptually simple and leads to equations of comparable simplicity to the MA model. It produces a broad family of models that contains several known models as special cases. It further allows us to investigate the effect of many behaviours that have previously been inaccessible to analytical study. A significant contribution of this work is that it allows us to study the spread of a disease in a population for which some individuals have different propensity to form partnerships while allowing us to explicitly incorporate the impact of partnership duration. The interaction of partnership duration and numbers of overlapping partnerships plays a significant role in the spread of many diseases, and in particular may play an important role in the spread of HIV [45]. These techniques open the door to studying these questions analytically rather than relying on simulation. The edge-based compartmental modelling approach has a simple, graphical interpretation through flow diagrams. This simplifies model description, and guides generalizations. We propose that this is the correct perspective to study the deterministic dynamics of SIR epidemics on random networks because the derivations are straightforward, we need to track only a small number of compartments and we do not require any closure approximations. Other existing techniques rely on approximations [23] or produce complicated or large systems of equations [24– 26]. This approach does not offer immediate insight into stochastic effects where methods such as branching processes are more appropriate. In later studies, we use this approach to derive other generalizations, including different correlations in population structure, different disease dynamics and populations that change structure in response to the spreading disease. J. R. Soc. Interface Our approach is limited by the assumption that infection of one partner of u can be treated as independent of that of another partner. This is a strong assumption, and prevents us from applying this model to susceptible – infected– susceptible (SIS) diseases for which individuals return to a susceptible state. In this case, the assumption that u does not infect its partners can alter the future state of u. In the real population, if u becomes infected, it can infect partners who then infect u when u returns to a susceptible state. Thus if partnership duration is nonzero, our predictions may be significantly altered. This limitation is often not recognized but may lead to important failures of mean-field or MA models when applied to a population for which partnership duration is important [46]. Treating partners as independent also means that if v and w are partners of u, we assume no alternate short path between v and w exists. In particular, we assume that clustering [47,48] is negligible: partners are unlikely to see one another. This assumption applies equally to most existing analytical epidemic models, but it can be eliminated in very special cases using techniques similar to those of earlier studies [49– 52]. J.C.M. was supported by the RAPIDD programme of the Science and Technology Directorate, Department of Homeland Security and the Fogarty International Center, National Institutes of Health and the Center for Communicable Disease Dynamics, Department of Epidemiology, Harvard School of Public Health under award number U54GM088558 from the National Institute Of General Medical Sciences. Much of this work was a result of ideas catalysed by the China–Canada Colloquium on Modelling Infectious Diseases held in Xi’an, China in September 2009. E.M.V. was supported by NIH K01 AI091440. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institute of General Medical Sciences or the National Institutes of Health. We thank S. Bansal, M. Lipsitch, R. Meza, B. Pourbohloul, P. Trapman and J. Wallinga for useful conversations. REFERENCES 1 Kermack, W. O. & McKendrick, A. G. 1927 A contribution to the mathematical theory of epidemics. Proc. R. Soc. Lond. A 115, 700–721. (doi:10.1098/rspa.1927.0118) 2 Anderson, R. M. & May, R. M. 1991 Infectious diseases of humans. Oxford, UK: Oxford University Press. Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 16 Edge-based compartmental modelling J. C. Miller et al. 3 Lloyd, A. L. & May, R. M. 2001 How viruses spread among computers and people. Science 292, 1316–1317. (doi:10.1126/science.1061076) 4 Kiss, I. Z., Green, D. M. & Kao, R. R. 2006 The network of sheep movements within Great Britain: network properties and their implications for infectious disease spread. J. R. Soc. Interface 3, 669–677. (doi:10.1098/rsif. 2006.0129) 5 Rohani, P., Zhong, X. & King, A. A. 2010 Contact network structure explains the changing epidemiology of pertussis. Science 330, 982– 985. (doi:10.1126/science.1194134) 6 Eubank, S., Guclu, H., Anil Kumar, V. S., Marathe, M. V., Srinivasan, A., Toroczkai, Z. & Wang, N. 2004 Modelling disease outbreaks in realistic urban social networks. Nature 429, 180 –184. (doi:10.1038/nature02541) 7 Germann, T. C., Kadau, K., Longini Jr, I. M. & Macken, C. A. 2006 Mitigation strategies for pandemic influenza in the United States. Proc. Natl Acad. Sci. USA 103, 5935–5940. (doi:10.1073/pnas.0601266103) 8 Liljeros, F., Edling, C. R., Amaral, L. A. N., Stanley, H. E. & Åberg, Y. 2001 The web of human sexual contacts. Nature 411, 907 –908. (doi:10.1038/35082140) 9 Mossong, J. et al. 2008 Social contacts and mixing patterns relevant to the spread of infectious diseases. PLoS Med. 5, 381– 391. (doi:10.1371/journal.pmed.0050074) 10 Christakis, N. A. & Fowler, J. H. 2010 Social network sensors for early detection of contagious outbreaks. PLoS ONE 5, e12948. (doi:10.1371/journal.pone.0012948) 11 Andersson, H. 1997 Epidemics in a population with social structures. Math. Biosci. 140, 79 –84. (doi:10.1016/S00255564(96)00129-0) 12 Newman, M. E. J. 2002 Spread of epidemic disease on networks. Phys. Rev. E 66, 016128. (doi:10.1103/PhysRevE. 66.016128) 13 Miller, J. C. 2007 Epidemic size and probability in populations with heterogeneous infectivity and susceptibility. Phys. Rev. E 76, 010101. (doi:10.1103/PhysRevE.76. 010101) 14 Kenah, E. & Robins, J. M. 2007 Second look at the spread of epidemics on networks. Phys. Rev. E 76, 036113. (doi:10.1103/PhysRevE.76.036113) 15 Meyers, L. A., Pourbohloul, B., Newman, M. E. J., Skowronski, D. M. & Brunham, R. C. 2005 Network theory and SARS: predicting outbreak diversity. J. Theor. Biol. 232, 71–81. (doi:10.1016/j.jtbi.2004.07.026) 16 Volz, E. M. & Meyers, L. A. 2007 Susceptible–infected – recovered epidemics in dynamic contact networks. Proc. R. Soc. B 274, 2925–2933. (doi:10.1098/rspb. 2007.1159) 17 May, R. M. & Anderson, R. M. 1988 The transmission dynamics of human immunodeficiency virus (HIV). Phil. Trans. R. Soc. Lond. B 321, 565 –607. (doi:10.1098/rstb. 1988.0108) 18 May, R. M. & Lloyd, A. L. 2001 Infection dynamics on scale-free networks. Phys. Rev. E 64, 066112. (doi:10. 1103/PhysRevE.64.066112) 19 Moreno, Y., Pastor-Satorras, R. & Vespignani, A. 2002 Epidemic outbreaks in complex heterogeneous networks. Eur. Phys. J. B 26, 521–529. (doi:10.1140/epjb/e20020122) 20 Pastor-Satorras, R. & Vespignani, A. 2001 Epidemic spreading in scale-free networks. Phys. Rev. Lett. 86, 3200–3203. (doi:10.1103/PhysRevLett.86.3200) 21 Diekmann, O., De Jong, M. C. M. & Metz, J. A. J. 1998 A deterministic epidemic model taking account of repeated contacts between the same individuals. J. Appl. Probab. 35, 448 –462. (doi:10.1239/jap/1032192860) 22 Andersson, H. 1999 Epidemic models and social networks. Math. Sci. 24, 128 –147. J. R. Soc. Interface 23 Eames, K. T. D. & Keeling, M. J. 2002 Modeling dynamic and network heterogeneities in the spread of sexually transmitted diseases. Proc. Natl Acad. Sci. USA 99, 13 330–13 335. (doi:10.1073/pnas.202244299) 24 Volz, E. M. 2008 SIR dynamics in random networks with heterogeneous connectivity. J. Math. Biol. 56, 293–310. (doi:10.1007/s00285-007-0116-4) 25 Lindquist, J., Ma, J., van den Driessche, P. & Willeboordse, F. H. 2010 Effective degree network disease models. J. Math. Biol. 62, 143– 164. (doi:10.1007/s00285010-0331-2) 26 Ball, F. & Neal, P. 2008 Network epidemic models with two levels of mixing. Math. Biosci. 212, 69– 87. (doi:10. 1016/j.mbs.2008.01.001) 27 Noël, P.-A., Davoudi, B., Brunham, R. C., Dubé, L. J. & Pourbohloul, B. 2009 Time evolution of disease spread on finite and infinite networks. Phys. Rev. E 79, 026101. (doi:10.1103/PhysRevE.79.026101) 28 Miller, J. C. 2011 A note on a paper by Erik Volz: SIR dynamics in random networks. J. Math. Biol. 62, 349– 358. 29 House, T. & Keeling, M. J. 2010 Insights from unifying modern approximations to infections on networks. J. R. Soc. Interface 8, 67 –73. (doi:10.1098/rsif.2010.0179) 30 Wallinga, J., Teunis, P. & Kretzschmar, M. 2006 Using data on social contacts to estimate age-specific transmission parameters for respiratory-spread infectious agents. Am. J. Epidemiol. 164, 936. (doi:10.1093/aje/ kwj317) 31 Salathé, M., Kazandjiev, M., Lee, J. W., Levis, P., Feldman, M. W. & Jones, J. H. 2010 A high-resolution human contact network for infectious disease transmission. Proc. Natl Acad. Sci. USA 107, 22 020–22 025. (doi:10.1073/pnas. 1009094108) 32 Molloy, M. & Reed, B. 1995 A critical point for random graphs with a given degree sequence. Random Struct. Algorithms 6, 161–179. (doi:10.1002/rsa.3240060204) 33 Newman, M. E. J., Strogatz, S. H. & Watts, D. J. 2001 Random graphs with arbitrary degree distributions and their applications. Phys. Rev. E 64, 026118. (doi:10. 1103/PhysRevE.64.026118) 34 van der Hofstad, R.. 2010 Random graphs and complex networks. Eindhoven, The Netherlands: Eindhoven University of Technology. 35 Chung, F. & Lu, L. 2002 Connected components in random graphs with given expected degree sequences. Ann. Comb. 6, 125–145. (doi:10.1007/PL00012580) 36 Norros, I. & Reittu, H. On a conditionally Poissonian graph process. Adv. Appl. Probab. 38, 59–75. (doi:10. 1239/aap/1143936140) 37 Britton, T., Deijfen, M. & Martin-Löf, A. 2006 Generating simple random graphs with prescribed degree distribution. J. Stat. Phys. 124, 1377–1397. (doi:10.1007/s10955-0069168-x) 38 Feld, S. L. 1991 Why your friends have more friends than you do. Am. J. Sociol. 96, 1464–1477. (doi:10.1086/ 229693) 39 Diekmann, O. & Heesterbeek, J. A. P. 2000 Mathematical epidemiology of infectious diseases. London, UK: Wiley Chichester. 40 Wilf, H. S. 2005 Generatingfunctionology, 3rd edn. Natick, MA: AK Peters Ltd. 41 Andersson, H. 1998 Limit theorems for a random graph epidemic model. Ann. Appl. Probab. 8, 1331 –1349. (doi:10.1214/aoap/1028903384) 42 Trapman, P. 2007 On analytical approaches to epidemics on networks. Theor. Popul. Biol. 71, 160–173. (doi:10. 1016/j.tpb.2006.11.002) Downloaded from rsif.royalsocietypublishing.org on October 20, 2014 Edge-based compartmental modelling 43 Miller, J. C. & Volz, E. M. Submitted. Model hierarchies in edge-based compartmental modeling for infectious disease spread. 44 Miller, J. C. & Hagberg, A. 2011 Efficient generation of networks with given expected degrees. In Proc. Algorithms and Models for the Web Graph—8th International Workshop, ‘WAW 2011’, Atlanta, GA, USA, 27– 29 May 2011. Lecture Notes in Computer Science (eds M. Frieze, P. Horn, P. Pralat), vol. 6732, pp. 115 –126. Berlin, Germany: Springer. 45 Morris, M. & Kretzschmar, M. 1995 Concurrent partnerships and transmission dynamics in networks. Soc. Networks 17, 299 –318. (doi:10.1016/0378-8733(95) 00268-S) 46 Chatterjee, S. & Durrett, R. 2009 Contact processes on random graphs with power law degree distributions have critical value 0. Ann. Probab. 37, 2332 –2356. (doi:10. 1214/09-AOP471) J. R. Soc. Interface J. C. Miller et al. 17 47 Watts, D. J. & Strogatz, S. H. 1998 Collective dynamics of ‘small-world’ networks. Nature 393, 409–410. (doi:10. 1038/30918) 48 Newman, M. E. J. Properties of highly clustered networks. Phys. Rev. E 68, 026121. (doi:10.1103/PhysRevE.68.026121) 49 Volz, E. M., Miller, J. C., Galvani, A. & Meyers, L. A. 2011 The effects of heterogeneous and clustered contact patterns on infectious disease dynamics. PLoS Comput. Biol. 7, e1002042. (doi:10.1371/journal.pcbi.1002042) 50 Miller, J. C. 2009 Percolation and epidemics in random clustered networks. Phys. Rev. E 103, 020901(R). (doi:10.1103/PhysRevE.80.020901) 51 Newman, M. E. J. 2009 Random graphs with clustering. Phys. Rev. Lett. 103, 058701. (doi:10.1103/PhysRevLett. 103.058701) 52 Karrer, B. & Newman, M. E. J. 2010 Random graphs containing arbitrary distributions of subgraphs. Phys. Rev. E 82, 066118. (doi:10.1103/PhysRevE.82.066118)