The relationships between message passing, pairwise, Kermack–McKendrick and stochastic SIR epidemic models

We consider a very general stochastic model for an SIR epidemic on a network which allows an individual’s infectious period, and the time it takes to contact each of its neighbours after becoming infected, to be correlated. We write down the message passing system of equations for this model and prove, for the first time, that it has a unique feasible solution. We also generalise an earlier result by proving that this solution provides a rigorous upper bound for the expected epidemic size (cumulative number of infection events) at any fixed time \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$t>0$$\end{document}t>0. We specialise these results to a homogeneous special case where the graph (network) is symmetric. The message passing system here reduces to just four equations. We prove that cycles in the network inhibit the spread of infection, and derive important epidemiological results concerning the final epidemic size and threshold behaviour for a major outbreak. For Poisson contact processes, this message passing system is equivalent to a non-Markovian pair approximation model, which we show has well-known pairwise models as special cases. We show further that a sequence of message passing systems, starting with the homogeneous one just described, converges to the deterministic Kermack–McKendrick equations for this stochastic model. For Poisson contact and recovery, we show that this convergence is monotone, from which it follows that the message passing system (and hence also the pairwise model) here provides a better approximation to the expected epidemic size at time \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$t>0$$\end{document}t>0 than the Kermack–McKendrick model.


Introduction
One of the earliest and most comprehensively analysed epidemic models is the susceptible-infected-recovered (SIR) model of Kermack and McKendrick (1927).In addition to providing insights into threshold behaviour and vaccination, it has also underpinned much subsequent work in applied mathematical epidemiology (Anderson and May 1992).Equivalent stochastic models were analysed later (for example, Bailey 1975, Chapter 6) and it became of interest to understand the relationship between the two (Kurtz 1970(Kurtz , 1971; Barbour 1972Barbour , 1974)).
More recently, various heterogeneities have been added to both deterministic and stochastic epidemic models.A particularly important one is the contact network/graph which allows for specific contacts between individuals as well as varying strengths of contact; see Danon et al. (2010) and Pastor-Satorras et al. (2015) for reviews.While it is straightforward to simulate stochastic epidemics on networks, deterministic representations of these dynamics have also been developed to assist our understanding.Important examples of these include pair approximation (Keeling 1999;Sharkey 2008), message passing (Karrer and Newman 2010) and edge-based systems (Miller et al. 2012).
Message passing for SIR dynamics was considered by Karrer and Newman in 2010 and is central to the work that we present here.This formalism allows for an exact representation of (expected) SIR epidemics on trees and an approximate representation for graphs with cycles.In particular, the underlying dynamics are very general.Wilkinson and Sharkey (2014) showed that, when transmission processes are assumed to be Poisson, a generalised version of the message passing formalism is equivalent to a very general class of pairapproximation models defined at the level of individuals, thus relating two major representations of epidemic dynamics to each other.
Here, we define a slightly more general stochastic SIR model in section 2 and define the message-passing system for this model in section 3. We first state a non-restrictive sufficient condition for the message passing equations to have a unique feasible solution (Theorem 1).We then restate the rigorous bounds found in Karrer and Newman (2010) and Wilkinson and Sharkey (2014) for this more general stochastic model; specifically, this system cannot overestimate the expected number susceptible and cannot underestimate the expected number recovered-or-vaccinated at any time.For trees, we also derive a quantity which provides a rigorous lower bound on the variance of the number of susceptibles at any time.
For the remainder of the paper, we focus on the dynamics specified in section 5, which assumes symmetric graphs and homogeneous individuals.The corresponding message passing system is written down by exploiting symmetry in section 6 yielding a system comprising of only four equations.This system is identical in form to a special case of the configuration model equations of Karrer and Newman (2010), although here applied in a different context.From a special case of this system, a population-level pairwise model which allows for a general infectious period is derived in section 7.This pairwise model provides exactly the same infectious time series as the corresponding message passing system and hence exactly the same bounds (Theorem 4).Although this derivation represents a special case of the derivation in Wilkinson and Sharkey (2014), it enables the form of well-known population-level pairwise models to be more readily obtained (e.g.Keeling (1999)).
In section 8, we derive the Kermack-McKendrick SIR model as an asymptotic special case of the message passing system (Theorem 5).The symmetric graph message passing system is analysed in section 9 and results pertaining to longterm behaviour including final size (Theorems 6 and 7), and the tendency of cycles to inhibit the epidemic (Theorem 8), are obtained.The paper ends with a brief discussion in section 10.

2
The stochastic model (non-Markovian SIR dynamics on graphs) We define a very general class of graph-based stochastic epidemics which allow heterogeneous and non-Poisson individual-level processes, and heterogeneity in the initial states of individuals (including the case where the initial states of all individuals are non-random).Some statistical dependence between the individual-level processes is allowed.Let G = (V, E) be an arbitrary (possibly infinite) simple, undirected graph, where V is the set of vertices (individuals) and E is the set of undirected edges between vertices.For i ∈ V, let N i = {j ∈ V : (i, j) ∈ E} be the set of neighbours of i.We assume that two individuals are neighbours if and only if at least one can make direct contacts to the other.A particular realisation of the stochastic model is specified as follows.Each individual/vertex i ∈ V is assigned a set of numbers X i relevant to the behaviour of i and the spread of the epidemic: where Y i is equal to 1, 2, or 3, according to whether i is instantaneously infected at t = 0, initially susceptible or initially recovered/vaccinated, these being mutually exclusive; is the time elapsing between i first becoming infected and it making a contact to j, if i is ever infected.Therefore, for t ≥ 0, i makes an infectious contact to j at time t if and only if (i) i becomes infected at some time s ≤ t, (ii) ω ji = t − s, and (iii) ω ji < µ i .Susceptible individuals become infected as soon as they receive an infectious contact, and infected individuals immediately become recovered when their infectious period terminates (initially recovered/vaccinated individuals never become infected).We let X = ∪ i∈V X i .Thus, the state of the population at time t ∈ [0, ∞], which takes values in {S, I, R} V , is a function of X .
We use r i and h ij to denote the (marginal) probability density functions (PDFs) for µ i and ω ij respectively, and z i and y i to denote P(Y i = 2) and P(Y i = 3) respectively.Thus, P(Y i = 1) = 1 − y i − z i .The probability that individual i ∈ V is in state Z ∈ {S, I, R} at time t ≥ 0 will be denoted by P Zi (t).
Importantly we assume that for every i ∈ V, is a set of associated random variables, as defined by Esary et al. (1967).Additionally, we assume statistical independence between the X * i , and that the Y i are mutually independent and independent of all other members of X .Consequently, the X i are independent and X * * ≡ ∪ i∈V {X * i , Y i } is a set of associated random variables.
The above assumptions of association and independence are made so that the message passing and pairwise systems, which we shall define, give rigorous bounds on the expected dynamics in the stochastic model, and exact correspondence when the graph is a tree or forest.
Our stochastic model represents a generalisation of that considered by Karrer and Newman (2010), and also generalises the model considered by Wilkinson and Sharkey (2014) which assumed that all members of X are mutually independent.Here, we do not make this last assumption and allow all of an individual's post-infection contact times (to each of its neighbours), and the negative of its infectious period, to be positively correlated.This could capture, for example, the scenario where infected individuals tend to either adopt some disease-combating behaviour, increasing the contact times to all of their neighbours and decreasing their infectious period, or to carry on as normal.
The model considered by Wilkinson and Sharkey (2014), which incorporates a directed graph, is equivalent to a special case of the above model.Directedness is still captured by the above model since, for any given i ∈ V and j ∈ N i , ω ij and ω ji are assigned independently.

The message passing system
Following Wilkinson and Sharkey (2014), we apply the message passing approach of Karrer and Newman (2010), to the stochastic epidemic model defined in section 2. Recall that message passing relies on the concept of the cavity state in order to simplify calculations.An individual is placed into the cavity state by cancelling its ability to make contacts.This does not affect its own fate but it does affect the fates of others because it cannot pass on the infection.
For arbitrary i ∈ V and neighbour j ∈ N i , let H i←j (t) denote the probability that i, when in the cavity state, does not receive an infectious contact from j by time t.We can now write: where f ij (τ )∆τ = h ij (τ )P (µ j > τ | ω ij = τ )∆τ is the probability (+o(∆τ )) that j makes an infectious contact to i during the time interval [τ, τ + ∆τ ) (for ∆τ → 0), where time is measured from the moment j becomes infected, and Φ j i (t) is the probability that j does not receive any infectious contacts by time t when i and j are both in the cavity state.The probability H i←j (t) is then approximated by F i←j (t), where Any solution of (3) which gives F i←j (t) ∈ [0, 1] for all t ≥ 0, and all i ∈ V, j ∈ N i , will thus be called feasible.It was shown by Wilkinson and Sharkey (2014), following Karrer and Newman (2010), that a feasible solution exists as the limit of an iterative procedure.
Theorem 1 (Uniqueness of the feasible solution of the message passing system).Assume that Then there is a unique feasible solution of (3).
Proof.See appendix A.
The message passing system can now be defined (for i ∈ V): where the variables on the left-hand side approximate P Si (t), P Ii (t) and P Ri (t) respectively (recall that P Si (t), P Ii (t) and P Ri (t) are respectively the probability that individual i is susceptible, infective and recovered at time t).
It was shown by Wilkinson and Sharkey (2014) that when the graph is finite and where T ij ∈ (0, ∞), i.e. contact processes are Poisson and independent of recovery processes, then the message passing system (3)-( 6) is equivalent to an individual-level pairwise system of integro-differential equations.Numerical solutions of certain special cases of the message passing system were computed by Wilkinson and Sharkey (2014).
Theorem 2 (The message passing system provides rigorous bounds on the stochastic model).For all t ≥ 0 and all i ∈ V, with equality if G is a tree or forest.
Proof.In the case where all members of X are mutually independent, this is proved by Wilkinson and Sharkey (2014)

The variance of the number of susceptible individuals
For the case of a finite tree or forest, in addition to providing a lower bound on the expected number of susceptibles at time t, message passing also offers a lower bound on the variance of this quantity.
To proceed, let where we define Theorem 3.For a finite tree or forest, and all t ≥ 0, we have Var(X(t)) ≥ i,j:i =j where XX(t) is double the number of unordered pairs of susceptible individuals at time t (which may or may not be neighbours).Thus, We can also write E[XX(t)] = i,j:i =j where P SiSj (t) is the probability that i and j are both susceptible at time t.
For a finite tree or forest, we have P Si (t) = S (i) mes (t) for all i ∈ V and t ≥ 0. Thus, using ( 11) and ( 12), the first inequality in (10) follows from (see appendix B for details) The second and third inequalities in (10) follow from (9).

Symmetric graphs and homogeneous dynamics
For the remainder of the paper we consider the special case of the stochastic model where the graph is symmetric and connected.Examples of symmetric connected graphs include complete graphs, ring lattices, infinite square lattices and Bethe lattices.In a symmetric graph, each individual has the same (finite) number n of neighbours, and we say that the graph is n-regular.To avoid triviality we assume n ≥ 2.
for any two ordered pairs of neighbours i, j, and i ′ , j ′ , there exists a graphautomorphism which maps i to i ′ and j to j ′ (Godsil and Royle 2001).
We also assume that the dynamics are homogeneous, by which we mean that the joint distribution of (Y i , µ i , ω ji (j ∈ N i )) is symmetric in its last n arguments and it is the same for all i ∈ V. Thus, it is impossible to distinguish between any two individuals by their behaviour or by their position in the graph.Note that we have not precluded the variables in X * i from being non-trivially associated (for all i ∈ V).
We use r and h to denote the (marginal) PDFs for µ i and ω ij respectively, and z and y to denote P(Y i = 2) and P(Y i = 3) respectively.Thus, P(Y i = 1) = 1 − y − z.To avoid triviality, we assume that 0 < z < 1 and 0 ≤ y < 1 − z.
Owing to symmetry (in this special case), the probability distribution for the state of an individual is the same for all individuals, i.e. for all i, i ′ ∈ V and all t ≥ 0, we have 6 The symmetric/homogeneous message passing system In the case of homogeneous dynamics, (3) becomes where we have used ) for all i ∈ V, j ∈ N i , and all i ′ ∈ V, j ∈ N i ′ , and all τ ≥ 0.
The arc-transitivity of symmetric graphs and the symmetry in ( 14) allow us to simplify (3)-( 6), and to write down the full symmetric/homogeneous message passing system as: where In deriving these equations, we have used ) for all i ∈ V, j ∈ N i and all i ′ ∈ V, j ′ ∈ N i ′ , and all t ≥ 0. Note that we have also made use of the fact that every individual has n neighbours.This system is identical in form to the message passing system for the configuration network model provided by Karrer and Newman (2010), in the case where every individual has n neighbours with probability 1.
From Theorem 1, we know that if sup τ ≥0 f (τ ) < ∞ then (18) has a unique feasible solution.We also know, from ( 7) and ( 8), that this system cannot overestimate P S (t) and cannot underestimate P R (t), for all t ≥ 0. In appendix C, we prove that for the case where contact and recovery processes are independent and Poisson, with rates β and γ respectively, the mean field system given by Ṡ(t) = −βnS(t)I(t) and İ(t) = βnS(t)I(t) − γI(t) provides similar but coarser rigorous bounds on the stochastic model (see also Wilkinson et al. (2016), where it is proved that, for non-random initial conditions, the deterministic Kermack-McKendrick model bounds the general stochastic epidemic).

Example 1: Poisson transmission and recovery
For independent Poisson transmission and recovery processes (specifically, τ i and ω ji are independent and exponentially distributed with rates γ and β respectively), with f (τ ) = βe −(β+γ)τ , the symmetric/homogeneous message passing system can be solved via the following ordinary differential equations (ODEs): with S mes (t) and I mes (t) given by ( 15)-( 16).

Example 2: Poisson transmission and fixed recovery
For Poisson transmission processes and a fixed recovery period (specifically, where θ is the Heaviside step function, the symmetric/homogeneous message passing system can be solved using the following delay differential equation: with and S mes (t) and I mes (t) given by ( 15)-( 16).
Other choices of f (τ ) exist which allow the message passing system to be solved via (non-integro) differential equations, such as the top hat function (Karrer and Newman 2010) which incorporates an infected-but-not-infectious (i.e.latent, or exposed) stage.7 Generalised pairwise system (derived from a special case of the symmetric/homogeneous message passing system) Pairwise systems which capture graph-based epidemic dynamics with general infectious periods (and Poisson transmission processes) were introduced by Wilkinson and Sharkey (2014, equations 8 and 9).Here we consider the form of these equations when the graph is finite and symmetric, and the dynamics are homogeneous.We assume that transmission processes are Poisson with rate β and that they are independent from the recovery processes, such that f (τ ) = βe −βτ ∞ τ r(τ ′ )dτ ′ .We also assume that r(τ ) is continuous.In this case, the following pairwise system which incorporates a general infectious pe-riod can be derived from ( 15)- (18) (see appendix D): [SS] where [I] (t) ≡ N I mes (t), (28  25) and ( 26) are undefined, but in this case the left-hand sides are equal to zero).
Theorem 4 (The generalised pairwise system provides rigorous bounds on the stochastic model).For homogeneous SIR dynamics on a symmetric graph (defined at the beginning of section 5, with reference to section 2), where the graph is finite, and where transmission processes are Poisson with rate β and independent from the recovery processes, the pairwise system (23)-( 26)with initial conditions: and Proof.From ( 27) and ( 28), [S](t) = N S mes (t) and (16).The theorem follows immediately from the inequalities ( 7) and ( 8).
Remark 1.In the case where the infectious period is exponentially distributed, ( 24) and ( 26) simplify to ordinary differential equations, and the pairwise (without clustering) model of Keeling (1999) is obtained.Similarly, we note that after substituting r(τ ) = δ(t − R), where δ is the dirac delta function, into (24) and ( 26), the pairwise model of Kiss et al. (2015) for a non-random infectious period of duration R is obtained (except that the last term in (24) and the last term in (26), which relate to the behaviour of the initial infectives, need to be neglected).However, it may be more efficient to solve the simpler message passing systems (via ( 19)-( 20) and ( 21)-( 22) respectively) and then, if pairwise quantities are required, these can be computed using ( 29) and (30).The equivalence between message passing systems and pairwise systems, and their relative merits, were investigated by Wilkinson and Sharkey (2014).
Remark 2. By dividing the singlet quantities by N , and the pair quantities by nN , the pairwise system (23)-( 26) with initial conditions (31)-(32) becomes applicable to infinite symmetric graphs, with the variables then approximating fractional quantities (all dependence on N disappears).In this case, Theorem 4 still holds in the sense that S mes (t)(≡ [S](t)/N ) ≤ P S (t) and R mes (t)(≡ (N − [S](t) − [I](t))/N ) ≥ P R (t), for all t ≥ 0. Note that when the graph is a Bethe lattice (infinite tree), the pairwise system must exactly capture P S (t), P I (t) and P R (t), using Theorem 2.
8 The Kermack-McKendrick model as a special asymptotic case of the symmetric/homogeneous message passing system Here, we consider a sequence of stochastic models, assuming symmetric graphs and homogeneous dynamics, where the regular degree n tends to infinity.As n → ∞, an individual is able to make contacts to a number of neighbours which tends to infinity, so to obtain a finite limit we assume that the infection function f (τ ) depends on n, and write f n (τ ), and that Note that, in the limit of large n, transmission is frequency dependent and the expected number of infectious contacts made by a given infected individual during the time interval (t 1 , t 2 ) is t2 t1 f * (τ )dτ , where time is measured from the moment the individual first became infected.
The deterministic model proposed by Kermack and McKendrick (1927) is as follows: Equations 12-15 of Kermack and McKendrick (1927) may be obtained from (34)-(36) after multiplying through by the total population size N in their paper.
The following theorem shows that, under this limiting regime and mild further conditions, the message passing system is equivalent to the model of Kermack and McKendrick (1927).For n = 1, 2, . . ., let S mes(n) (t), I mes(n) (t) and R mes(n) (t) denote the message passing system given by ( 15)- (18), where F sym (t) is replaced by F sym(n) (t), which satisfies (18) with f (τ ) replaced by f n (τ ).
Differentiating (15) yields and differentiating (18), using Leibniz's integral rule (see appendix E), gives Substituting ( 42) into (41), and using (15), gives It can be shown, using (34) and (43) that, for all t ∈ [0, T ], where B(n, T ) → 0 as n → ∞ and 0 ≤ A(n, T ) ≤ 4M T for all sufficiently large n (see appendix F).Application of Gronwall's inequality (see appendix E) then yields that, for all t ∈ [0, T ], Thus lim 9 Analysis of the symmetric/homogeneous message passing system, and the pairwise system, and implications for the stochastic model Here, we analyse ( 15)-( 18) and consider the implications for the stochastic model in the special case of symmetric graphs and homogeneous dynamics (defined at the beginning of section 5, with reference to section 2).Consequently, we obtain results for the pairwise system which is derived from a special case of the symmetric/homogeneous message passing system.After modifying the message passing equations of Karrer and Newman (2010) to accommodate vaccinated individuals, the final size relation (46) in Theorem 6, below, can be derived from equations 28 and 29 of their paper in the special case where every individual has n neighbours with probability 1.
To proceed, let (c.f. ( 15)-( 18)) and note that this quantity exists in [0, z] since S mes (t) is decreasing (see appendix A) from S mes (0)(= z) and bounded below by zero.Similarly, let (c.f. ( 23)-( 30)) [S](∞) ≡ lim which must exist in [0, 1] since t 0 f (τ )dτ is increasing from zero and bounded above by 1. (Note that p is the probability that an infected individual makes at least one infectious contact to a given neighbour during its entire infectious period.)Theorem 6 (Final size relations).S mes (∞) is given by the unique solution of Similarly, for the pairwise model, [S](∞) is given by the unique solution of Proof.Feasible F sym (t) is decreasing (see appendix A) and converges to some Note also that, by definition, t 0 f (τ )dτ converges to p ∈ [0, 1] as t → ∞.Thus, c.f. Karrer and Newman (2010), equations 23 and 24, letting t → ∞ in (18) and using the dominated convergence theorem yields Taking the limit as t → ∞ in (15), and making use of (48), equation ( 46) is proved.Equation (47) then follows from (27).
There is a unique solution of (46) in [0, z] since, letting x = (S mes (∞)/z) 1/n and assuming p > 0, the left-hand side is equal to x and the right-hand side, say g(x), is convex in x for x ∈ [0, 1]; and we have g(0) ≥ 0 and g(1) < 1.This means that there is a unique solution of x = g(x) in [0, 1] and so a unique solution giving S mes (∞) ∈ [0, z].When p = 0, S mes (∞) = z is the unique solution of (46).
There is a unique solution of (47) in [0, zN ] by an entirely analogous argument.
Remark 5.It is straightforward, recalling (7) and the definition of the stochastic model (assuming a symmetric graph and homogeneous dynamics), that Thus, solving for S mes (∞) in (46), we obtain a rigorous lower bound on the probability of an arbitrary individual being susceptible at time t, and a rigorous upper bound on the probability of an arbitrary individual being recovered at time t; both for any fixed t and in the limit as t → ∞.If f (τ ) = βe −βτ ∞ τ r(τ ′ )dτ ′ , and the symmetric graph is finite, then for the pairwise model we must have [S](∞)/N ≤ P S (∞) = 1 − P R (∞), by Theorem 4.
Theorem 7 (Sufficient conditions for no epidemic, in the stochastic model, when the fraction initially infected is small while the population size is large).Assume that the symmetric graph is infinite (but n < ∞), and let y be fixed while z → 1 − y from below (the fraction of the population that are initially infected goes to zero while the number that are initially infected is infinite).In this case, where we have defined R 0 ≡ (n − 1) (This means that if each individual is independently vaccinated with probability greater than or equal to 1 − 1/R 0 , or if R 0 ≤ 1, then an epidemic is impossible and the fraction of the population that are susceptible is unchanging.) Proof.Here, (46) becomes: For there to be a solution in [0, 1 − y) it is necessary that y < 1 − 1/R 0 , where R 0 = (n− 1)p.This follows from the fact that, letting x = (S mes (∞)/(1 − y)) 1/n and assuming p > 0, the left-hand side is equal to x and the right-hand side, say g(x), is convex in x for x ∈ [0, 1]; and we have g(0) > 0 and g(1) = 1.Thus, if g ′ (1)(= R 0 (1 − y)) ≤ 1 then x = g(x) has no solutions with x ∈ [0, 1), and so there are no solutions giving S mes (∞) ∈ [0, 1−y).If p = 0 then S mes (∞) = 1−y is the unique solution of (49).Since P S (t) ≥ S mes (t), and P S (t) is decreasing from P S (0) = S mes (0), the theorem is proved.Remark 6.Instead of assuming an infinite graph in Theorem 7, we can consider an infinite sequence of finite stochastic models (assuming symmetric graphs and homogeneous dynamics), indexed by m, where y m = y ∈ [0, 1), and where This does not preclude the expected number of initial infecteds from tending to some positive number, or even diverging, as m → ∞.It is straightforward that, in the limit of this sequence, the sufficient conditions for no epidemic in Theorem 7 still hold.Note that if in addition we have n m → ∞ as m → ∞, then the final size relation for the symmetric/homogeneous message passing system (in this limit) becomes, using (49), This is a well known final size relation in the mean field literature (see Miller (2012) for a discussion of derivations of this relation).
Theorem 8 (Cycles in the graph tend to inhibit the epidemic in the stochastic model).Assume that sup τ ≥0 f (τ ) < ∞.In this case, for homogeneous SIR dynamics on symmetric graphs, the probability of an arbitrary individual being susceptible at a given time, for the n-regular Bethe lattice (infinite tree), is less than or equal to this quantity for all other n-regular symmetric graphs (where the stochastic model is otherwise unchanged).The same holds for the probability of an arbitrary individual being recovered except with the inequality reversed.
Proof.From ( 7) and ( 8), we know that system (15)-( 18) cannot overestimate the probability of an arbitrary individual being susceptible at time t and cannot underestimate the probability of an arbitrary individual being recovered at time t.However, from Theorem 2, the system is exact if the graph is a tree.
Remark 7. Theorem 8 suggests that, across all n-regular graphs, an infection will have the greatest impact by time t in those which are most tree-like.Indeed, it is known that clustering and the presence of cycles in the graph may slow down and limit the spread of an infection (see Miller (2009) and references therein).

Discussion
The message passing representation of SIR epidemic dynamics on networks was proposed by Karrer and Newman in 2010.Here we have shown that for a generalised version of these dynamics, the iterative solution obtained by Karrer and Newman is unique.For the case of trees, we also used the message passing equations to derive a rigorous lower bound on the variance of the number of susceptibles at any time.
Most of the work presented here concerns the analysis of a low-dimensional message-passing system with a single integral equation.We showed that this provides rigorous bounds for non-Markovian stochastic SIR dynamics on symmetric graphs.This result follows from the application of methods and results in Karrer and Newman (2010), together with the generalisation in Wilkinson and Sharkey (2014)).We note that this low-dimensional system is identical in form to the Karrer and Newman system for configuration networks when the graph is k-regular.
From this system, we constructed a population-level pairwise system which incorporates a general infectious period, and which can also be derived from the more general individual-level pairwise system of Wilkinson and Sharkey (2014, equations 8 and 9).This population-level system contains the Poisson pairwise model of Keeling (1999) as a special case.It also contains the delay differential equation model of Kiss et al. (2015) as a special case, apart from terms concerned with the initial conditions.
We demonstrated that, in the limit of large population size, the general message passing formalism of Karrer and Newman (2010), when applied appropriately, yields the Kermack-McKendrick model (1927).
After analysing the low-dimensional message passing system we obtained a single transcendental equation which captures its long term behaviour, and used this to state a theorem concerning the long term behaviour in the stochastic model.We also showed that, across all symmetric graphs with regular degree n, a given SIR process will have the most impact in the Bethe (tree) lattice, highlighting the well-known impact of clustering in limiting an epidemic (see, for example, Miller (2009)).
An interesting development of this work would be to show that the Kermack-McKendrick model ( 34)-(36) bounds the symmetric/homogeneous stochastic model (extending the result that the deterministic general epidemic bounds the general stochastic epidemic (Wilkinson et al. 2016)).We observe that this could be achieved by showing that the message passing system for the stochastic model is the first in a sequence of message passing systems indexed by n, which satisfies the conditions for Theorem 5, and where S mes(n) (t) is decreasing with n; this is easy to do for Poisson transmission and recovery processes (see appendix C).Another extension worthy of investigation is to multitype SIR epidemics.
A Uniqueness, monotonicity and continuity of the feasible solution of the message passing system Reproducing an argument from Karrer and Newman (2010), we here construct a feasible (bounded between 0 and 1) solution of (3).Let F i←j (0) (t) = 1 for all i ∈ V, j ∈ N i and all t ≥ 0, and define the following iterative procedure.For m = 1, 2, . .., let as m → ∞, and F ∞ (t) is a feasible solution of (3).Moreover, letting F * (t) be any feasible solution of (3), it can be shown, arguing as in Corduneanu (1991), section 1.3, that sup i∈V,j∈Ni where N max = sup i∈V |N i | and f max = sup i∈V,j∈Ni sup t ′ ≥0 f ij (t ′ ).Assume that N max < ∞ and f max < ∞.Then, the right-hand side of (51) converges to zero as m → ∞, and F ∞ (t) must be the unique feasible solution of (3).Note that (50) implies that if, for all i ∈ V, j ∈ N i , it is the case that F i←j (m−1) (t) is non-increasing and belongs to [0, 1] for all t ≥ 0, then these properties are also held by F i←j (m) (t) for all i ∈ V, j ∈ N i .Since these properties are held by F i←j (0) (t)(= 1) for all i ∈ V, j ∈ N i , then F i←j (∞) (t) is non-increasing for all i ∈ V, j ∈ N i .Thus, the feasible solution of (18) (for F sym (t)) is non-increasing, and so S mes (t) is non-increasing.
To show continuity of the feasible solution, first note that (50) implies that if, for all i ∈ V, j ∈ N i , it is the case that is continuous for all m ≥ 0, i ∈ V, j ∈ N i .Now, for any fixed T > 0, the bound in (51) holds for all t ∈ [0, T ] provided t in the right-hand side of (51) is replaced by T .Thus F m (t) converges uniformly to F ∞ (t) over [0, T ] as n → ∞ and, since each F m (t) is continuous on [0, T ], it follows that F ∞ (t) is also continuous on [0, T ].This holds for any T > 0, so F ∞ (t) is continuous on [0, ∞).

B Bounds provided by the message passing system
Similarly to Wilkinson and Sharkey (2014, section III), and Ball et al. (2015), it is straightforward to show that the indicator variable ½ i←A(t) for the event that a cavity state-individual i ∈ V does not receive any infectious contacts from any of A ⊂ N i by time t ≥ 0 is a function of the random variables X * * \ {Y i } (see paragraph containing (1)), and that it is non-decreasing with respect to each.Thus, since we have assumed that X * * is a set of associated variables and that Y i is independent of all other members of X * * , then by the definition of association (Esary et al. (1967)), we have with equality occurring when the graph is a tree or forest (where putting an individual into the cavity state prevents any dependencies between the states of its neighbours).Recall that z i ≡ P(Y i = 2) is the probability that i is initially susceptible.By an entirely analogous argument it can also be shown that with equality occurring when the graph is a tree or forest and j ∈ N i (we define If the graph is a tree or forest, but i and j are not neighbours, then the right-hand side of (53) is equal to P Si (t)P Sj (t) which in general does not equal P SiSj (t), unless i and j belong to distinct trees, as the states of i and j at time t may both be influenced by the states during [0, t] of individuals in the path joining i and j; if the graph is a tree or forest, and i and j are neighbours, then the states of individuals in (N i ∩ N j ) \ {i, j} are independent (when i and j are in the cavity state).
Similarly, the indicator variable ½ (i)j←A(t) for the event that a cavity stateindividual j ∈ V does not receive any infectious contacts from any of A ⊂ N j \ i by time t ≥ 0, where i ∈ N j is also in the cavity state, is a function of the random variables X * * , and it is non-decreasing with respect to each.Again, since we have assumed that X * * is a set of associated variables then we have (c.f. ( 2) and (3)), where the second inequality follows from the fact that taking an individual out of the cavity state cannot increase the probability that a different individual receives no infectious contacts from a given neighbour by time t ≥ 0. Again, equality occurs when the graph is a tree or forest.Using (54) in conjunction with (2) we have where equality occurs when the graph is a tree or forest.Using (55), it is straightforward to show by the iterative procedure in appendix A (except with F i←j (0) (t) = H i←j (t)) that a unique feasible solution of (3) exists and, using this solution, that F i←j (t) ≤ H i←j (t) for all i ∈ V, j ∈ N i and all t ≥ 0, with equality occuring when the graph is a tree or forest.This fact, in combination with (52), c.f. (4), proves (7), and consequently, c.f. (6), gives (8); in combination with (53) we get (13).
C Rigorous bounds provided by a mean field system (when the stochastic model is Markovian) Here, we consider the stochastic model (section 2) for the special case of a kregular symmetric graph and homogeneous dynamics (defined at the beginning where f * (τ ) = β ′ e −γτ and r(τ ) = γe −γτ .Therefore, if S mes(n) (t) ≡ zF sym (t) n is strictly decreasing with respect to n, for all t > 0, then indeed lim n→∞ S mes(n) (t) exists and we have S mes (t) > S(t) for all t > 0 (recall that F sym (t) itself depends on n, c.f. ( 42)).We now show this to be the case.Letting u n (t) = F sym (t) n (= S mes(n) (t)/z), we can write (c.f. ( 19)) For fixed u ∈ (0, 1), we have u n−1 n strictly decreasing with n, and also strictly decreasing with n.Therefore, since u n (0) = 1 and u n (t) ∈ (0, 1) for t > 0, it follows that u n (t) (and hence S mes(n) (t)) is strictly decreasing with n for all t > 0.

D Pairwise equations
Here, we consider the stochastic model in the case of a symmetric n-regular graph and homogeneous dynamics (defined at the beginning of section 5).We assume that transmission processes are Poisson with rate β and that they are independent of the recovery processes, specifically f (τ ) = βe −βτ ∞ τ r(τ ′ )dτ ′ .We assume that r(τ ) is continuous so that we may apply Leibniz's integral rule to compute derivatives (see appendix E).In this case, a pairwise system incorporating a general infectious period can be derived from the low-dimensional message passing system (15)- (18) with the additional variables: SS mes (t) ≡ z 2 F sym (t) 2(n−1) , (61) where SS mes (t) approximates the probability that a pair of neighbours are susceptible at time t, and SI mes (t) approximates the probability that the first is susceptible and the second is infected at time t (see Wilkinson and Sharkey (2014, section II B) where these quantities are derived in a more general context).To understand the construction of the factor in brackets in (62), note that for any pair of neighbours i, j, the probability that i is susceptible and j is infected at time t remains the same when i is placed into the cavity state.

E Continuity assumptions for the application of Leibniz's integral rule and Gronwall's inequality
To derive (42), Leibniz's integral rule was applied to (18), and this is valid if f (τ ) (or f n (τ )) and Ḟsym (t) are assumed to be continuous.Similarly, the application of the rule in the derivation of (67) and ( 69) is valid if r(τ ) and Ḟsym (t) are assumed to be continuous.Here we show that all of these continuity assumptions are satisfied if f (τ ) is continuously differentiable; if f (τ ) = βe −βτ ∞ τ r(τ ′ )dτ ′ then this is the case when r(τ ) is continuous.
To derive (45), Gronwall's inequality was applied to (44), and this is valid if Ṡmes(n) (t) and Ṡ(t) are continuous.By condition (iii) of Theorem 5, we have that Ḟsym(n) (t) is continuous (by the above argument), so Ṡmes(n) (t) is continuous.
(i) and (iii) imply that f * (t) is continuous, which implies that Ṡ(t) is continuous.
cannot overestimate the expected number susceptible at any time, i.e. [S](t) ≤ N P S (t) for all t ≥ 0. Additionally, N − [S](t) − [I](t) cannot underestimate the expected number recovered-or-vaccinated at any time, i.e.N − [S](t) − [I](t) ≥ N P R (t) for all t ≥ 0.
(Kermack and McKendrick 1927)ssion and recovery processes, writing the infection rate as β n , we have f n (τ ) = β n e −(βn+γ)τ and r(τ ) = γe −γτ .Assuming that β n = β/n, where now β is the constant (Poisson) rate at which an infected individual makes infectious contacts at random to its set of neighbours, yields f * (τ ) = βe −γτ (τ ≥ 0).Substituting this into the Kermack-McKendrick model (34)-(36), generates the deterministic general SIR epidemic which is expressible as a system of ODEs(Kermack and McKendrick 1927).Note that in this case, the conditions of Theorem 5 are satisfied.