Accelerating Bayesian inference for stochastic epidemic models using incidence data

We consider the case of performing Bayesian inference for stochastic epidemic compartment models, using incomplete time course data consisting of incidence counts that are either the number of new infections or removals in time intervals of fixed length. We eschew the most natural Markov jump process representation for reasons of computational efficiency, and focus on a stochastic differential equation representation. This is further approximated to give a tractable Gaussian process, that is, the linear noise approximation (LNA). Unless the observation model linking the LNA to data is both linear and Gaussian, the observed data likelihood remains intractable. It is in this setting that we consider two approaches for marginalising over the latent process: a correlated pseudo-marginal method and analytic marginalisation via a Gaussian approximation of the observation model. We compare and contrast these approaches using synthetic data before applying the best performing method to real data consisting of removal incidence of oak processionary moth nests in Richmond Park, London. Our approach further allows comparison between various competing compartment models.


Introduction
The starting point for formulating a model of epidemic spread is usually a set of compartments or classes, characterising the individuals participating in the epidemic (see e.g.Jacquez, 1972).A transmission model then describes the dynamics of individuals within each class, and this can be combined with models of severity and detection/observation (see e.g.Birrell et al., 2020) to give an overarching model that links epidemic data to latent disease transmission.The transmission model can be deterministic or stochastic, with the former typically taking the form of a coupled, nonlinear ordinary differential equation (ODE) system and the latter a continuous-time Markov jump process (MJP).The link between deterministic and stochastic models is made clear in Kurtz (1970) (see also Kurtz, 1971), with the ODE approach seen as a large population limit of the MJP.However, while fitting ODE models in the presence of a simple observation model is relatively straightforward, they ignore intrinsic stochasticity, which may play an important role in the dynamics of the epidemic, particularly at the start or the end of an outbreak, when numbers of individuals with the disease are likely to be small.Stochastic transmission models have been widely adopted for small-size epidemics (see e.g.Boys and Giles, 2007;Stockdale et al., 2017;Funk et al., 2018) whereas Corbella et al. (2022) (see also Birrell et al., 2011) combine a deterministic transmission model with sophisticated stochastic observation models.
Although complex stochastic epidemic models can provide an accurate description of disease transmission, fitting such models to discrete-time data that may be incomplete and subject to error is typically complicated by the intractability of the observed data likelihood.Earlier attempts to address this issue include the use of data augmentation and Metropolis-Hastings steps to integrate over the uncertainty associated with unobserved dynamic components (Gibson and Renshaw, 1998;O'Neill and Roberts, 1999).Recent attention has focused on approaches that only require the ability to generate forward realisations from the transmission model such as approximate Bayesian computation (McKinley et al., 2009;Kypraios et al., 2017) and pseudo-marginal methods (McKinley et al., 2014;Spannaus et al., 2020;Corbella et al., 2022).Nevertheless, these methods typically require many (millions of) model simulations which can be impracticable for large-size epidemics, that is, epidemics in which the population size is greater than a few thousand individuals.Alternative approaches that aim to reduce the computational burden include the use of cheap but approximate "surrogate" methods including the use of Gaussian process emulation (Scarponi et al., 2022;Swallow et al., 2022), direct approximation of the MJP e.g.via a linear noise approximation (LNA, Fintzi et al., 2021) and tractable approximation of the observed data likelihood (see e.g.Whiteley and Rimella, 2021).
In this paper, we consider incidence data consisting of the number of new cases (either infections or removals) accumulated in an observation interval.We further assume imperfect observations and consider two approaches commonly used to allow for under reporting or over dispersion.We build on the work of Fintzi et al. (2021) by adopting a linear noise approximation of the latent cumulative incidence process.Whereas Fintzi et al. (2021) integrate over the uncertainty in the latent process via a sampling approach, we introduce a further Gaussian approximation of the observation model, allowing analytic integration of the latent incidence process.Our framework additionally allows for a time-varying infection rate, as is typically required for accounting for seasonality and/or interventions.The infection rate is modelled stochastically as an additional component in the system of stochastic differential equations which the LNA approximates.Hence, our contribution is a fast and efficient sampling-based framework for inferring the parameters of a general class of stochastic epidemic models.We benchmark the performance of our approach against state-of-theart correlated pseudo-marginal methods (Dahlin et al., 2015;Deligiannidis et al., 2018) in terms of both accuracy and efficiency, using a susceptible-infectious-removed (SIR) model.
Finally, we consider the application of the methodology to the infestation of the oak processionary moth (OPM), Thaumetopoea processionea, in Richmond Park, London.Using time course data consisting of the yearly removal incidence of infested trees between the years 2013 and 2020, we compare and contrast an SIR model with a model in which infected trees can re-enter the susceptible class.The assumed initial population size is some 40,000 oak trees with the number of susceptible trees reducing to around 35,000 over the time frame of the data set.The size of the epidemic necessitates analytic integration of the latent incidence process; discrete stochastic models combined with exact (simulation-based) inference methods such as data augmentation (see e.g.Jewell et al., 2009) are practically infeasible here; see Stockdale et al. (2021) for a recent discussion.
The remainder of this paper is organised as follows.Stochastic epidemic models, and in particular, the jump process and subsequent LNA representations of the cumulative incidence process are considered in Section 2. The inference task is described in Section 3, including marginalisation of the incidence process via pseudo-marginal and analytic methods, with the latter using an additional approximation.Applications are considered in Section 4 with a discussion of limitations of the proposed approach in Section 5.

Stochastic epidemic models
For ease of exposition, we consider an SIR epidemic model (Andersson and Britton, 2000;Kermack and McKend 1927) within which a population of fixed size N pop is classified into compartments consisting of susceptible (S), infectious (I) and removed (R) individuals.However, we note that the framework can be easily extended to allow for additional compartments e.g.SEIR models (Hethcote, 2000) which allows for susceptibles entering an exposed class prior to becoming infectious.

S I R β γ
Figure 1: SIR compartment model.
The SIR compartment model is shown in Figure 1.Transitions between compartments can be described by the set of pseudo-reactions given by The first transition describes contact of an infective individual with a susceptible and with the net effect resulting in an additional infective individual and one fewer susceptible.The final transition accounts for removal (recovered with immunity, quarantined or dead) of an infected individual.
In what follows, we describe the most natural stochastic SIR model as a Markov jump process before considering a linear noise approximation suitable for incidence data.

Markov jump process
Let X t = (S t , I t ) ′ denote the numbers in each state at time t ≥ 0 and note that R t = N pop − S t − I t for all t ≥ 0. We denote by θ = (β, γ) ′ the vector of parameters.The dynamics of {X t , t ≥ 0} are most naturally described by a Markov jump process (MJP), that is, a continuous time, discrete valued Markov process.Assuming that at most one event can occur over a time interval (t, t + ∆t] and that the state of the system at time t is x t = (s t , i t ) ′ , the MJP representation of the prevalence process is characterised by transition probabilities of the form where o(∆t)/∆t → 0 as ∆t → 0. Similarly, the cumulative incidence of infection and removal events {N t , t ≥ 0} is an MJP governed by the transition probabilities where n t = (n 1,t , n 2,t ) ′ denotes the cumulative number of infection and removal events at time t.
The processes describing the prevalence {X t , t ≥ 0} and cumulative incidence {N t , t ≥ 0} are linked via the equation where x 0 represents the initial number of susceptible and infected individuals, N i,t denotes the ith component of the incidence process at time t and S i is the ith column of the stoichiometry matrix Given x 0 and θ, generating exact realisations of the incidence process, and therefore the stochastic SEIR model is straightforward and can be achieved by using well known simulation algorithms from the stochastic kinetic models literature (see e.g.Wilkinson, 2018).At this point, it will be helpful to define the instantaneous rate or hazard function h for X t+∆t resulting from either an infection or removal reaction respectively.Note that θ is suppressed here for notational convenience.Then, given a state x t at time t, Gillespie's direct method (Gillespie, 1977) simulates the time to the next event as an exponential random variable with rate 2 i=1 h i .The event that occurs will be of type i (with i = 1 infection, i = 2 removal) with probability proportional to h i .

Linear noise approximation (LNA)
The linear noise approximation (LNA) is most commonly presented as a Gaussian process approximation of the MJP description of the prevalence process {X t , t ≥ 0} (see e.g.Ross et al. (2009); Fearnhead et al. (2014); Fuchs (2013) in the epidemic context and Ferm et al. (2008); Komorowski et al. (2009); Stathopoulos and Girolami (2013) in a wider systems biology context).As in Fintzi et al. (2021), we require an approximation of the cumulative incidence process {N t , t ≥ 0}.Although this can be derived in a number of more or less formal ways, we give an intuitive derivation along the lines of Wallace (2010).
Consider an infinitesimal time interval, (t, t + dt], over which the reaction hazards will remain constant almost surely.Consequently, the counting process over this interval for the ith component, denoted by dN i,t , is Poisson distributed with rate h i dt.Stacking these quantities in the vector dN t it should be clear that Hence, the Itô Stochastic differential equation (SDE) that best matches the MJP representation of the incidence process is given by where W t is a length-2 vector of uncorrelated standard Brownian motion processes and diag{ h(x t )} is a 2 × 2 diagonal matrix with non-zero entries given by h 1 (x t ) and h 2 (x t ).Note that the RHS of (2) can be written explicitly in terms of n t via (1) which gives x t = (s 0 − n t,1 , i 0 + n t,1 − n t,2 ) ′ .We then further define the hazard function written in terms of n t as for which (2) becomes The SDE in (3) can be linearised as follows.Consider a partition of N t as N t = η t + R t where η t is a deterministic process satisfying the ordinary differential equation (ODE) and R t = N t − η t is a residual stochastic process satisfying the (typically) intractable SDE We obtain an approximate, tractable Rt by Taylor expanding h * (n t ) and diag{h * (n t )} about η t .
Retaining the first two terms in the expansion of the former and the first term in the expansion of the latter gives where F t is the Jacobian matrix with (i,j)th element given by the partial derivative of the ith component of h * (η t ) with respect to the jth component of η t .Hence, we obtain The solution of ( 6) is straightforward to obtain (see e.g.Fearnhead et al., 2014, among several others).Omitting details, we arrive at where the fundamental matrix G t satisfies Note that I 2 and 0 2 are the 2×2 identity and zero matrices respectively.The LNA for the cumulative incidence process is then summarised by ( 7) and ( 4), ( 8), (9).

Time varying infection rate
In practice it may be unreasonable to assume that the infection rate in the SIR model remains constant throughout the epidemic (e.g.due to seasonality and/or interventions).We therefore follow Dureau et al. (2013) where {W 3,t , t ≥ 0} is a standard Brownian motion process.Combining (10) with (3) gives a coupled SDE for N t = (N 1,t , N 2,t , N 3,t ) ′ of the form where W t is a length-3 vector of uncorrelated standard Brownian motion processes.The LNA of (11) follows in the same way as Section 2.2, albeit with the Jacobian matrix F t redefined as and the RHS of ( 4) and ( 9) augmented to include a(n 3,t ) and b 2 (n 3,t ).

Bayesian inference
In this section, we consider the problem of performing fully Bayesian inference for the parameters (and unobserved dynamic processes) governing the SIR (LNA) model, based on incidence observations that we assume are incomplete and subject to measurement error.We describe the observation model before considering the inference task.For ease of exposition, we assume a constant infection rate, but note that extension of the methodology to a time varying infection rate is straightforward and considered in Section 4.

Observation model
Without loss of generality, consider data y = (y 1 , . . ., y T ) ′ at integer times, where y t is a (partial) observation on the cumulative incidence ∆N Commonly used models for incidence data include additive Gaussian noise (Dureau et al., 2013), the Binomial distribution (Cauchemez and Ferguson, 2008) and the Negative Binomial distribution (Lloyd-Smith, 2007;Fintzi et al., 2021;Spannaus et al., 2020).The latter two models are typically used under the assumption of under reporting and to capture overdispersion, respectively.In large population settings, they may be well approximated by a Gaussian distribution which may offer computational benefits when combined with a Gaussian description of the underlying epidemic dynamics, such as the LNA described in Section 2.2.These models take the form for t = 1, . . ., T .We assume that Y t is univariate and P is a constant matrix with P ′ = (1, 0) corresponding to noisy counts of new infections in a given time window and P ′ = (0, 1) for removals.We further assume that the observations are independent (given the latent process) and we let π(y t |∆n t , ψ) denote the probability mass function linking y t and ∆n t = n t − n t−1 , with ψ denoting the parameters governing the observation model.For example, in ( 14), ψ = (λ, φ) ′ with λ controlling the average proportion of cases seen and φ is the (inverse) overdispersion parameter.

Inference task
We assume that interest lies in the vector of all static parameters θ = (β, γ, ψ ′ , x ′ 0 ) ′ including the initial state x 0 = (s 0 , i 0 ) ′ for convenience, and the latent incidence process at the observation times n = {n t , t = 0, . . ., T }.
Upon ascribing a prior density π(θ) to θ, Bayesian inference proceeds via the joint posterior where and π(n t |n t−1 , x 0 , β, γ) is the Gaussian transition density obtained from (7) with the ODEs ( 4) and ( 9) integrated over [t − 1, t] with η t−1 = n t−1 and V t−1 = 0 2 .Note that in this case the residual r t−1 = n t−1 − η t−1 = 0 and subsequently the ODE satisfied by G t in (8) need not be integrated.Finally, Since the joint posterior in (15) will be intractable, we resort to Monte Carlo methods for generating samples of the parameters and latent dynamic process.A Gibbs sampler provides a natural mechanism for sampling (15), whereby one alternates between draws of θ|n, y and n|θ, y.However, dependence between n and θ can lead to poor mixing.For this reason, Fintzi et al. ( 2021) use a non-centred parameterisation whereby standard Gaussian innovations driving the generative form of the LNA are used as the effective components to be conditioned on.In what follows, we take a different approach by marginalising out the latent process, either via (correlated) pseudomarginal methods (e.g.Andrieu et al., 2010;Deligiannidis et al., 2018) or by further approximating the observation model in the non Gaussian case.
The form of ( 16) suggests a two step approach to inference whereby samples are first drawn from the marginal parameter posterior π(θ|y) in step 1, and then conditioned on in a second step when drawing samples of the latent process from π(n|θ, y).However, unless the observation model takes the linear Gaussian form of ( 12), neither the observed data likelihood π(y|θ) in ( 17) nor the constituent densities in (16) will be tractable, despite the linear Gaussian structure of the LNA.The main focus of this paper is exactly this intractable scenario, and we now consider two approaches to address it.

Pseudo-marginal methods
Consider first the intractable observed data likelihood π(y|θ) which can be factorised as where y 1:t−1 = (y 1 , . . ., y t−1 ) ′ .The terms in (18) can be recursively estimated using a particle filter (see e.g.Chopin and Papaspiliopoulos, 2020, for an overview) in such a way that realisations of a non-negative unbiased estimator of the full likelihood are obtained.We denote this estimator by πU (y|θ) = πU 1 (y 1 |θ)  4) and ( 9) over (t, t + 1] with initial conditions η t+1 ũk,t+1 and ∆n 2. Compute the weights.For k = 1, . . ., N : 3. Resample N particles using systematic resampling with uniform draw ūt+1 and weights w (k) t+1 , k = 1, . . ., N } to be used in step t + 1, an estimate for the current marginal likelihood term πu t+1 (y t+1 |y where the flattened vector U = (U ′ 1 , . . ., U ′ T ) ′ ∼ g(u) denotes all random variables used in the construction of the estimator.Hence, unbiasedness here means that E U ∼g {π U (y|θ)} = π(y|θ).Algorithm 1 gives step t + 1 of the particle filter and can be executed for t = 0, . . ., T − 1 upon initialising with particles {n where the kth value of Ũt+1 is Ũk,t+1 ∼ N(0, I 2 ) and used to propagate particles in step 1(b); Ūt+1 ∼ Unif(0, 1) is used in the systematic resampling step 3.As presented, step 1a has that the ODE system governing the LNA is initialised and integrated for each particle n (k) t .This 'restarting' approach avoids potential mismatch between the deterministic process η t and the latent stochastic process n t (see e.g.Fearnhead et al., 2014;Minas and Rand, 2017, for further discussion).Upon iterating Algorithm 1 over t, the product (over observation times) of the average unnormalised weight gives an unbiased estimator of π(y|θ) (Del Moral, 2004) and is key to the construction of a pseudo-marginal scheme that we now describe.
Pseudo-marginal Metropolis-Hastings methods (PMMH, Andrieu et al., 2009;Andrieu and Roberts, 2009) are a class of Metropolis-Hastings (MH) scheme that target the joint density for which it is easily checked that marginalising over U gives the marginal parameter posterior π(θ|y).Hence, an MH scheme with proposal density q(θ * |θ)g(u * ) and acceptance probability targets the joint density π(u, θ) for with retaining draws of θ gives (dependent) samples from the marginal parameter posterior.
The efficiency of the PMMH scheme can be improved by proposing the auxiliary variable from a g-reversible kernel f (u * |u) that induces positive correlation between u and u * , and in turn, πu (y|θ) and πu * (y|θ * ), so that the variance of the acceptance probability is reduced.Suppose that g(u) = N u; 0 , I dim(u) and note that where necessary, the inverse CDF method can be used to transform the auxiliary variable to be Gaussian (for example, in step 3 of Algorithm 1) where a uniform draw is required for which the tuning parameter ρ controls correlation between u and u * .The resulting correlated PMMH scheme (CPMMH, Dahlin et al., 2015;Deligiannidis et al., 2018) is an MH scheme targeting π(u, θ) with proposal density q(θ * |θ)f (u * |u) and acceptance probability as above.CPMMH can result in significant gains in computational efficiency over PMMH (see e.g.Golightly et al., 2019, in the context of stochastic kinetic models), provided that the positive correlation between u and u * induces positive correlation between successive likelihood estimates.To alleviate the issue of resampling in the particle filter potentially eroding this correlation, we follow Choppala et al. (2016) by sorting particles (according to Euclidean distance from the particle with the smallest first component) before propagation.
Finally we note that when interest lies in the posterior for the latent incidence process, samples can be obtained via modification of the (C)PMMH scheme (Andrieu et al., 2010) by drawing a particle path at each iteration of the algorithm.Note that this requires storing the ancestral lineages of the particles in each run of the particle filter.

Analytic method via Gaussian approximation
The LNA, when combined with the linear Gaussian observation model ( 12), permits analytic calculation of the observed data likelihood π(y|θ) and the conditional posterior π(n|θ, y).Evaluation of the former can be efficiently achieved via a forward filter and draws from the latter via backward sampling.We apply these methods to the Binomial and Negative Binomial observation models in ( 13) and ( 14) through suitable Gaussian approximations thereof.For reasons of brevity, we focus on the Binomial case but note that our approach is easily extended to the Negative Binomial case.
Where appropriate, we suppress the parameter vector θ from the notation for simplicity.
To make clear the two appoximations to be used in the filtering recursions, consider the LNA written in state-space format over a time interval (t, t + 1], using a Gaussian approximation to the Binomial observation model.We have that where η t+1 , G t+1 and V t+1 are obtained by integrating (4), ( 8) and ( 9) over (t, t + 1] with initial conditions of η t (itself integrated from time 0), I 2 and 0 2 .Although ( 19) is linear in n t , as noted in Section 3.3.1,η t should be initialised at n t .'Restarting' the LNA in this way can avoid issues arising from the ODE solution becoming poor over long time intervals (Fearnhead et al., 2014;Minas and Rand, 2017).However, we now have that both ( 19) and ( 20) involve nonlinear expressions of the latent process.Therefore, to permit the use of standard Kalman-filtering recursions we make further linear approximations.Suppose that the filtering distribution at time Firstly, we set η t = a t , V t = C t and integrate (4) and ( 9) over (t, t + 1] to obtain η t+1 and V t+1 .Finally, we replace ∆n t+1 in the variance of (20) with ∆ n t+1 := E(∆N t+1 ) = η t+1 − a t .Note that explicit conditioning of the expectation on y 1:t has been supressed for simplicity.The resulting linear and Gaussian state-space model is In the remainder of this section, we derive the filtering recursions based on ( 21) and ( 22) to compute the observed data likelihood and conditional posterior of the latent process.

Algorithm 2
Step t + 1 of the LNA Forward Filter Input: Parameter θ; a t and C t , the initial conditions of ( 4) and ( 9); π(y 1:t |θ), the current observed data likelihood; y t+1 , the next observation.
We construct the observed data likelihood contribution π(y t+1 |y 1:t , θ) as follows.Conditional on y 1:t , we have that where σ 2 = λ(1−λ)P ′ ∆ n t+1 is the observation variance in (22).To update the filtering distribution, we construct the joint density of N t+1 and Y t+1 conditional on Y 1:t = y 1:t as and variance Calculation of ( 23), ( 24) and ( 25) constitutes a single step of the forward filter; see Algorithm 2, which can be iterated over t to give an evaluation of the observed data likelihood (under the LNA), π(y|θ).Hence, draws from the marginal parameter posterior π(θ|y), with the LNA as the inferential model, are obtained in a straightforward manner via Metropolis-Hastings e.g.random walk Metropolis (RWM).
It remains that we can use the LNA to generate draws from π(n|θ, y).Note the factorisation where each constituent term is a Gaussian density.Under the LNA, the joint density of N t and N t+1 conditional on Y 1:t = y 1:t is Conditioning on N t+1 = n t+1 gives N t | (N t+1 = n t+1 , Y 1:t = y 1:t , θ) ∼ N(ã t , Ct ) with mean and variance Hence, the components of the cumulative incidence n can be drawn via backward sampling for t = T, T − 1, . . ., 1, given storage of the LNA ODE output and filtering mean/variance from the forward filter.Then, the latent process x can be constructed deterministically from n and the initial values x 0 using (1).

Applications
We consider two applications of the methodology described in Section 3. Firstly, using synthetic data generated from the SIR model, we compare the performance of the two marginalisation techniques described in Sections 3.3.1 and 3.3.2;these are the correlated pseudo-marginal Metropolis-Hastings (CPMMH) and forward filtering Metropolis-Hastings (henceforth FFMH) based inference schemes.We compare the accuracy of posterior output from these schemes with inferences obtained by assuming the most natural Markov jump process as the inferential model.We fit this model using the pseudo-marginal Metroplis-Hastings (PMMH) scheme described in Golightly and Wilkinson (2011).Additionally, we include inferences based on a deterministic ODE model of latent incidence (fit via MH).In the second application, we use FFMH to fit SIR and SIRS models wth two different choices of observation model, to a real data set consisting of pest removals from trees in a London park.
All algorithms are coded in R and were run on a desktop computer with an Intel quad-core CPU.Source code is available at https://github.com/AndyGolightly/LNA-Incidence.All schemes use random walk proposals with Gaussian innovations for the log-transformed parameters.For CPMMH, we fixed ρ = 0.99, which we found to give a good balance between mixing over the auxiliary variable and parameter chains.We chose the number of particles N by following the practical advice of Deligiannidis et al. (2018).That is, we choose N so that the variance of log πu * (y|θ * ) − log πu (y|θ) ≈ 1.For CPMMH and FFMH, we took the random walk innovation variance to be Var(log θ|y) estimated from a pilot run, and subsequently scaled to meet a desired empirical acceptance rate (see e.g.Schmon et al. (2021) for (C)PMMH and Schmon and Gagnon (2022) for Metropolis-Hastings). CPMMH was run for 50, 000 iterations and the remaining schemes were run for 10, 000 iterations, which we found gave reasonable mixing efficiency as measured by, for example, effective sample size (see e.g.Plummer et al., 2006).

Simulation study
We generated three synthetic data sets (denoted D i , i = 1, 2, 3) from the SIR model, each consisting of the number of new infections in time intervals (t, t + 10] for t = 10, 20, . . ., 70.For D 1 , we used x 0 = (119, 1) ′ and (β, γ) ′ = (0.00091, 0.082) ′ ; these choices are consistent with inferences from the well studied Abakaliki small pox data (see e.g.Bailey, 1975).For D 2 , we constructed a larger outbreak by scaling the total population size N pop and removal rate by a factor of 3, resulting in x 0 = (359, 1) ′ and (β, γ) ′ = (0.00091, 0.246) ′ .For D 3 , we scaled N pop by a factor of 10 (compared to D 1 ) and set x 0 = (1180, 20) ′ .We scaled both the infection and removal rates to give (β, γ) ′ = (0.00018, 0.164) ′ .Note that all data sets have the same basic reproduction number, R 0 = N pop β/γ = 1.33.We corrupted the resulting incidences via the Binomial observation model ( 13) with λ = 0.8 in each case.The data sets are shown in Figure 2 alongside the underlying traces of S t and I t (assumed unobserved).When analysing D 1 , we adopted an independent prior specification with Gamma and Uniform components by taking β ∼ Gamma(10, 10 4 ), γ ∼ Gamma(10, 10 2 ) and λ ∼ Unif(0, 1).The first two choices have been used by Fearnhead and Meligkotsidou (2004) and many others when analysing the Abakaliki small pox data.For D 2 and D 3 we adopted a more diffuse prior for the removal rate to better reflect the increase in the ground truth value; specifically, γ ∼ Gamma(10, 30), with the prior specification for the remaining components as for D 1 .We assume that the initial state x 0 is fixed and known but note that inference for x 0 is possible by augmenting θ to include the components of x 0 .rates, although there is little difference between this approach compared to the MJP when considering the basic reproduction number R 0 .However, differences are more pronounced when further approximating the observation model as Gaussian (LNA / FFMH), which results in under estimation of R 0 .Nevertheless, these differences are relatively small, and the advantages (in terms of overall efficiency) of analytically integrating out the latent process (as per LNA / FFMH) are clear.
We measure overall efficiency using minimum (over each parameter chain) effective sample size (ESS) per second (mESS/s).Given the small population size for D 1 , using the MJP inside a PMMH scheme is computationally more efficient than using the LNA (which, as implemented, requires numerical integration of 5 coupled ODEs per particle per iteration).Correlating successive likelihood estimates (LNA / CPMMH vs PMMH) increases overall efficiency by a factor of 2, however, the largest gains in overall efficiency are obtained by LNA / FFMH, which improves on MJP / PMMH by a factor of 4 and on LNA / CPMMH by a factor of almost 50.
For data set D 2 (population size N pop = 360), the pseudo-marginal schemes require more particles, due to the intrinsic stochasticity of realisations of the latent process generated inside the particle filter, which is large compared to observation noise.The increased population size (and corresponding parameter values that generated the data) leads to many more reaction occurrences between observation instants (compared to D 1 ) reducing the relative efficiency of MJP / PMMH versus LNA / (C)PMMH and LNA / FFMH.We note that for this data set, using the LNA to model the latent process and additionally taking a linear Gaussian approximation of the observation model leads to an inference scheme that is both efficient (with an mESS/s 40 times larger than that of the next best perfoming scheme) and accurate (see Figure 3, bottom panel).The magnitude of of typical observations in data set D 3 (population size N pop = 1200) is broadly consistent with that of D 2 and we find that the pseudo-marginal schemes require similar particle numbers.Using the LNA with the correct observation model gives parameter inferences that are consistent with the MJP.Using LNA / FFMH appears to result in underestimates of the infection and removal rates although the basic reproduction number appears to be accurately estimated.In terms of overall efficiency, the advantage of LNA / FFMH over competing schemes is clear, with an mESS/s that is approximately 80 times larger than MJP / PMMH.There is relatively little difference between the performance of LNA / CPMMH and MJP / PMMH.
Table 1 also includes summarised posterior output when using a deterministic ODE model of latent incidence, combined with a Guassian approximation to the Binomial observation model (ODE / MH).This approach requires only the solution of the ODE system in (4), as opposed to (4), ( 8) and (9) when using the LNA.Consequently, an approximate 4-fold increase in overall efficiency is achieved for ODE / MH compared to LNA / FFMH.However, ignoring intrinsic stochasticity leads to a clear loss of inferential accuracy.In particular, the reporting rate is underestimated (which is unsurprising, as this leads to a larger observation variance, which can somewhat offset the inability of the latent ODE model to capture intrinsic stochasticity) and the basic reproduction number is typically overestimated.As N pop increases, posterior uncertainty for all static parameters is underestimated (relative to the gold standard MJP approach) irrespective of each data set.
Figure 4 shows within-sample predictive summaries (averaged over parameter uncertainty) for the susceptible and infective states under the LNA.That is, for each of n iters parameter draws from the marginal posterior under the LNA, backward sampling (see Section 3.3.2) was run to obtain samples (S t ) ′ from the conditional posterior π(x t |θ (k) , D) for t = 10, 20, . . ., 80 and k = 1, 2, . . ., n iters .We see that although the LNA (unsurprisingly) fails to capture the discrete nature of the infective process (most evident for data set D 1 ), within-sample predictive draws are generally consistent with the ground truth traces generated by the jump process, although there is some suggestion for data sets D 1 and D 3 that the LNA is least accurate at the end of the epidemic.

Oak processionary moth in Richmond park, London
In this section we consider the application of the methodology to the infestation of the oak processionary moth (OPM), Thaumetopoea processionea, in Richmond Park, London.OPM is an invasive pest, destructive to oak trees and toxic to humans and animals (Maier et al., 2003(Maier et al., , 2004;;Gottschling and Meyer, 2006;Rahlenbeck and Utikal, 2015).The moth was first established in the UK in 2006 and despite efforts to initially eradicate, and then contain the infestation, OPM has continued to spread (Suprunenko et al., 2021;Wadkin et al., 2022).
Surveys and control strategies for Richmond Park are carried out by The Royal Parks charity, and this data is then shared with the governmental Oak Processionary Moth Control Programme (Mainprize and Straw, 2021).The data records the numbers of OPM nests removed from trees (with recorded locations) between the years 2013 and 2020, allowing the formation of a time series for the yearly removal incidence of infested trees; see Table 2.The removal prevalence of the same set of trees (constructed under the assumption of known initial conditions) was considered in an SIR model in Wadkin et al. (2022).However, upon the manual removal of the OPM nests, it is possible for the trees to become susceptible to re-infestation, and thus we additionally consider the SIRS model below.

Model and prior distribution
To allow for removed trees re-entering the susceptible class, we consider the SIRS compartment model shown graphically in Figure 5. Transitions between compartments can be described by the set of pseudo-reactions given by where β t is a time varying infection rate whose natural logarithm is described by the SDE That is, the log infection rate is a scaled Brownian motion process.We note that setting κ = 0 gives the SIR model and in what follows fit both SIR and SIRS models under the assumption the latent incidence process is well described by the linear noise approximation.Further details of the LNA for the SIRS compartment model are given in Appendix A. We additionally consider two observation models; these are the Binomial and Negative Binomial models given by ( 13) and ( 14).This leads to 4 competing models which we compare using the deviance information criterion (DIC, see e.g.Gibson et al., 2018, for a discussion of DIC in the epidemic context) given by where p D = −2E θ {log π(y|θ)|y} + 2 log π(y| θ) measures the effective number of parameters in the model.Note that the observed data likelihood π(y|θ) is tractable under the Gaussian approximation approach to inference described in Section 3.3.2,which we employ here.Hence, DIC is easily calculated and the model with the smallest DIC is preferred.
We adopt an independent prior specification by taking log γ ∼ N(0, 0.5 2 ), log κ ∼ N(0, 1), log σ β ∼ N(1, 1), λ ∼ Unif(0, 1) and, when using a Negative Binomial observation model, log φ ∼ N(0, 1).Note that the choice of β 0 and prior for the removal rate γ induces a prior on the basic reproduction number R 0 = N pop β 0 /γ at time 0 as lognormal logN(0.6,0.5 2 ).This gives a 95% equitailed credible interval of (0.7, 4.8) for R 0 , which reflects our belief that OPM spread is likely to persist, without precluding R 0 < 1.We note also that the prior for κ gives a 95% credible interval of (0.14, 7.10) years, reflecting vague prior beliefs on the time taken for a removed tree to re-enter the susceptible class.

Results
We ran the marginal Metropolis-Hastings scheme (as described in Section 3.3.2) for 50, 000 iterations, with the resulting parameter chains suggesting adequate mixing.Tables 3-4 and Figures 6-8 summarise the posterior output under each competing model.
Table 3 shows estimated DIC for the SIR and SIRS models, under the assumption of either a Binomial or Negative Binomial observation model.A Binomial observation model is preferred irrespective of the assumed underlying compartment model.This is consistent with the inferred values of the (inverse) dispersion parameter φ, which are typically small; see Table 4. Hence, it appears that the true but unobserved removal incidence is much larger than the observed incidence, which is unsurprising given surveyed areas of Richmond park in each year, which typically consitute a small fraction of the total area.Although our findings support the hypothesis that trees can become susceptible to re-infestation over the time scales of the data set considered, we note that the analysis has not been particularly informative for the parameter κ, governing the rate of R to S transitions; see Figure 6 showing marginal posterior densities for parameters in the SIRS model and the prior specification.Since removed trees are treated with insecticide, this parameter is likely to be of interest to practitioners.Nevertheless, improved data collection protocols and a longer  study period may provide a partial record of the number of R to I transitions, which would greatly improve inferences on κ.
Figure 7 summarises the within-sample predictive distributions for the susceptible and infective prevalence processes (which are easily reconstructed from the predicted incidences, not shown) and the log infection process, log β t .These results are broadly consistent with those of Wadkin et al. (2022), which suggest a plausibly constant infection rate and an uptick in infected trees from 2018. Figure 8 summarises the marginal posterior distribution of the basic reproduction number R 0 against year.Sampled values of R 0 appear to be largely consistent across years, however, the marginal posterior distributions in years 2018, 2019 and 2020 have greatest support for R 0 > 1 suggesting that OPM will continue to propagate in Richmond park.

Discussion
The construction of efficient and widely applicable approaches to inference for stochastic epidemic models remains a key challenge (Swallow et al., 2022).In this paper, we have proposed a fast an efficient method for inferring the parameters governing the linear noise approximation (LNA) of a stochastic epidemic model, using incidence data consisting of the cumulative number of new infections (or removals) in fixed-length windows.This setting is considered in Fintzi et al. (2021) who combine the LNA of the incidence process with a Negative Binomial observation model and develop an efficient MCMC scheme targeting the joint density of the parameters and latent incidence process.Our contribution, on the other hand, is a framework for marginalising out the latent incidence process: either by exactly targeting the marginal parameter posterior via a (correlated) pseudomarginal method, or analytically through a Gaussian approximation of the observation process.We additionally allow for a flexible, time-varying stochastic infection rate, which is naturally handled within the LNA framework.Our experiments demonstrated that use of the LNA and a further Gaussian approximation of an observation model can be both accurate and efficient.Using parameter values inspired by the Abakaliki smallpox outbreak, we investigated the accuracy and efficiency of the analytically marginalised LNA as the population size increases (and with the parameters scaled appropriately).In the 'large epidemic' setting (N pop = 1200), the analytic marginalisation scheme outperforming the next best performing scheme by about a factor of 80.In this scenario, use of the most natural Markov jump process representation of the epidemic is computationally prohibitive.We further illustrated our approach via an application with real data consisting of numbers of trees infested with oak processionary moth (OPM) nests in Richmond Park, London.Typical observations consist of around 500-1500 removals in a given year, with a total population size of around 40, 000 trees, thus necessitating the efficient inference methods developed here.As well as inferring key quantities of interest, such as the basic reproduction number and latent susceptible and infective trajectories, our approach allows for easy computation of the observed data likelihood which can be used, for example, to compute a deviance information criterion (DIC).We used DIC to compare two different compartment models (SIR versus SIRS) and two different observation models (Binomial versus Negative Binomial).Out analysis suggests the SIRS model as the best fitting compartmentment model, suggesting that trees can re-enter the susceptible class following removal (via treatment).Although improved data collection protocols which include observation of the number of removed trees which susbequently become infected will greatly improve predictive power, our approach demonstrates that meaningful conclusions on the spread of OPM can be drawn, despite a data poor scenario.

Limitations and extensions
Within the stochastic kinetic models context, the LNA can be derived directly from the most natural Markov jump process (MJP) representation (Kurtz, 1970(Kurtz, , 1972) ) but is perhaps most intuitively viewed as a tractable Gaussian process approximation of the Itô Stochastic differential equation (SDE) that best matches the MJP representation (Ferm et al., 2008;Fearnhead et al., 2014).As advocated by Fuchs (2013) among others, judging the validity of these continuous-valued approximations should involve comparison with the MJP (e.g. via simulations) for the specific system considered.Nevertheless, we expect, in general, that the best matching SDE and LNA approaches are likely to approximate the MJP particularly poorly when specie numbers are comparatively small (e.g. in the few tens).In such situations, we envisage that our approach is likely to be of most practical benefit in providing initial values and tuning choices for simulation-based inference schemes that target the posterior under the MJP.For inherently multi-scale epidemics, it may be possible to leverage hybrid simulation techniques (see e.g.Sherlock et al., 2014) whereby the LNA is used to model species which frequently change state, coupled with a discrete stochastic updating procedure for species which change state less often.
This work can be further extended in a number of ways.Of particular interest to us is the use of the proposed approach within a spatio-temporal setting, and with application to OPM spread, for example, by allowing importation of pests from nearby locations.Extension of the methodology to allow incorporation of multiple data streams (see e.g.Corbella et al., 2022) also merits further attention.

Figure 4 :
Figure 4: LNA within-sample predictive distributions (mean and 95% credible intervals) for S t (left) and I t (right) based on synthetic data sets D 1 (top panel), D 2 (middle panel) D 3 (bottom panel).Ground truth latent process trajectories are shown as dashed lines.

Figure 6 :Figure 7 :
Figure 6: OPM data application.Marginal posterior densities (histograms) and prior (solid line), of the parameters in the SIRS model assuming binomial observations.

Figure 8 :
Figure 8: OPM data application.Boxplots summarising the marginal posterior distribution of the basic reproduction number R 0 against year.

Table 1 and
summarise the posterior output from each scheme.For data set D 1 (population size N pop = 120), although all inferential models give posterior output that is consistent with the ground truth parameter values, there are noticeable inconsistencies between LNA-and MJP-based inferences.Using the LNA to model the latent incidence process but with the correct observation model (LNA / (C)PMMH) results in an overestimation of the infection and removal

Table 1 :
Synthetic data application.Inferential model / scheme, correlation parameter, number of particles, minimum effective sample size per second and marginal parameter posterior summaries.The ground truth parameter values are indicated for each data set.

Table 2 :
OPM data.Number of "removed trees" in a given year, Richmond park, London, 2013-2020.

Table 3 :
OPM data application.Estimated DIC for the SIR and SIRS models, assuming either a Binomial (Bin) or Negative Binomial (Neg Bin) observation model.

Table 4 :
OPM data application.Marginal parameter posterior summaries.