Modeling complex systems: A case study of compartmental models in epidemiology

Compartmental epidemic models have been widely used for predicting the course of epidemics, from estimating the basic reproduction number to guiding intervention policies. Studies commonly acknowledge these models' assumptions but less often justify their validity in the specific context in which they are being used. Our purpose is not to argue for specific alternatives or modifications to compartmental models, but rather to show how assumptions can constrain model outcomes to a narrow portion of the wide landscape of potential epidemic behaviors. This concrete examination of well-known models also serves to illustrate general principles of modeling that can be applied in other contexts.


I. INTRODUCTION
Compartmental models such as the SIR model have been widely used to study infectious disease outbreaks [1][2][3][4][5].These models have informed policy makers of the risks of inaction and have been used to analyze various policy responses.The limitations of the assumptions of compartmental models are wellknown [6][7][8][9][10]; we intend to explore which assumptions are appropriate in which contexts and when and why the models do or do not succeed.
No model accurately captures all the details of the system that it represents, but some models are nonetheless accurate because certain large-scale behaviors of systems do not depend on all these details [11].(For example, modeling material phase transitions generally does not require including the quantum mechanical details of individual atoms.)The key to good modeling is understanding which details matter and which do not.Paradoxically, failing to recognize that a model can be accurate in spite of certain unrealistic assumptions can lead to models in which all assumptions are excused: the impossibility of getting all the details right may discourage a careful analysis of which assumptions are appropriate in which contexts.
In an attempt to obtain better predictions, it may be tempting to include more details and fine-tune the model assumptions.However, arbitrarily focusing on some assumptions and details while losing sight of others is counterproductive [12].Which details are relevant depends on the question at hand; the inclusion or exclusion of details in a model must be justified depending on the modeling objectives.Compartmental models tend to include some details (e.g.disease stages) while not including others (e.g.stochasticity and heterogeneity) that, in many cases, have a far larger effect on forecasting the epidemic trajectory, estimating the final epidemic size, and analyzing the impact of interventions (see Figure 1).
Sensitivity analysis is becoming a common method for assessing how uncertainties in model parameters can lead to uncertainty in the results.However, sensitivity analyses can only capture sources of uncertainty that arise from the parameters or assumptions that are explicitly varied, which will often not span entire space of possible epidemic behaviors.For instance, ac- * These two authors contributed equally.counting for uncertainty in the transmission rate of a model that assumes a well-mixed population will not ameliorate errors arising from this latter assumption.
In this work, we use both theoretical analyses and numerical simulations to examine some common assumptions of compartmental models-such as the distribution of generation intervals, homogeneity in population characteristics and connectivity, and the use of continuous variables-in order to determine their relevance for various model outcomes.Our purpose is not to argue for specific alternatives to compartmental models or for specific modifications but rather to illustrate how the assumptions of these models affect their results.

II. THE SIR MODEL
We first review the basic SIR model.The model divides the population into three compartments-the fractions of individuals who are susceptible (s), infectious (i), and recovered (r).A set of three differential equations governs the dynamics: The parameter β > 0 represents the rate at which infectious individuals transmit the disease.Infectious individuals become no longer infectious (recovered or removed) at a rate γ > 0.
Assumptions of the SIR model include homogeneity in the infectiousness, susceptibility, and connectivity of the population, exponentially distributed recovery times and generation intervals, that discrete and stochastic dynamics can be approximated with continuous and deterministic variables, and that there are no changes over time in the behaviors of either the population or the infectious agent.
By recasting the equations of the model in terms of the basic arXiv:2110.02947v2[q-bio.PE] 28 Oct 2022 1. Schematic representation of the impact of various modeling choices/assumptions.The left column lists various details that can be incorporated into a compartmental model, and the right column lists typical potential impacts on the model output.The three panels classify the details by 'scale' , with the largest scale details typically having the most impact on model output, and the smallest scale details typically having the least impact, although the impact of any given assumption ultimately depends on precisely for what purpose the model is being used.Furthermore, various assumptions can compound non-linearly to affect the model output.For instance, policy interventions such as travel restrictions, which both rely on and affect heterogeneity in geographic connectivity, can play a decisive role in determining whether or not a stable elimination is achieved [13].
Of course, the actual effect of any assumption depends on its precise mathematical implementation, as well as the presence or absence of other assumptions within the model, and so this figure should be considered as a rough schematic rather than as a definitive guide.
it can be seen that the evolution of the system state (i.e. the fraction of people in each of the three compartments) depends only on R 0 and that γ sets the time scale for this evolution (i.e. a change in γ would correspond simply to a stretching or compression of the time axis).Indeed, it can be proven that the final size of an epidemic depends only on the network of probabilities of individuals infecting each other and not at all on how quickly individuals recover or any other time-scales associated with the progression of the disease within individuals [14][15][16][17][18] (see Appendix section 1 for more details).This overall time-scale of the epidemic (set by γ in the above formulation) is an important parameter; for instance, together with R 0 , it tells us how quickly case counts will grow.The SIR model describes this overall time-scale without the need for any additional compartments or parameters.Additional compartments can provide more information as to the precise timing (as opposed to simply the overall fraction) of the number of individuals in particular disease stages (e.g.exposed, infectious, hospitalized, etc.) and can help us understand, for instance, lags between infections and hospitalizations.However, such details will often have much smaller effects than regularly used assumptions that impact the overall epidemic trajectory, such as homogeneity, mean-field connectivity, and continuous variables (see section III below).

III. ANALYSIS OF KEY ASSUMPTIONS
We now examine some key assumptions of compartmental models.In section III A, we show that assumptions concerning the distribution of generation intervals (i.e.assumptions about diseases stages, recovery rates, etc.) can be captured by an SIR model with appropriately selected parameters.However, in contrast to how the distribution of generation intervals can be described by the effective parameter γ, heterogeneous susceptibility and connectivity cannot be captured by an effective spreading rate β (section III B).In section III C, we discuss the implications of using continuous and deterministic variables to describe dynamics that are in reality stochastic and discrete.

A. Generation intervals and effective parameters
There are some cases in which simplifying assumptions are not critical.For instance, by assuming a constant recovery rate γ, the SIR model makes the assumption that generation intervals follow an exponential distribution.However, the growth rate and reproduction number can nonetheless be accurately captured despite the actual generation intervals not being exponentially distributed, so long as γ is treated as an effective parameter.
A general result relating the exponent of growth or decline λ and the effective reproduction number R is where g(t) is the distribution of generation intervals [19].This relationship applies whenever the population size and number of infections is large enough that stochastic effects can be ignored.(There is also the implicit assumption that R and the generation interval distribution are roughly constant over the time interval during which exponential growth/decline is observed.)Within an SIR model, the generation intervals are exponentially distributed with mean 1/γ, so equation (7) yields where λ 0 is the initial exponential growth rate.Thus, if an SIR model is to accurately describe R 0 and λ 0 for an observed epidemic, then γ must be determined by equation (8).But since actual generation intervals are not exponentially distributed, the inverse recovery rate 1/γ cannot be estimated as the mean of the observed generation intervals.Instead, γ (and β) serve as effective parameters that coarse-grain the actual generation interval distribution g(t) in such a way that the SIR model yields the correct initial growth rate λ 0 and basic reproduction number R 0 : (10) where ḡ is the mean of g(t).Nonetheless, much of the modeling literature (e.g.[20][21][22][23][24][25][26][27][28][29][30][31][32][33][34][35][36][37][38]) uses γ = 1/ḡ.This same logic applies to other compartmental models as well: unless there is reason to believe that the time intervals spent between compartments actually follow the distributions implied by the model, the transition rates should be considered as effective parameters.
Models with additional compartments such as SEIR models are often considered to be more accurate than the SIR model since they include a more realistic effective distribution of generation intervals (see Appendix 2).However, the precise generation interval distribution does not affect epidemic characteristics such as the final size, the initial exponential growth rate, and R 0 [39] captured by the SIR model by treating the recovery rate γ as an effective parameter (see Figure 2).More generally, for the purposes of modelling the overall epidemic trajectory, introducing any number of disease stages into the SIR model only amounts to changing the effective distribution of generation intervals, which changes only the timing of the epidemic curve (see Appendix 1).Given the larger sources of uncertainty related to other assumptions, additional parameters in SEIR models are not justified if they serve only to refine the generation interval distribution.(The use of SEIR models over the SIR model may be justified in other circumstances.)

B. Population heterogeneity
Human populations are heterogeneous in many ways: social networks of individuals exhibit community structure [40][41][42], infectiousness and susceptibility can vary across the population depending upon age/health/behavior, different regions may have different mitigation responses to an epidemic, etc.The widely used assumption of a homogeneous and well-mixed population has been challenged using various types of heterogeneous models [14,[43][44][45][46][47][48][49][50][51].To summarize the impact of heterogeneous infectiousness, susceptibility, and connectivity, we use a simple class of models in which the population is partitioned into multiple groups [14,[43][44][45][46][47].The purpose of these modifications is to show that heterogeneity can have a substantial effect on both the epidemic trajectory and its final size and, crucially, can greatly expand the space of possible policy responses.We do not claim that any particular set of assumptions will accurately predict an epidemic trajectory but rather include these heterogeneous models to show that the space of possible outcomes is far larger than homogeneous models would imply.
We use a framework in which a population of size N is divided into multiple groups.Each group k has N k individuals in total, and we define n k ≡ N k /N as the fraction of individuals in group k, such that k n k = 1.The number of susceptible, infected and recovered individuals in group The modified SIR equations can be written as: where B kl represents the rate of transmission from infectious individuals in group l to susceptible individuals in group k.An SIR model is used due to its simplicity, but the key results of this section apply equally well to SEIR and other models that differ from the SIR model only in their distributions of generation intervals (section III A).Before considering specific cases, we first derive general expressions for the reproduction number and final size of a heterogeneous epidemic.Combining equations ( 11) and (13 and eliminating the time variable, the system can be described by the set of equations where R kl ≡ B kl /γ l .The basic reproduction number for such a system is given by the top eigenvalue of the next-generation matrix G [48,52]; at the beginning of the epidemic, s k ≈ n k , and so As discussed in the previous section, one can always find parameters β and γ for a homogeneous SIR model that will reproduce this reproduction number, as well as the initial exponential growth rate of the epidemic.However, the later trajectory and final size may differ.Specific cases will be given below; a general equation for the final size of a heterogeneous epidemic can be derived as follows.
Denoting the final size of the epidemic in group k by Assuming a small initial number of infections (i.e.s k (0) ≈ n k and r k (0) ≈ 0), equation ( 16) gives the following implicit expressions for each r ∞ k : As can be seen, the next-generation matrix G and final sizes r ∞ k depend on the values of γ k only through the ratio R kl = B kl /γ l .To simplify the analysis in what follows, we therefore take γ k = γ for all groups k, such that B kl is proportional to R kl .This assumption restricts the distribution of generation intervals to that of a homogeneous SIR model, without placing any restrictions on the overall transmission probabilities between infectious and susceptible individuals (which are given by R kl ).By holding the distribution of generation intervals constant, we can focus on effects arising from heterogeneity alone.The initial epidemic growth can be approximated by the set of linear differential equations such that where δ kl is the Kronecker delta.The initial exponential growth rate in the number of infections λ 0 will thus be dominated by the top eigenvalue of M and-as in the homogeneous SIR model-is related to the reproduction number R 0 (i.e. the top eigenvalue of G) by λ 0 = γ(R 0 − 1).

Heterogeneity in infectiousness and susceptibility
We first consider homogeneous connectivity (heterogeneous connectivity will be considered in the next subsection) but potentially heterogeneous susceptibility and infectiousness, i.e. we consider B kl that can be factored as B kl = η k β l .We analyze three cases.
In the first case, groups are equally susceptible but differ in infectiousness, i.e.B kl = β l .In this case, we note that ds k /ds l = s k /s l and thus the fraction of susceptible individuals in each group will remain constant over the course of the trajectory.Furthermore, apart from an initial exponentially decaying transient, the ratio of infectious individuals in each group will equal the ratio of susceptible individuals, as can be seen using the timeindependence of s l /s k to show that Thus we can write where s(t) = k s k (t) and i(t) = k i k (t) are solutions to an SIR model with spreading rate In other words, heterogeneous infectiousness by itself has no impact on the epidemic trajectory.More generally, in the limit of a large population in which stochastic effects average out, heterogeneous infectiousness can always be incorporated into an otherwise homogeneous model: if each individual has probabil-ity p i of belonging to a group i (such that i p i = 1), with the infectiousness as a function of time of an individual in group i who was infected at time t = 0 given by R i 0 g i (t) (such that ∞ 0 g i (t)dt = 1), then the result will be equivalent to a completely homogeneous model with basic reproduction number R 0 = i p i R i 0 and distribution of generation intervals For instance, the SEIAR model adds an asymptomatic compartment to the SEIR model (e.g.ref. [53]).In such a model, asymptomatic individuals cause infections at a different rate than symptomatic individuals, but everyone is equally susceptible and connectivity is homogeneous.Thus, the SEIAR model by itself has no impact on the epidemic trajectory-an identical trajectory could be obtained by considering an SEIR model and modifying its parameters to account for asymptomatic infection, contact tracing, quarantine/isolation efforts, etc.
In the second case, the groups can have the same infectiousness but differing susceptibilities, i.e.B kl = η k β.By selecting the effective spreading rate β SIR = β η , the initial growth rate and basic reproduction number can be with an SIR model (see equation ( 19)).However, the later parts of the epidemic trajectories will diverge, and the total final size r ∞ = k r ∞ k is smaller than what would be predicted from a homogeneous model: (where the equality follows from equation (17) and the inequality follows from the concavity of the function 1 − e −x ).
In the third case, both infectiousness and susceptibility vary across groups.We consider a subset of this scenario in which infectiousness and susceptibility are proportional, i.e. those who are more likely to spread the disease are also more likely to contract it.For instance, a person who wears a mask more often or who socializes less will be both less likely to spread and less likely to contract the disease.Assuming both susceptibility and infectiousness are proportional to a contact parameter b, i.e.B kl = b k b l , the homogeneous SIR model can reproduce the initial growth rate and basic reproduction number by selecting the effective spreading rate β SIR = b 2 (equation ( 19)).(Note that here, the effective spreading rate b 2 differs from the average spreading rate b 2 due to the more infectious individuals being more likely to be infected.)However, as in the previous case, the homogeneous SIR model can grossly misestimate later parts of the trajectory and the final epidemic size; theorem 4 of ref. [15] proves that for a given R 0 , when susceptibility and infectiousness are proportional to each other, the final size is less than or equal to that of a homogeneous epidemic.
Figure 3 summarizes these results and shows that the final size can be very different despite identical initial exponential growth rates and basic reproduction numbers (the case of only heterogeneous infectiousness is not shown, as its results are identical to those of an SIR model).Thus, unless individuals are equally likely to be infected, the large-scale effects of heterogeneity on the epidemic trajectory beyond the initial exponential growth FIG.3. (I) Effect of heterogeneous susceptibility on the final size.Infectiousness is kept constant, while the susceptibility is sampled from gamma distributions with differing variance σ 2 but with identical means (corresponding to identical values of R0).(II) Effect of heterogeneous susceptibility and infectiousness on the final size, when infectiousness is proportional to susceptibility.The contact parameter to which they are both proportional is sampled from gamma distributions with differing variance σ 2 but with the same second moment (so as to keep R0 constant).In both cases, R0 = 2, the population consists of 500 equally sized groups, and equation ( 17) was used to calculate the final epidemic size r∞ = k r ∞ k .
cannot be captured by a homogeneous model.In other words, such heterogeneity cannot be coarse-grained into a single effective spreading rate.

Heterogeneous connectivity
The SIR model assumes mean-field connectivity (i.e.every individual is equally likely to interact with every other individual).Above, we systematically considered heterogeneity in individual characteristics; here, we consider one example of heterogeneous connectivity in which the connectivity within and between groups can be controlled through a clustering parameter between zero and one.A clustering parameter of zero means that the groups are perfectly well-mixed while a clustering parameter of one means that there is no inter-group disease transmission (mathematical methods can be found in Appendix 3). Figure 4 provides one example of how connectivity assumptions can affect epidemic size.
More important, however, is the space of policy responses that is opened up by the fact that connectivity is not mean-field (i.e. that populations are not well-mixed).The geographic clustering of cases, which can be increased with travel restrictions, can be especially helpful in containing a pandemic using only local, targeted measures [13].
Another large-scale effect of heterogeneity is that the epidemic trajectory can have multiple peaks and plateaus, an impossible occurrence under homogeneous compartmental models (see Figure 5).Of course, the shape of an epidemic trajectory will also be affected by policy interventions, behavioral changes in the population, evolution of the infectious agent, and seasonal effects, as well as nonlinear interactions among and between these factors and the various types of heterogeneity.In Figures

C. Stochasticity and the elimination of outbreaks
In compartmental models, which use continuous variables, the number of infections can exponentially decay but will never reach zero.Such models may mischaracterize the effects of tem- and yellow squares show that elimination is possible and that a second wave need not occur.Due to the stochastic nature of disease spread, interventions cannot be held in place for a pre-determined amount of time but rather must be calibrated to real-time observations.For instance, for the cases of the pink circles and yellow squares, the interventions could be lifted earlier than they were in this simulation, while for the blue triangles, the interventions would need to be kept in place for longer.Simulation details and parameters can be found in Appendix 4.
porary, strong interventions by predicting an inevitable "second wave" [28,29,38].Stochastic compartmental models [54] are better suited for analyzing such interventions since the dynamics of disease transmission cannot be approximated as continuous when the number of cases is small.One behavior that is not captured by most continuous models is the possibility of elimination, i.e. of the infectious fraction of the population equalling zero.Zero is a special number here since any nonzero fraction-no matter how small-can exponentially grow (see Figure 6 for details).
Stochastic models also show that not all outbreaks grow to become an epidemic [55], an observation which can aid in identifying policies that achieve containment once cases have been brought to a sufficiently low number.The effect of stochasticity can be particularly pronounced if super-spreader events play a substantial role in the overall spread of the disease.
Since stochastic disease transmission events take place through the contact networks of individuals, connectivity patterns can affect the dynamics of elimination.Decreasing the effect of long-range connections (e.g. through travel restrictions, testing at borders, etc.) can lead to localized epidemics that are largely independent of one another.These local epidemics are smaller and thus more subject to stochastic effects.Thus, heterogeneous connectivity can interact with stochasticity to make elimination a more accessible prospect than homogeneous models would imply.

IV. DISCUSSION
What differentiates a good model from a bad model is not its level of detail but rather the relationship between the details included in the model and the most important behaviors of the system.Which details are important can depend not only on the system but also on the modelling objectives.For instance, the distribution of generation intervals is crucial if attempting to calculate the reproduction number from the exponential growth/decline rate of an epidemic, but it can generally be coarse-grained to a single time-scale in the context of predicting overall epidemic trajectories.
SEIR and many other compartmental models [56][57][58][59] differ from the SIR model in that they use a more detailed and realistic generation interval distribution, and in some cases have heterogeneous infectiousness (as in SEIAR models).However, as shown in sections III A and III B, the corrections to the epidemic trajectory from the distribution of generation intervals will generally be small compared to other sources of error, and heterogeneity in infectiousness alone has no impact in these deterministic models.Both SIR and SEIR models ignore potentially important factors such as heterogeneous connectivity, stochasticity, and behavior change/policy interventions.If such factors are to be ignored, however, the SIR model has the advantage of not including any unnecessary (and therefore potentially misleading) details; its output depends only on the unitless R 0 , together with a time-scale set by the effective recovery rate γ.SEIR and related models can provide a breakdown of types of infections and can help with, for example, the management of health care resources (although often, all that matters is the probability of an infection being of a certain type rather than the precise dynamics between types).But given the often far larger effects of heterogeneity and stochasticity (not to mention behavioral change and policy response), including the details of disease progression while ignoring these other assumptions may provide a false sense of confidence in the accuracy of the model.More significantly, a misunderstanding of the relative importance of assumptions in any given model may narrow the set of interventions considered.For instance, the effect of travel restrictions cannot even be described in a model with homogeneous connectivity.
The idea that some details and assumptions are more important than others is frequently used in mathematics and physics.Functions are often approximated using a power-series expansion, with each higher-order term providing additional details.A higher-order term (finer-grain correction) is used only when all lower-order terms (coarser-grain corrections) have already been included.To do otherwise-or to include some corrections at a given scale while ignoring others-is mathematically unsound and can lead to nonsensical results.When modeling many real-world systems, the various details do not necessarily fit cleanly into a power series, but the general conceptual principle still holds: details of lesser relative importance should be considered only after all of the larger-scale effects have already been taken into account.
Agent-based or network models can transcend some of the limitations of compartmental models.Like any model, however, they may suffer from the flaw of arbitrarily focusing on some details while leaving out others, thereby mischaracterizing the space of large-scale behaviors of the epidemic.As agent-based and network models are generally more detailed, especially careful attention must be paid to this point.
In addition to the assumptions that we have analyzed in detail, a few general comments can be made about the potentially largescale effects of policy response, temporary immunity, and mutation of the pathogen.Policy responses such as social distancing, mask mandates, contact tracing, travel restrictions, mass testing, ventilation, and lock-downs can greatly affect disease transmission and change whether the effective reproduction number is greater than or less than one.If immunity wanes over time, then recovered individuals can become susceptible again (as captured using SIRS and related models), such that, in the absence of elimination efforts, the disease will become endemic and will not have a final size.The mutation of a pathogen can render the immunity developed to previous strains less effective and can also substantially change the transmission characteristics of the disease.And there are many other details that we have not examined such as contraction of generation intervals [60], vital dynamics, and seasonal effects, among others, which may influence the behaviors of an epidemic in various ways.This unpredictability inherent to epidemics underscores the need for a precautionary principle for acting under uncertainty [61].A careful examination of model assumptions is necessary, not to evaluate the accuracy of the assumptions themselves-they will always be inaccurate-but to see how they do or do not affect the link between our actions and the space of possible outcomes.

V. CONCLUSION
Our analysis indicates that compartmental models often focus on details that do not matter while ignoring far larger sources of error.More precisely, when compartmental models do include additional details, they tend to focus on the distribution of generation intervals and sometimes heterogeneous infectiousness, while ignoring other assumptions that have far larger effects.Including corrections in a model that has gotten the big picture wrong, however, serves only to give a false sense of confidence.For instance, stochastic effects can sometimes mean the difference between the existence or non-existence of a disease within a population.Heterogeneity in connectivity can open up entirely new regimes of policy control, including internal travel restrictions, and, even in the absence of such policy, such heterogeneity, especially when combined with other sources of heterogeneity, can dramatically alter an epidemic's trajectory and size.In comparison, without also including stochasticity, heterogeneity in infectiousness alone has no impact, and the addition of disease stages will only affect the precise timing of disease spread.This timing can be important, but can also be approximately captured using the simpler SIR model with the appropriate choice of recovery rate, which together with the other transition rates between compartments should be thought of as effective parameters rather than as actually modeling an exponential distribution of time spent in each compartment.None of this is to say that models with additional compartments should not be used; rather, careful attention must be paid to whether each additional parameter can actually better guide action, given the context of both the other assumptions of the model and the sources of uncertainty within the data.

APPENDIX 1. Epidemic size
The final size of an epidemic in which each individual can be infected at most once is not affected by the distribution of generation intervals.Consider an epidemic process in a population of N individuals, where each infected individual has a probability p of infecting any given susceptible individual and where these infection events are independent of each other.Regardless of the distribution of generation intervals, the transmission events of this process can be represented by an Erdos-Renyi graph [17,18].The size of the epidemic r ∞ will then be the fraction of nodes within the giant component of the Erdos-Renyi graph, with an epidemic occurring whenever (one of) the seed infection(s) is part of this giant component.Thus, under assumptions of homogeneity, the epidemic size depends only on p and N .In the limit as N → ∞ with R 0 = pN held constant, the fraction of nodes in the giant component is given by r ∞ = 1 − exp(−R 0 r ∞ ), which, as expected, is the same result given by deterministic homogeneous compartmental models.
Heterogeneity can be incorporated by considering a set of nodes on which each transmission event is represented by a directed edge.The transmission events need not be independent.The probability that any given individual will be infected is simply equal to the probability that that individual is connected directly or indirectly to a seed infection node.Thus, the final size (and, indeed, each individual's probability of at some point being infected) depends only on the probability of transmission between each ordered pair of individuals conditioning on the first being infectious and the other susceptible-i.e. on the probability of a directed edge existing between the pair of nodes-as well as the seed infections, and does not depend on the temporal properties of the process such as generation intervals or the number or types of stages in a compartmental model [39].

The SEIR model
The SEIR model is a modified SIR model in which a new compartment of exposed individuals (who have been infected but are not yet infectious) is introduced.The model is described by these differential equations: Convolving the two exponential distributions corresponding to the transitions from exposed to infectious and infectious to recovered [19] gives the following distribution of generation intervals which, when combined with equation ( 7), yields where λ 0 is the initial exponential growth rate and R 0 is the basic reproduction number.Combining equations ( 30) and ( 8) allows us to find an effective γ of the SIR model in terms of the effective parameters of the SEIR model such that the basic reproduction number and the initial growth rate of both the models are equal: Thus, any SEIR model can be replaced with an SIR model with the same initial growth rate and R 0 (and thus final size).(Note that for both models, β is also an effective parameter: for the SEIR model, β = R 0 α, while for the SIR model, β = R 0 γ.) The two models will differ only in terms of the precise timing the epidemic curve later on in its trajectory, but such differences will be swamped by other sources of error such as heterogeneity and stochasticity.

Heterogeneous connectivity
Under the assumption of homogeneous connectivity, the rate B kl at which an individual in group k infects an individual in group l (see equations ( 11)-( 13)) can be described solely in terms of the individual characteristics of members of groups k and l.But in reality, transmission tends to be clustered.In order to capture some of these clustering effects (albeit in a simplified manner), we allow for a higher probability of the disease spreading within groups than between groups.For instance, it is generally more likely for the disease to spread between two individuals living within the same city than between individuals living in different cities.
To account for this, we let B kl = b k b l C kl with C kl given by In the absence of sharp policy/behavioral changes, a homogeneous compartmental model cannot account for such an early plateau, which was clearly not the result of population-wide herd immunity.In a heterogeneous model, such a plateau could be partially explained by substantial immunity within the specific sub-populations that were responsible for the initial exponential growth.Epidemic data was obtained from refs.[63,64] where c ∈ [0, 1] is the clustering parameter.Note that C kl is normalized such that for all l, k n k C kl = 1.
In Figure 4 of the main text, we explore the case of two groups with different contact parameters b 1 and b 2 and a connectivity parameter c.The basic reproduction number R 0 is then given by Heterogeneous connectivity can result in deviation from simple epidemic trajectories of growth followed by decline, as shown in Figure 5 of the main text.One such deviation is a plateau in the epidemic trajectory observed in both simulations [65] and epidemic data.Figure 7 shows such a plateau for a wave of COVID-19 in Chhattisgarh, India.Figure 8 shows COVID-19 cases in Sweden, in which the number of infections did not decline after the curve flattened, despite the absence of major changes in the mitigation policies.

Stochasticity
For Figure 6, we use the discrete-time Markov chain (DTMC) formulation for simulating a stochastic epidemic [54].A discrete population of size N is described by the state (S, I), where S is the number of susceptible individuals and I is the number of in- where ∆t is the time step for the simulation.Its value must be selected such that all transition probabilities lie between zero and one.In Figure 6, β = 4.1, γ = 1, N = 1000, and ∆t = 0.00017, with β being reduced by a factor of 4 during the intervention period, which lasts from t = 1.0 to t = 20.0.

FIG. 4 .TotalFIG. 5 .
FIG.4.Effect of heterogeneous connectivity, infectiousness, and susceptibility on the final epidemic size.For a given value of R0, varying the clustering parameter c from 0 to 1 (and adjusting the contact parameter b1 so as to maintain the same value of R0) in a population containing two groups can lead to epidemics of different sizes.The dashed lines show the epidemic sizes for the same values of R0 in a completely homogeneous model.Parameter values are b2 = 0.9, n1 = n2 = 0.5, γ = 1.0 (see equation 33); equation (17) was used to calculate the final epidemic size r∞ = k r ∞ k .

7 and 8 (
see Appendix), we present time-series of COVID-19 cases in India and Sweden that show large deviations from what a homogeneous model would predict.

FIG. 6 .
FIG.6.Continuous compartmental models forecast a deterministic second wave of infections.The shaded region of the plot shows the time period for which the spreading rate is reduced as a result of policy interventions.The blue curve shows the number of infections according to a continuous SIR model: after the interventions are removed, the infections rise again.The scatter plot trajectories show the number of infections in a stochastic SIR model, with each marker type corresponding to a single realization of the model.The trajectories marked by pink circles and yellow squares show that elimination is possible and that a second wave need not occur.Due to the stochastic nature of disease spread, interventions cannot be held in place for a pre-determined amount of time but rather must be calibrated to real-time observations.For instance, for the cases of the pink circles and yellow squares, the interventions could be lifted earlier than they were in this simulation, while for the blue triangles, the interventions would need to be kept in place for longer.Simulation details and parameters can be found in Appendix 4.

FIG. 7 .FIG. 8 .
FIG.7.Time series of daily new COVID-19 infections from the state of Chhattisgarh in India shows an epidemic plateau between 2021-04-16 and 2021-05-06.Three districts of the state (out of 27)-Durg, Raipur and Rajnandgaon-peaked around 2021-04-16, while the rest of the districts in the state peaked around 2021-05-06.This disparity in the trajectories is a result of the heterogeneity in the social contact structures, as well as in the timing and strength of policy and behavioral changes.Epidemic data was obtained from ref.[62].
fected individuals.Similar to the deterministic SIR model, β and γ are the effective spreading and recovery rates.The simulation starts with a single infected individual-i.e. the population starts in the state (N − 1, 1)-with transition probabilities from the state (S, I) given by P (S − 1, I + 1) = β SI N ∆t (34) P (S, I − 1) = γI∆t (35) P (S, I) = 1 − β S N + γ I∆t (36) . As described above, these characteristics can be same in both models.The following parameters were used to generate this figure.SEIR: β = 0.25, σ = 0.167, α = 0.125.