{'fraction_non_alphanumeric': 0.0336982281909491, 'fraction_numerical': 0.01348606252116014, 'mean_word_length': 4.745752820645831, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A linear noise approximation for stochastic epidemic models fit to partially observed incidence counts

Stochastic epidemic models (SEMs) fit to incidence data are critical to elucidating outbreak dynamics, shaping response strategies, and preparing for future epidemics. SEMs typically represent counts of individuals in discrete infection states using Markov jump processes (MJPs), but are computationally challenging as imperfect surveillance, lack of subject-level information, and temporal coarseness of the data obscure the true epidemic. Analytic integration over the latent epidemic process is impossible, and integration via Markov chain Monte Carlo (MCMC) is cumbersome due to the dimensionality and discreteness of the latent state space. Simulation-based computational approaches can address the intractability of the MJP likelihood, but are numerically fragile and prohibitively expensive for complex models. A linear noise approximation (LNA) that approximates the MJP transition density with a Gaussian density has been explored for analyzing prevalence data in large-population settings, but requires modification for analyzing incidence counts without assuming that the data are normally distributed. We demonstrate how to reparameterize SEMs to appropriately analyze incidence data, and fold the LNA into a data augmentation MCMC framework that outperforms deterministic methods, statistically, and simulation-based methods, computationally. Our framework is computationally robust when the model dynamics are complex and applies to a broad class of SEMs. We evaluate our method in simulations that reflect Ebola, influenza, and SARS-CoV-2 dynamics, and apply our method to national surveillance counts from the 2013--2015 West Africa Ebola outbreak.


Introduction
Incidence count data reported by public health surveillance systems help us to understand outbreak transmission dynamics, quantify uncertainty about the trajectory of an outbreak, and design interventions to interrupt transmission. Incidence counts reflect the number of new cases accumulated in each inter-observation interval, and are distinct from prevalence counts, which record the number of infected individuals at each observation time. Imperfect surveillance and asymptomatic cases result in systematic under-reporting and make it difficult to disentangle whether the data arose from a severe outbreak, observed with low fidelity, or a mild outbreak where most cases were detected. The absence of subject-level data and the temporal coarseness of observations further reduce the amount of available information. Outbreak data are commonly modeled using mechanistic compartmental models in which individuals transition between discrete infection states (Allen, 2017). The parameters that govern the epidemic dynamics are of interest because they are informative about the mechanistic aspects of disease transmission. For example, the basic and effective reproduction numbers, R 0 and R ef f , are measures of the expected number of secondary cases per index case. These quantities, respectively, inform us about the likelihood that an outbreak will take off and persist, and provide insights into how interventions might short circuit transmission since they depend on population susceptibility, infectiousness, and contact rates.
Stochastic epidemic models (SEMs) commonly represent the epidemic as a densitydependent Markov jump process (MJP) that evolves on a discrete state space of compartment counts with times between elementary transition events, such as infections and recoveries, taken to be exponentially distributed (Allen, 2017). The challenge in fitting a SEM to partially observed incidence is that we must sum over all epidemic paths from which the data could have arisen. This is difficult since the set of possible paths is enormous, even in small populations. Hence, the observed data likelihood of a SEM is usually intractable.
Computation and inference for SEMs in the presence of under-reporting typically relies on either simulation-based methods or data augmentation (DA), often in combination with an approximation of the target MJP (O'Neill, 2010). Simulation-based methods generate realizations of the epidemic process that form the basis for inference. This class of methods has been referred as "plug-and-play" since inference requires only the ability to simulate epidemic paths (Bretó et al., 2009). The particle marginal Metropolis-Hastings (PMMH) algorithm of (Andrieu et al., 2010) stands out as a state-of-the-art method for Bayesian inference with a fast and robust implementation for fitting epidemic models as part of the pomp R package (King et al., 2016a). Despite their flexibility, simulation-based methods can be prohibitively expensive for models with complex dynamics and may fail entirely in the absence of an adequate model from which to simulate epidemic paths (Dukic et al., 2012).
Data augmentation facilitates Bayesian inference by targeting the joint posterior distribution of the latent epidemic process and SEM parameters. Modern DA algorithms can be more computationally robust than simulation-based methods, especially in the absence of subject-level data or when the SEM dynamics are complex (Pooley et al., 2015, Fintzi et al., 2017, Nguyen-Van-Yen et al., 2020. However, repeatedly evaluating the MJP likelihood, which is a product of exponential waiting time densities, at each iteration of a Markov chain Monte Carlo (MCMC) algorithm is prohibitively expensive in large populations. Hence, it is advantageous to approximate the MJP with a process whose likelihood is more tractable.
Markov jump processes are commonly approximated with ordinary and stochastic differential equations (ODEs, SDEs) (Allen (2017); Web Appendix A). Deterministic ODE models, which are derived as the infinite-population functional limits of density dependent MJPs, are attractive for their computational tractability. These models also lend themselves to analytic characterizations of the outbreak, e.g., we can relate the final outbreak size to the basic reproductive number (Miller, 2012). However, deterministic models are known to underestimate uncertainty about the epidemic process (King et al., 2015) and cannot address questions that are inherently stochastic, e.g., distributional questions about the size or duration of an outbreak. Although SDEs reasonably approximate the stochastic aspects of the MJP in large population settings, SDE transition densities are typically unavailable in closed form. Therefore, computation for SDE models relies on simulation based methods or simplification of the SEM.
We develop a computational framework for fitting SEMs to partially observed incidence based on a linear noise approximation (LNA) of MJP transition densities. The LNA approximates the MJP transition density with a Gaussian density whose moments are obtained by numerically solving systems of ODEs. Reviews of the LNA and other MJP approximations can be found in Wilkinson (2011) and Schnoerr et al. (2017). The LNA has been applied in the analysis of gene regulatory networks (Komorowski et al., 2009, Finkenstädt and and in outbreak modeling (Ross et al., 2009, Ross, 2012, Fearnhead et al., 2014. The LNA has not been used to analyze incidence data. Rather, its application to outbreak modeling has been limited to prevalence or cumulative incidence data under an assumption of Gaussian disease counts (Zimmer et al., 2017), or has relied on simulation-based methods to allow for non-Gaussian surveillance models (Golightly et al., 2015).
Our contributions in this work are threefold. First, we demonstrate how SEMs should be parameterized, in general, to appropriately analyze incidence data. In doing so, we aim to correct an unfortunately common error in transmission modeling where incidence counts are wrongly conflated with prevalence data. Second, we demonstrate how the LNA can be folded into a computationally robust Bayesian data augmentation framework that leverages cutting edge MCMC algorithms and can be used to fit a broad class of SEMs. Critically, these tools absolve us of the de facto requirement that the data follow a Gaussian distribution for the sake of computational efficiency, the alternative being computationally intensive particle filter methods. Finally, we provide guidance on optimal parameterizations that massively improve MCMC sampling efficiency for LNA paths and model parameters. In particular, we introduce a non-centered parameterization (NCP) for LNA transition densities that enables us to sample LNA paths via elliptical slice sampling (Murray et al., 2010), which is a simple, computationally robust, and efficient MCMC algorithm free of tuning parameters. Our framework enables us to fit models with complex dynamics that would otherwise be impossible to fit without compromising the model, even with cutting edge computational tools such as particle MCMC.

Surveillance Model and Data
Incidence data, Y = {Y 1 , . . . , Y L }, are reported counts of new infections in time intervals, I = {I 1 , . . . , I L : I = (t −1 , t ]}. The observed incidence may reflect a fraction of the true incidence due to imperfect surveillance or asymptomatic cases. Or, cases may be overreported if non-specific symptoms lead to over-diagnosis. Let N c = (N c SI , N c IR ) denote the counting process for the cumulative numbers of infections (S → I transitions) and recoveries (I → R transitions), and let ∆N c (t ) = N c (t ) − N c (t −1 ) denote the change in cumulative transitions over I ; so, ∆N c SI (t ) is true unobserved incidence over (t −1 , t ]. Heterogeneities in case detection rates could lead to over-dispersion in the reporting distribution. Hence, we model the number of observed cases as a negative binomial sample of the true incidence with mean case detection rate ρ and over-dispersion parameter φ: Y |∆N c SI (t ), ρ, φ ∼ Neg.Binom.(µ = ρ∆N c SI (t ), σ 2 = µ + µ 2 /φ). (1)

Latent Epidemic Process
The SIR model describes the evolution of compartment counts, X c = {S c , I c , R c }, in continuous time on the state space S c X = {(l, m, n) : l, m, n ∈ {0, . . . , P }, l + m + n = P } , where P is the population size. We take the waiting times between state transitions to be exponentially distributed, which implies that X c evolves according a MJP. Now, if our data had consisted of prevalence counts, we could approximate the MJP transition densities of X c as in (Ross et al., 2009, Fearnhead et al., 2014. However, incidence data reflect the new infections in each inter-observation interval as the surveillance model (1) depends on the change in N c SI , not I, over (t −1 , t ]. Hence, it is here that we first diverge from the approaches previously taken in the LNA literature. It would be incorrect to treat incidence as though it were a change in prevalence. For instance, there could be a positive number of infections but prevalence might not change due to an equal number of recoveries over the inter-observation interval. To correctly specify the likelihood for incidence data, we must construct the LNA that approximates transition densities of N c .

Cumulative Incidence of Infections and Recoveries
The cumulative incidence of infections and recoveries, N c , is a MJP with state space S c N = {(j, k) : j, k ∈ {0, . . . , P }, X(N c (j, k)) ∈ S X } , which is the set of cumulative infections and recoveries that do not lead to invalid prevalence paths (e.g., if there more recoveries than infections). Let β denote the per-contact infection rate, and µ the recovery rate. The infinitesimal transition probability from state n to n is Pr n,n (∆t; X c ) =        βSI∆t + o(∆t), n = (n SI , n IR ), (n SI + 1, n IR ), µI∆t + o(∆t), n = (n SI , n IR ), n = (n SI , n IR + 1), 1 − (βSI + µI)∆t + o(∆t), n = n , o(∆t), otherwise, and we define the transition intensity from n to n as λ n,n (X c ) = lim ∆t→0 Pr n,n (∆t; X c ). We seek to infer the posterior distribution of N c and θ = {R 0 , 1/µ, ρ, φ, X 0 }, where R 0 = βP/µ is the basic reproduction number and 1/µ is mean infectious period duration. The basic reproduction number takes the same form for the SEIR model, which also adds a mean latent period with duration 1/γ, where γ is the rate at which an individual transitions from E to I. By the Markov property and standard hidden Markov model conditional independence assumptions, the complete data likelihood is a product of surveillance densities and transition densities, where π(θ) is the prior distribution of θ and N(t 0 ) = 0. The challenge in sampling from this posterior is that the transition densities of N c are intractable due to the dimensionality of its state space. Moreover, we cannot analytically integrate over the latent epidemic process, except in trivial cases that are of little practical interest. In the following subsections, we use the LNA to approximate transition densities of N c , turning (3) into a more tractable product of Gaussian transition densities and arbitrary surveillance densities. This will facilitate the use of efficient algorithms for sampling from the approximate posterior.

Diffusion Approximation
We approximate the integer-valued MJPs, X c and N c , with the real-valued diffusion processes, X and N, that satisfy an SDE, referred to as the chemical Langevin equation (CLE), whose drift and diffusion terms are chosen to match the approximate moments of MJP path increments in infinitesimal time intervals (Wilkinson, 2011, Golightly andGillespie, 2013). Additional details regarding the diffusion approximation are given in Web Appendix A, and we refer to Gillespie (2000) and Fuchs (2013) for comprehensive discussions. The state spaces of X and N for the SIR model respectively are In words, S R X is the real-valued set of non-negative compartment volumes that sum to the population size, and S R N is the real-valued set of non-decreasing and non-negative incidence paths, constrained to yield valid prevalence paths. Let λ(X(t)) be the vector of transition rates at time t, e.g., λ(X(t)) = (βS(t)I(t), µI(t)), and Λ(X(t)) = diag(λ(t)). For now, we ignore the constraints on S R N and S R X , and approximate changes in cumulative incidence of infections and recoveries in an infinitesimal time step with the CLE, where the vector W t is distributed as a bivariate Brownian motion with independent components and Λ(X(t)) 1/2 is any matrix square root of the diffusion matrix.
Following Ionides (2011) andHo et al. (2018), we reparameterize X(t) in terms of N(t), with initial conditions X(t 0 ) = x 0 and N(t 0 ) = 0. Let A denote the stoichiometric matrix whose rows specify changes in the compartment counts per elementary transition event, e.g., per infection or recovery: Now, X is coupled to N via For the SIR model, so we rewrite (4) as Changes in compartment volumes affect transition rates, and hence increments in incident events, multiplicatively. Therefore, perturbations about the drift in (8) should be symmetric on a multiplicative, not an additive scale. This leads us to log transform of (8). Let N = log(N + 1), so N = exp( N) − 1. By Itô's lemma (Øksendal, 2003) where η(t) is the drift vector and Φ(t) is the diffusion matrix of the SDE.

Linear Noise Approximation
The LNA is a multivariate normal (MVN) approximation for the transition density of N over the interval (t −1 , t ] and is given by where µ(·), m(·), and Σ(·) are solutions to the coupled, non-autonomous system of ODEs, 6 subject to initial conditions N(t −1 ) = 0, X(t −1 ) = x(t −1 ), m(t −1 ) = 0, and Σ(t −1 ) = 0, and where η(t) and Φ(t) are given in (9) and F(t) = ∂η i (µ(t)) ∂µ j (t) i,j∈1,...,| N| is the Jacobian of η(t). The solutions to 11)-(13) can be viewed as a mean vector that solves a nonlinear system of ODEs, an autoregressive term, and the covariance for a Gaussian approximation to the transition density of N. In practice, we need not solve (12) since m(t −1 ) = 0 implies the right hand side of (12) always equals zero. The LNA is derived by writing N as the sum of its deterministic ODE limit, which is the solution to (11), and a stochastic residual. These terms are substituted into (9), which is then Taylor expanded around its deterministic limit, with higher order terms discarded, to obtain a linear SDE for the stochastic residual term. The solution of this linear SDE is a Gaussian random variable with transition density (10). We refer readers to Golightly and Gillespie (2013) and Wallace (2010) for derivations of the LNA. The LNA reasonably approximates the stochastic aspects of a density dependent MJP over time intervals where the CLE approximation, (9), is valid (see Web Appendix A and Wallace et al. (2012)). Over long time periods, the LNA may diverge from the MJP as stochastic perturbations to the system accumulate. The approximation can be improved by phase-correcting the LNA via a time-transformation (Minas and Rand, 2017), or by restarting the LNA at the start of each inter-observation interval and approximating the one-step conditional MJP transition densities (Fearnhead et al., 2014). We have adopted the latter strategy for its simplicity. Under the restarting formulation of LNA, the initial conditions in (11)-(13) are reset at the start of each inter-observation interval.
The LNA posterior factorizes as a Gaussian state space model, We exponentiate LNA sample paths when computing the surveillance densities in (14) since these densities depend on incidence, not log-incidence. We also explicitly include indicators for whether an LNA path respects the positivity and monotonicity constraints of the original MJP. We do this for two reasons: first, to more faithfully approximate the MJP, and second, to avoid numerical instabilities that arise when N or X are negative.

Inference via the Linear Noise Approximation
We sample LNA paths using the elliptical slice sampling (ElliptSS) algorithm of Murray et al. (2010), which is an efficient and computationally robust MCMC algorithm free of tuning parameters. ElliptSS can be used to sample a latent variable of interest, Z, when the posterior decomposes into a Gaussian prior for Z and an arbitrary likelihood, L(Y|Z, θ), i.e., π(θ, Z|Y) ∝ L(Y|Z, θ)M V N (Z; µ Z , Σ Z ).
ElliptSS cannot naïvely be used to sample LNA paths if we restart the LNA ODEs at the start of each inter-observation interval since the mean of N(t ) depends non-linearly on the value of N(t −1 ). Therefore, paths of N are not jointly Gaussian. To facilitate the use of ElliptSS, we introduce a non-centered parameterization (NCP) that maps standard normal random variables onto LNA paths (see Algorithm 1 for pseudo-code). Let Z(t ) ∼ M V N (0, I), and N(t ) ∼ M V N (µ(t ), Σ(t )), where µ(t ) and Σ(t ) solve the LNA ODEs over (t −1 , t ]. The NCP is (θ, Z), and maps Z to Our MCMC targets the joint posterior of the parameters and non-centered LNA draws, where N(Z, θ, I) and X(Z, θ, I) denote sample paths obtained by centering the LNA draws. The NCP also helps to alleviate issues of poor MCMC mixing that arise when fitting hierarchical latent variable models using a data augmentation MCMC framework (Web Appendix B and Figure S2). In weak data settings, such as ours, MCMC samples can become severely autocorrelated when alternately sampling latent variables and model parameters (Papaspiliopoulos et al., 2003, Papaspiliopoulos et al., 2007. This can be traced to the centered parameterization (CP) for the LNA in (14). Under the CP, updates to θ | N, Y are made conditionally on a fixed LNA path and are accepted if they are concordant with the data and the current path. This dynamic limits the magnitude of perturbations that can be made to the model parameters at each MCMC iteration and results in severe autocorrelation. In contrast, the NCP locates a sample LNA path within the transition densities induced by a set of proposed model parameters, thus allowing us to make more meaningful perturbations to model parameters at each MCMC iteration.

Parameter updates
In each MCMC iteration, we alternate between sampling Z | θ, Y and θ | Z, Y. We sample θ | Z, Y using either a global adaptive random walk Metropolis (GA-RWM) sampler when fitting simple SEMs, (Algorithm 4 in Andrieu and Thoms (2008)) or an adaptive multivariate normal slice sampler (MVNSS) when the dynamics are more complex (Web Appendix B). The GA-RWM algorithm is faster per-iteration, though we have found the MVNSS algorithm to be more robust in complex settings. When X 0 , is estimated, we assign an informative prior X 0 ∼ T M V N S R X P p, P (diag(p) − pp T ) , which is a truncated multivariate normal (TMVN) approximation to a multinomial distribution on the state space of compartment volumes with initial state probabilities, p. We update X 0 via ElliptSS (Web Appendix B).

Comparison with Common MJP Approximations in Typical Settings
The fidelity of the LNA as a MJP approximation has been well established in more general settings (Grima, 2012, Wallace et al., 2012. Here, we sought to evaluate the inferential performance of the LNA in the specific use-case that is the focus of this work: transmission models fit to incidence count data in medium-to large-population settings. We explored three scenarios where the outbreak dynamics were set to resemble pathogens of particular interest: influenza, Ebola, and SARS-CoV-2. The three simulation scenarios varied in their dynamics and detection rates ( Table 1). The population sizes ranged from P = 2, 000, below which subject-level data requiring different statistical methods might reasonably be available, to P = 50, 000. As the population size increases, the outbreak dynamics tend to become increasingly deterministic (Wallace et al., 2012). For each scenario, we fit SEIR models to weekly incidence data from 1,000 outbreaks simulated from a MJP via Gillespie's direct algorithm (Gillespie, 1976). Each dataset consisted of at least twelve weeks worth of data, and we truncated each time series after four consecutive weeks of fewer than five cases.
Our priors were agnostic about surveillance model parameters and weakly informative about the transmission dynamics, though somewhat more diffuse than might be used in practice (Table S2). Additional details are provided in Web Appendix C.
We compared the LNA with the deterministic ODE representation of the latent epidemic process and with a discrete-time approximation where epidemic paths were simulated within a particle marginal Metropolis-Hastings (PMMH) framework (Andrieu et al., 2010) using a multinomial modification of the τ -leaping algorithm (MMTL) (Bretó and Ionides, 2011) and τ -leap intervals of either one hour or one day. The MMTL/PMMH approximation was chosen because of its implementation in the popular pomp R package (King et al., 2016b). Given a sufficiently fine τ -leap interval, the MMTL approximation is, arguably, a more faithful approximation to the target MJP vis-a-vis the LNA since it preserves the discreteness of the latent state space. The ODE approximation, which does not allow for stochasticity in the latent process, solves (11) with Σ(t) = 0 in (13), and has been ubiquitous in models for SARS-CoV-2 as it is easily implemented and not computationally burdensome. Models fit via the LNA recovered the model parameters in all three scenarios ( Figure 1). Coverage of Bayesian credible intervals (BCIs) was good, if somewhat conservative due to the diffuse priors and the limited extent of the data. We see decent posterior contraction, along with scaled posterior median absolute deviations and scaled BCIs that together indicate that the model parameters are reliably recovered. The MMTL approximation was sensitive to the choice of τ -leap interval. Models fit using an interval of one hour yielded comparable inferences to the LNA, albeit at much higher computational cost (Table 2). MMTL models fit using a one day τ -leap interval were comparable to the LNA in computational performance, but exhibited poor coverage for the R 0 in the influenza scenario, likely because the discretization interval was long relative to the generation interval of the outbreak. The ODE models struggled to reliably recover model parameters in all three scenarios, and exhibited low coverage for R 0 and ρ despite the lack of structural model misspecification. ODE poste-riors had higher median absolute errors and narrower BCIs compared with LNA and MMTL posteriors. This is in agreement with results of King et al. (2015), who found that ODE models underestimated uncertainty about epidemic dynamics. The ODE was faster than the LNA or MMTL/PMMH, suggesting the ODE may be useful as an exploratory tool, but not as a basis for inference.

Supporting Simulations
In addition to providing further details about the simulations in the previous section, Web Appendix C presents results from analogous simulations in which we truncated each time series at one year or after eight consecutive weeks of zero cases. The LNA performed substantially worse with so much of the data coming from the tail of the outbreak. We do not recommend the LNA as a process approximation when interest lies in stochastic extinction or emergence of outbreaks for two reasons. First, because the leap conditions that underpin the LNA are likely to be violated in these settings (Web Appendix A). Moreover, the LNA approximates MJP transition densities with a unimodal Gaussian distribution. For this reason, it is incapable of capturing the bimodal dynamics and "false starts" that are typical in the early stages of outbreaks, and lacks a point mass at zero new infections to capture epidemic extinction. Still, it may be possible to adapt our method for use in a hybrid framework that switches between the LNA and an exact MJP, as in (Rebuli et al., 2017).
In Web Appendix D, we used the LNA, ODE, and MMTL with a one-hour τ -leap interval to fit SIR models to data from outbreaks in populations of size P = 2, 000, P = 10, 000, and P = 50, 000. We simulated outbreaks conditional on parameters drawn from a set of prior distributions that reflected outbreak dynamics and detection rates that are typical of many contact driven outbreaks. We fit the models using the priors from which we drew parameters, ensuring that Bayesian inference would be properly calibrated up to the approximation error vis-a-vis the MJP used to simulate the data. Results obtained with the LNA and MMTL were comparable, and BCI coverage probabilities for all parameters were close to their nominal levels. In contrast, BCI coverage probabilities were too low in ODE models.
In Web Appendix E, we discuss how MCMC performance can be improved through reparameterizations that reflect how the parameters interact to shape the outbreak dynamics. For the simpler models considered in this paper, we recommend parameterizing the estimation scale on which a Markov chain explores the posterior in terms of the (log) basic reproduction number, (log) mean sojourn period durations, and (logit) mean case detection rate. This approach also allows us to more naturally set priors about transmission and surveillance parameters. In more complex settings, we can use deterministic ODEs to speed up the task of identifying good MCMC estimation scales. In our application to modeling the spread of Ebola in Guinea, Liberia, and Sierra Leone, we allow for the effective size of the population at risk in each country to be estimated as a parameter in the model. The implications of this choice for identifiability and MCMC parameterization are explored in Web Appendix F.
Finally, Web Appendix G presents a simulation confirming that our framework remains computationally robust when fitting the multi-country SEIR model that we apply to the West Africa Ebola outbreak. We successfully fit the model to simulated data and recover the true parameter values via the LNA. In contrast, the MMTL/PMMH algorithm failed to yield a convergent MCMC run when given a similar computational budget, despite the  Scaled median absolute deviation  R 0 is the basic reproduction number, 1/ω in the mean latent period, 1/µ is the mean infectious period, ρ is the mean case detection rate, and 1/ √ φ is (loosely) the excess dispersion of the negative binomial surveillance model on the standard deviation scale. absence of any structural model misspecification. Our inability to obtain a valid posterior sample in the "easy" setting where we knew the true data generating mechanism, even with great expenditure of time and computational resources, led us to abandon PMMH as a computational strategy for analyzing real-world data from the West Africa outbreak.

Modeling the Spread of Ebola in West Africa
We now turn our attention to modeling the 2013-2015 Ebola outbreak in Guinea, Liberia, and Sierra Leone. Our objective will be to describe the transmission dynamics of the outbreak, and in particular to estimate the basic reproductive numbers for each country. The data, shown in Figure 2, consist of national case counts from the World Health Organization patient database consisting of weekly confirmed and probable Ebola cases (World Health Organization, b). Probable cases were defined as patients with Ebola-like symptoms who were epidemiologically linked to a suspected, probable, or confirmed case, or to a sick or dead animal, or who had died and were linked to confirmed cases (World Health Organization, a).
Cases were confirmed if they tested positive for Ebola virus RNA or IgM Ebola antibodies (Coltart et al., 2017). For illustrative purposes, we aggregated confirmed and probable cases. We used the LNA and ODE approximations to fit a multi-country model with countryspecific SEIR dynamics and cross-border transmission between each of Guinea, Liberia, and Sierra Leone (Figure 3). Transmission was assumed to commence in Liberia on March 2, 2014, and in Sierra Leone on May 4, 2014, corresponding to three weeks prior to the first cases in those countries. The observed incidence was modeled as a negative binomial sample of the true incidence. The total incidence in each country was small relative to the population size, suggesting that only a fraction of the population was geographically or socially linked to ongoing transmission. Hence, we also estimated the effective size of the population at risk in each country. Priors for model parameters were informed by published estimates of Ebola transmission dynamics (Table S11; Web Appendix G). We also fit a set of simplified models to data from each country independently to understand the benefit of explicitly modeling cross-border transmission (Web Appendix G). Results from the single-country models did not differ substantively from results obtained with the joint model (Table S17). Figure 3: Diagram of state transitions for a joint model for Ebola transmission in Guinea, Liberia, and Sierra Leone. Dotted boxes denote countries, nodes in circles denote the model compartments: susceptible but removed from infectious contact (S R ), susceptible but exposed to infectious contact (S E ), exposed (E), infectious (I), recovered (R). Compartments are subscripted with country indicators. Solid lines with arrows indicate stochastic transitions between model compartments, which occur continuously in time. Dashed lines indicate that infected individuals in one country contribute to the force of infection in another country. Rates at which individuals transition between compartments are denoted by λ and are subscripted by compartments and superscripted by countries, e.g., λ L S E E is the rate at which susceptible individuals become exposed in Liberia. Transmission in Liberia and Sierra Leone was assumed to commence at 10 and 19 weeks, respectively. Full expressions for the rates are given in Table S12.
The estimated transmission dynamics under the LNA model (Table S17) were consistent with published estimates obtained with stochastic models fit to aggregate incidence data (Chretien et al., 2015). The posterior median (95% BCI) basic reproduction numbers, adjusted by the estimated effective population sizes, were 1.2 (1.1, 1.5) in Guinea, 1.9 (1.4, 3.2) in Liberia, and 1.3 (1.2, 1.4) in Sierra Leone. Adjusted basic reproduction numbers estimated under the ODE tended to be higher than estimates obtained under the LNA (top panel, Figure 4). Posterior distributions of latent and infectious period durations in Guinea and Liberia largely recovered the priors, while the estimated durations for Sierra Leone were somewhat shorter, though not unreasonably so. Estimated latent and infectious period durations under the ODE were longer than under the LNA, especially in Guinea and Liberia, where they were much longer than expected. Though we allowed for cross-border transmission, we were not able to resolve its contribution from the data and exactly recovered the priors for extrinsic basic reproduction numbers between each pair of countries. Additional results, including diagnostics, are provided in Web Appendix H.
Compared with the deterministic ODE approximation, the LNA provides a better fit and more appropriately accounts for uncertainty about the outbreak. The LNA posterior predictive distribution, which integrates over the joint posterior of the model parameters and latent epidemic process, better matches the observed incidence than does the ODE posterior predictive distribution (bottom panel, Figure 4). ODE posterior predictive intervals (PPIs) are wider than their LNA counterparts, and ODE posterior predictive p-values (PPPs) are more extreme ( Figure S13). The poor performance of the ODE is due to its being forced to account for all observations with a single deterministic path, which inevitably leaves many observations poorly explained and results in higher estimates of the negative binomial overdispersion parameter. In contrast, the stochastic nature of the LNA, and in particular, the restarting formulation explored in this work, allows the model to capture local variability in the epidemic process.

Discussion
We have presented a broadly applicable framework for fitting stochastic epidemic models to partially observed incidence counts. We demonstrated how the LNA could be reparameterized to properly analyze incidence data and leverage state-of-the-art MCMC machinery. Unlike previous applications of the LNA to epidemic count data, our framework accommodates non-Gaussian surveillance models without relying on simulation-based computational tools. We have verified that the LNA is statistically and computationally performant in simulations designed to reflect important use-cases for SEMs. We have also highlighted instances where modelers should use caution. Our framework is not panacea for weak data and cannot conjure up precise estimates for aspects of the model that are unresolvable in the data. Nor is the LNA an adequate model for stochastic emergence and extinction of outbreaks, and we have demonstrated in simulations that applying it in these cases can lead to poor performance. Using data from the 2013-2015 outbreak of Ebola in West Africa, we demonstrated that our LNA framework is capable of fitting complex, geographically stratified SEMs.
For clarity of exposition, this work has focused on fitting simple SEMs to incidence data in closed, homogeneously mixing populations. In practice, we can improve the realism of our models by incorporating demography and allowing for heterogeneous mixing among subgroups in the population, e.g., age (Li and Brauer, 2008) or geographic strata (Van den Driessche, 2008). The computational cost of the LNA increases as the number of model compartments increases. One interesting extension of this work would be to model transmission within each stratum as conditionally independent given correlated hyperparameters, e.g., spatially structured reproduction numbers. This would allow for LNA paths for each stratum to be updated in parallel within each MCMC iteration.
It is frequently unreasonable to assume that outbreak dynamics are constant as the spatial and temporal extent of an outbreak increases. We are often interested in assessing the effects of interventions (Anderson and et. al, 2020), seasonal factors (Koepke et al., 2016), or changes in disease surveillance (Karcher et al., 2015), all of which require us to incorporate possibly time-varying covariates into our models. Another class of extensions involves modeling different aspects of transmission and surveillance semi-parametrically (Xu et al., 2016).
Mechanistic SEMs provide us with a framework for integrating multiple data streams into where P ef f,G , β G , and µ G are the effective population size, within-country per-contact infection rate, and recovery rate for Guinea, respectively. (Bottom panel) Posterior predicted incidence in West Africa under the LNA and ODE models, marginalizing over the joint posterior distributions of the latent incidence and model parameters. Solid lines are pointwise posterior predictive median incidence, shaded bands correspond to 80% and 95% pointwise posterior predictive incidence distributions, and dots are the observed incidence.
a coherent model. This can help to resolve multimodality in the posterior and stabilize inference for aspects of the model that are only weakly identifiable from incidence data. Incidence and mortality data have been combined in models for SARS-CoV-2  and influenza (Shubin et al., 2014, De Angelis andPresanis, 2019). In work that was concurrent to the methods presented in this paper, the LNA has also been used to jointly analyze incidence data and genetic data (Tang et al., 2019). Our framework can easily be extended to accommodate multiple data streams by adding surveillance model components and appropriately tracking incidence or prevalence in different compartments.

Supporting Information for "A Linear Noise Approximation for Stochastic Epidemic Models Fit
to Partially Observed Incidence Counts by Jonathan Fintzi, Jon Wakefield, and Vladimir N. Minin."

Web Appendix A: Large Population Approximations for Markov Jump Processes
There are a variety of ways to arrive at the diffusion approximation for a MJP (Fuchs, 2013). We outline an intuitive, though somewhat informal, construction of a stochastic differential equation (SDE), referred to as the chemical Langevin equation (CLE), where the drift and diffusion terms are chosen to match the approximate moments of MJP path increments in infinitesimal time intervals (Wilkinson, 2011, Golightly andGillespie, 2013), and refer to Gillespie (2000) and Fuchs (2013) for more detailed presentations. Denote the compartment counts at time t by X c (t) = x c t . We want to approximate the numbers of infections and recoveries in a small time interval, (t, t+dt], i.e., N c (t+dt)−N c (t). Suppose that we can choose dt so that the following two leap conditions hold: 1. dt is sufficiently small that the X c is essentially unchanged over (t, t + dt], so that the rates of elementary transition events, e.g., infections and recoveries, are approximately constant: 2. dt is sufficiently large that we can expect many disease state transitions of each type: λ(x c (t))dt 1.
Condition (17), holds when dt is small, and implies that the numbers of infections and recoveries in (t, t + dt] are essentially independent since their rates of occurrence are approximately constant within the interval (Gillespie, 2000). This condition also implies that the numbers of events are Poisson random variables with rates λ( , 2011). Condition (18) implies that the Poisson innovations are well-approximated by Gaussian random variables.
When (17) and (18) hold, we can approximate the integer-valued processes, X c and N c , with the real-valued processes, X and N. The state space of X for the SIR model is and the state space of N is In words, the state space of X is the set of compartment volumes that are non-negative and that sum to the population size, while the state space of N is the set of non-decreasing and non-negative incidence paths, constrained so that they do not lead to invalid prevalence paths (e.g., where there are more recoveries than infections and hence negative number of infected individuals). For now, we ignore the constraints on S R N and S R X , and approximate changes in cumulative incidence of infections and recoveries in an infinitesimal time step as where Λ = diag (λ(X)) and Z ∼ M V N (0, I). This implies the equivalent CLE, where the vector W t is distributed as independent Brownian motion, and Λ(X(t)) 1/2 is a matrix square root of Λ(X(t)).

Validity of the Linear Noise Approximation
Wallace (2010) and Wallace et al. (2012) argue that the LNA is perhaps more appropriately viewed as an approximation to the CLE. The LNA provides us with an analytic characterization (obtained numerically) of the stochastic differential equation (SDE) transition density as the size of a chemical reaction system is scaled back from its infinite population ordinary differential equation (ODE)  The first of these questions is easier to answer in some generality. Given a long enough time interval, the LNA will diverge from the CLE as perturbations to the SDE accumulate. In contrast, the the deterministic drift of the LNA is determined by the initial conditions at the start of the time interval. Solutions to this issue have been proposed in (Fearnhead et al., 2014) and (Minas and Rand, 2017). In this work, we have adopted the restarting formulation of the LNA, proposed in Fearnhead et al. (2014). Restarting the LNA at observation times, though informal, is in a sense optimal when viewed as a filtering procedure. The restarting algorithm helps to inoculate us against divergence of the LNA from the CLE by ensuring that we are only approximating the CLE over short time intervals. Now, it is possible that a finer observation interval, and hence more frequent restarts, would lead to less error in the approximation. However, it also possible that a finer observation interval, say, using daily incidence counts, could lead to less robust inferences. For instance, incidence data are often aggregated to weakly counts in order to eliminate day-of-week effects and to mitigate fine scale problems caused by reporting delays.
To the second question, it is impossible to say in complete generality when the CLE is a good approximation for a MJP, and often this can only be answered through simulations in the context of the target application. The advice that the CLE is reasonable in large populations is an often useful heuristic for the necessary and sufficient (and vague) condition that the system is "close to its thermodynamic limit." Even in huge populations, the CLE is not uniformly valid since there are few transition events in the incipient and terminal stages of an outbreak. This was shown in (Buckingham-Jeffery et al., 2018), who demonstrated in simulations that the KL divergence between the MJP and a variety of approximations, including the LNA and several SDEs, is greatest at the start and end of an outbreak.

Infinite Population Deterministic Limit of Markov Jump Processes
In the infinite population limit, the trajectory of a density dependent MJP converges to a deterministic trajectory that is the solution to (11) given some initial conditions, X 0 = x 0 and N = 0, and model parameters, θ (Allen, 2017). The solution to the ODE, (11), is a deterministic mapping of the parameters and initial conditions, meaning that for fixed θ, X 0 , N 0 there is only a single path that the latent process could take. In large population settings, it is common, though ill-advised, practice to ignore stochasticity in the latent epidemic process and assume that the time-evolution of X and N is given by their infinite population functional limits. Hence, deterministic ODE models simply replace the stochastic latent epidemic process with a deterministic curve. The other aspects of the model remain unchanged, e.g., we model the observed incidence as a negative binomial sample of the true incidence, but now the negative binomial mean is conditional on increments of the ODE path obtained by solving (11). With that said, we still have to estimate θ, and possibly X 0 . This is accomplished by sampling the posteriors of these random variables via MCMC as outlined in Section 2.7. initialize: (11) and (13) Algorithm 2 Sampling LNA draws via elliptical slice sampling.

4:
Position the bracket and make initial proposal: if L(Y|doLNA(Z , θ, I)) > u then accept Z Shrink bracket and try a new angle: 10: GoTo: 5

Tuning the Initial Elliptical Slice Sampling Bracket Width
When fitting SEMs with complex dynamics, e.g., when there are many strata or when the dynamics are time varying, we will be able improve the computational efficiency of our MCMC by initialing the ElliptSS bracket width at ω < 2π. This is motivated by the observation that when the model dynamics are complex, the ElliptSS bracket will typically need to be shrunk many times before the sampler reaches a range of acceptable angles in the proposal. Each time we propose a new angle in the ElliptSS algorithm we must solve the LNA ODEs in order to compute the observed data likelihood. Thus, if we can reduce the number of ElliptSS steps, we will be able to shorten the run time of our MCMC. We typically set the initial bracket width to a constant times the standard deviation of the accepted angles in a tuning phase. Since we do not step out the ElliptSS bracket, the initial width should not be so small as to induce additional autocorrelation in the latent process, and should also not be so wide that the bracket is contracted needlessly. We have found a bracket width of ω = 2 2 log(10)σ, corresponding to the full width at one tenth maximum for a Gaussian with standard deviation σ, to work well in practice. In order to facilitate tuning of the initial bracket width, the elliptical slice sampling Algorithm 2 was modified slightly from the one in Murray et al. (2010) with respect to the initial angle proposal so that the distribution of angles for accepted proposals would be symmetric around zero. Figure S1 presents histograms of the number of contractions per ElliptSS update and the accepted angles before and after contracting the initial ElliptSS bracket width for the Ebola model of Section 4. In this instance, we were able to substantially reduce the number of contractions, and hence likelihood evaluations, per ElliptSS update while leaving the distribution of accepted angles essentially unchanged. We like to call this a "free lunch".

Centered vs. Non-centered Parameterization
A central computation challenge for fitting hierarchical latent variable models via DA MCMC is that samples can become autocorrelated when alternately updating latent variables and model parameters (Papaspiliopoulos et al., 2003, Papaspiliopoulos et al., 2007. DA MCMC that alternately updates LNA paths and model parameters is no exception (Figure 2A).
This phenomenon of poorly mixing MCMC chains can be traced to the use of a centered parameterization (CP) for the LNA in (14). Under the CP, updates to θ| N, Y are made conditionally on a fixed LNA path. Therefore, parameter proposals are accepted if they are concordant with the data and the current path. Small perturbations to model parameters can significantly shift the LNA transition densities and render the current path unlikely under the proposal. This limits the magnitude of perturbations to the model parameters at each MCMC iteration and results in severely autocorrelated posterior samples.
The NCP for latent LNA paths massively improves MCMC mixing. Figure 2A shows traceplots of model parameters for one of the MCMC chains for an SIR model fit to Poisson distributed incidence data using the CP. Each MCMC chain was run for 2.5 million iterations, following a tuning run of equal length, but only yielded an effective sample sizes in the low double digits for the basic reproduction number and infectious period duration. In contrast, the NCP yielded effective sample sizes per-chain of between 500-700 for each of the model parameters in only 50,000 iterations following a tuning run of equal length. Figure 2B shows Figure S1: Distributions of the numbers of contractions per ElliptSS update and the accepted angles for an MCMC chain for the Ebola model of Section 4 fit to a simulated dataset. An initial bracket width of 2π was used for the first 5,000 iterations (top row), after which the initial bracket width was set to 2 2 log(10)σ ElliptSS , where σ ElliptSS was the standard deviation of the accepted angles from the initial run (bottom row).
traceplots for one of the NCP MCMC chains. Note that since the posterior distribution of the restarting LNA under the CP does not actually decompose into the form required to use ElliptSS, applying ElliptSS to the CP of the restarting LNA amounts to essentially further approximating the CP with Gaussian random variables.

Multivariate Normal Slice Sampler
Univariate slice samplers can suffer from poor mixing in moderate-to high-dimensional settings much in the same way as Gibbs samplers. One option for reducing autocorrelation is to update blocks of parameters. Methods for slice sampling in multiple dimensions are explored in Neal (2003), Thompson (2011), Tibbits et al. (2014. These include slice sampling in hyperrectangles, the use of adaptive Gaussian crumbs that guide slice proposals, and slice sampling along eigenvectors of the estimated posterior covariance matrix. We present a simple method for sampling a parameter vector, θ ∈ R d , where we perform univariate slice sampling updates along rays drawn from a non-isotropic angular central Gaussian distribution, which is tuned to match the covariance structure of the posterior. This helps to account for correlations among model parameters. The method, which we refer to as the multivariate normal slice sampler (MVNSS), is similar to the algorithm in Ahmadian et al. (2011), although we also adapt the proposal covariance matrix using a Robbins-Monro recursion during the adaptation phase of the MCMC Thoms, 2008, Liang et al., 2011). The computational cost of MVNSS does not increase dramatically with the dimensionality of the parameter space, though we have found that multiple MVNSS updates per MCMC iteration can, in some cases, improve performance. The algorithm is amenable to tuning of the initial bracket width as in Tibbits et al. (2014), which helps to reduce the number of likelihood evaluations per iteration.
Suppressing the dependence on the data for notational clarity, slice sampling θ ∈ R d from its posterior π(θ|Y) is largely the same as sampling θ ∼ π(θ) ∝ f (θ). Let Σ = Cov(θ) = LL T , where L is the lower triangular matrix of the Cholesky decomposition of L (any other matrix square root would do). In practice, Σ is approximated by Σ n , which is estimated over an initial MCMC run. The strategy in MVNSS is to propose θ prop = θ cur +cξ, where ξ = h(z), z ∼ M V N (0, Σ), h(z) = z/||z||, and to sample c in a univariate slice sampling update. Normalizing z allows us to more easily tune the initial bracket width. During an adaptation phase, we construct proposals as , h(z) = z/||z||, and w ∈ [0, 1]. The weight given to z 2 is typically quite small, but helps to avoid degeneracy of the empirical covariance matrix during adaptation. We give the non-adaptive version of the algorithm below.

Adapting the proposal covariance in MVNSS
Adaptive MCMC algorithms aim to improve computational efficiency by using MCMC samples to learn optimal values of tuning parameters on the fly. MCMC proposal kernels can be adapted in a number of different ways, but must be adapted with care to preserve the stationarity of the target distribution. In order for an adaptive MCMC algorithm to preserve the stationary distribution, it must satisfy two conditions, vanishing adaptation, and  (16). MCMC alternated between updating the latent path via elliptical slice sampling, and updating parameters via a multivariate random walk Metropolis algorithm. R 0 = βP/µ is the basic reproductive number, 1/µ is the mean infectious period duration, and ρ is the mean case detection rate. The true values of R 0 , 1/µ, and ρ were 3.5, 7, and 0.5, respectively.
Algorithm 3 Multivariate normal slice sampling with stepping out.
The main computational tool used in the adaptive variations of the MCMC algorithms in this dissertation is the Robbins-Monro recursion, which allows us to continuously adapt the tuning parameters of an MCMC kernel. The Robbins-Monro recursion is a stochastic approximation algorithm that searches for a solution to an equation, f (θ) = α, that has a unique root at θ . The function f (θ) is not directly observed. Instead, we use a noisy sequence of estimates, h( θ n ), satisfying E(h( θ n )) = f (θ) to recursively approximate θ . The recursion takes the form, Hence, the recursion increments θ by an amount proportional to the difference between h( θ n ) and its target. The gain factor sequence, {γ n+1 }, is a deterministic non-increasing, positive sequence such that Note that since γ n → 0 and E(h( θ n )) = f (θ), it follows that |θ n+1 − θ n | → 0 as n → ∞, i.e., the recursion is constructed to satisfy diminishing adaptation. Condition (ii) ensures that the gain sequence does not decay so fast that there are values of θ in its state space, Θ, that cannot be reached. Condition (iii) ensures bounded convergence of the sequence {θ n }. Gain factor sequences of the form will satisfy these conditions Thoms, 2008, Liang et al., 2011). We adapt the proposal covariance over the course of an initial MCMC tuning run, which is followed by a final run with a fixed MCMC kernel. The samples accumulated during the adaptation phase are discarded. Let µ n and Σ n denote the empirical mean and covariance of the posterior samples from the first n MCMC iterations, and {γ n } be a sequence of gain factors. In each adaptive MCMC iteration, we sample θ new |θ cur via MVNSS, and update the empirical mean and covariance via the following recursions:

Initializing the LNA Draws
In simple models, biologically plausible parameter values will generally lead to valid LNA paths, and we can initialize the LNA draws by simply drawing Z ∼ M V N (0, I). However, this is not necessarily the case for complex models with many types of transition events, or when the time-series of incidence counts is long. One option is to include a resampling step after line 6 in Algorithm 1, in which Z(t ) is redrawn in place until we have obtained a valid LNA path that respects the constraints on the latent state space. However, such a procedure does not sample from the correct distribution since Z is not distributed as a truncated multivariate Gaussian. To correct for this, we "warm-up" the LNA path with an initial run of ElliptSS iterations in which the likelihood only consists of the indicators for whether the path is valid. Note that ElliptSS, or any other valid MCMC algorithm for updating Z|θ, Y, will never lead to an invalid LNA path being accepted if the current LNA draws and model parameters correspond to a valid path. Similarly, any valid MCMC algorithm for updating model parameters conditional on LNA draws will also preserve the validity of LNA paths.

Inference for Initial Compartment Volumes
When the initial compartment volumes are included as initial parameters in the model instead of being treated as fixed, we will model them as arising from the following truncated multivariate normal distribution: where p is a vector of subject-level initial state probabilities, P = diag(p), P is the population size, α is an over-dispersion parameter, and the subscript S R X specifies the state space of X (so that the compartment volumes add up to P and each compartment volume is nonnegative and less than the total population size at time t 0 ). Thus, the initial distribution is the truncated normal approximation of either a multinomial distribution with size P and probability vector p if α = 1, or of a dirichlet-multinomial distribution with parameters α =⇒ p = α/α T 1, and over-dispersion α = (P + α T 1)/(1 + α T 1). In models with multiple strata, we will similarly model the initial compartment volumes as having independent truncated multivariate normal distributions that are each approximations of multinomial distributions over initial compartment counts within each stratum. Notation and details are completely analogous to the single stratum case, and are therefore omitted for clarity.
Let M = P p, V = αP (P − pp T ), and V 1/2 be the matrix square root of V, which we will compute using the singular value decomposition V = UDU T =⇒ V 1/2 = UD 1/2 . Let Z X denote the LNA draws as before, and let Z X 0 ∼ MVN(0, I) denote the vector of draws that will be mapped to X 0 . We will update the initial compartment volumes jointly with the LNA draws using elliptical slice sampling.
Algorithm 4 Sampling LNA draws and initial volumes via elliptical slice sampling.

4:
Position the bracket: Make the initial proposal: if L(Y|doLNA(Z , θ , I)) > u then accept Z X , Z X 0 Shrink bracket and try a new angle: 10:

Web Appendix C: Comparison with Other Common MJP Approximations
We simulated 1,000 outbreaks with SEIR dynamics from a MJP via Gillespie's direct algorithm for each of the three disease settings given in Table S1. We initialized the outbreaks with 25 exposed (E) and 5 infectious (I) individuals in the influenza setting, and 5 exposed and 5 infected individuals in the Ebola and SARS-CoV-2 settings. We fixed the initial conditions at their true values instead of estimating them as parameters in the model. The data were a negative binomial sample of the true latent incidence in each week. We truncated the incidence time series at 52 weeks or after observing four consecutive counts of five or fewer cases, whichever came first. We fit each model using the LNA, ODE, and MMTL/PMMH approximations. Five MCMC chains per model were initialized at random values near the true parameters. For models fit via the LNA and ODE approximations, an initial adaptive MCMC run of 25,000 iterations of the GA-RWM algorithm was used to estimate the empirical covariance matrix. The empirical covariance matrix was initialized at 0.1 times an identity matrix. The gain factor sequence was γ n = (1 + n) −2/3 , and a small nugget variance of 0.00001 was added during the adaptation phase. The target acceptance rate used in the adaptation was 0.234. After the adaptive run, the empirical covariance matrix was frozen and we ran the MCMC for an additional 50,000 iterations where parameters were sampled via a GA-RWM algorithm with fixed covariance matrix. The samples from all five chains were combined to form the final MCMC posterior sample. The total run time included both the adaptive and fixed kernel phases of the MCMC run. The models were implemented using the stemr R package (Fintzi, 2020).
Inference via the MMTL approximation within PMMH was implemented using the pomp R package (King et al., 2016b). We used 500 particles in the PMMH algorithm, and a τ -leap interval of either one day or one hour. MCMC was initialized in the same way as in the LNA and ODE models. The empirical covariance was adapted using two initial tuning runs of 1,000 and 10,000 iterations with a gain factor sequence of γ n = n α , with the cooling term, α = 0.999. The initial tuning run was adopted because some Markov chains were plagued by severe particle degeneracy early in the adaptation. Hence, we found it useful to check whether the adaptation had degenerated early in the MCMC run. We restarted the first adaptive MCMC phase if the number of accepted MCMC proposals was not between 100 and 800. The empirical covariance matrix from this first adaptive phase was plugged into a second adaptive phase which was restarted until we obtained an adaptive run with between 500 and 8,000 accepted MCMC proposals. The empirical covariance matrix was then frozen and we accrued an additional 50,000 samples per chain that were combined to form the final MCMC posterior sample. The total run time included the run time from the second adaptive MCMC phase and the fixed kernel MCMC phase.

Supplementary simulation in a stochastic extinction setting
We repeated the simulation described above, but now truncated the incidence time series at 52 weeks or after eight consecutive weeks of zero observed cases, whichever came first. As discussed in Section 3.2, the LNA now performs poorly with so much of the data coming from the tail of the outbreak.    and 10000, respectively. R 0 is the basic reproduction number, 1/ω in the mean latent period, 1/µ is the mean infectious period, ρ is the mean case detection rate, and 1/ √ φ is (loosely) the excess dispersion of the negative binomial surveillance model on the standard deviation scale. In this simulation, incidence time series were truncated at either 52 weeks or after eight consecutive weeks of zero observed cases.

39
9 Web Appendix D: Bayesian Coverage Simulation for SIR models

Simulation Setup
In this simulation, repeated for each of the three different regimes of population size and initial conditions given in Table S3, we simulated 1,000 datasets as follows: 1. Draw log(R0 − 1), 1/µ, logit(ρ), log(φ) from the priors given in Table S3.
2. Simulate an outbreak, N|θ, under SIR dynamics from the MJP via Gillespie's direct algorithm (Gillespie, 1976). If there were fewer than 15 cases, simulate another outbreak.
3. Simulate the observed incidence, Y|N, θ, as a negative binomial sample of the true incidence in each epoch, i.e., Y ∼ Neg.Binomial(ρ(N SI (t ) − N SI (t −1 )), φ). The incidence time series was truncated at 52 weeks or after 4 consecutive weeks of five or fewer counts.
We fit SIR models using the LNA, ODE, and MMTL approximations. Priors for model parameters were assigned as in Table S3. Five MCMC chains per model were initialized at random values near the true parameters and run for 75,000 iterations per chain. The first 25,000 iterations used an adaptive GA-RWM MCMC algorithm to estimate the empirical covariance matrix to be used in the multivariate Gaussian random walk Metropolis-Hastings proposals. The empirical covariance matrix was initialized as 0.01 times an identity matrix. After the warm-up period, the empirical covariance matrix was frozen and the final 50,000 iterations from each chain were combined to form the final MCMC sample. For models fit via the LNA and ODE approximations, the covariance matrix was adapted as in algorithm 4 of Andrieu and Thoms (2008). The gain factor sequence was γ n = (1 + n) −2/3 , and a small nugget variance, equal to 0.00001 times an identity matrix, was added during the adaptation phase. The target acceptance rate used in the adaptation was 0.234. The models were implemented using the stemr R package (Fintzi, 2020).
Inference via the MMTL approximation within PMMH were fit using the pomp R package (King et al., 2016b). We used 250 particles in the PMMH algorithm. The τ -leap interval for MMTL was set to one hour in contrast to the one week inter-observation interval. The MCMC was initialized in the same way as LNA and ODE models, but the empirical covariance matrix was adapted according to a different cooling schedule. The gain factor sequence provided by the package is of the form γ n = n α , where the cooling term, α, was set to 0.999.The initial tuning run was adopted because some Markov chains were plagued by severe particle degeneracy early in the adaptation. Hence, we found it useful to check whether the adaptation had degenerated early in the MCMC run. We restarted the first adaptive MCMC phase if the number of accepted MCMC proposals was not between 100 and 800. The empirical covariance matrix from this first adaptive phase was plugged into a second adaptive phase which was restarted until we obtained an adaptive run with between 500 and 8,000 accepted MCMC proposals. The empirical covariance matrix was then frozen and we accrued an additional 50,000 samples per chain that were combined to form the final MCMC posterior sample. The total run time included the run time from the second adaptive MCMC phase and the fixed kernel MCMC phase.
Posterior contraction LNA ODE MMTL Posterior 80% CI width vs. prior 80% CI width Scaled credible interval width Figure S4: Supplementary simulation results for a Bayesian coverage simulation for SIR models fit via the LNA, ODE, and MMTL/PMMH. R 0 is the basic reproduction number, 1/mu is the mean infectious period, ρ is the mean case detection rate, and 1/ √ φ is (loosely) the excess dispersion of the negative binomial surveillance model on the standard deviation scale.

Web Appendix E: Choice of Estimation Scale and Implications for MCMC
How we parameterize the estimation scale on which a Markov chain explores the posterior is critically important to its computational performance. If we can identify transformations of the model parameters that minimize strong correlations and non-linear relationships on the estimation scale, we will be able to substantially improve MCMC mixing. In our context, it will often be relatively straightforward to identify such transformations (or at least intermediate transformations that can be used in combination). As a general approach, we will try to identify transformations that reflect the ways in which model parameters jointly act on the model dynamics, and then a second set of transformations that remove any boundary conditions. As an example, consider an SEIR model fit to incidence data from Sierra Leone. This model includes parameters for the external force of infection and the effective population size, which add complexity to the usual formulation of the SEIR dynamics as being entirely driven by endogenous contacts within a closed homogeneously mixing population. The effective population size is roughly the size of the initially susceptible population. The model parameters on their natural scales are provided in Table S4. Each of the model parameters is obviously interpretable on its natural scale, but upon examining the pairwise scatterplots of the posterior ( Figure S5) it becomes obvious that the parameters interact in highly nonlinear ways. We would encounter a variety of pathological computational problems if we were to naively parameterize the MCMC estimation scale without considering the ways in which the parameters interact to affect the dynamics. For example, it would be extremely difficult for any sampler that does not account for the curvature in the posterior, e.g., Hamiltonian Monte Carlo (HMC), to explore the parameter space. (An aside: we experimented with implementing the LNA in Stan and using HMC to sample the posterior, but repeatedly integrating the LNA ODEs along with their augmented sensitivity equations was prohibitively slow for even simple models).
We can mitigate the problems caused by non-linear relationships and strong correlations among parameters by parameterizing the estimation scale in terms of how the parameters jointly affect the model dynamics and then removing the boundary conditions. Table S5 provides a list of parameters on their estimation scale that are reflective of an initial first pass at how we would expect the parameters to interact. For example, the parameters governing the rates of infectious contact, α and β, combine with the effective population size and the infectious period duration to produce the basic reproductive numbers with respect to initially infected individuals outside and inside the population. Figure S6 shows the pairwise scatterplots for posterior samples in this parameterization. We can see that there are some residual non-linear relationships between the log effective population size, the logit case detection probability, and the adjusted reproductive number.
A heuristic argument for an estimation scale that further simplifies the posterior geometry proceeds by analogy with the analogous deterministic ODE model. In particular, we will consider how the functions of model parameters in Table S5 act on the model dynamics through the final size relation, and how they are informed by the data. The final size relation for the ODE model (Miller, 2012) relates the fraction of the population that eventually becomes infected π, with the basic reproductive number: As R0 increases, a larger fraction of the population becomes infected. As the effective population size, P ef f , increases, so too does the overall scale of the outbreak, and the number of cases we would expect to detect. The expected scale of the observed outbreak is related to the quantity, π × ρ × P ef f , which should be concordant with the total number of observed cases. We can interpret the product, ρ × P ef f , as a measure of scale the observed incidence data. An implication of this is that the combination of parameters we would expect to jointly act on the model, a posteriori, is the adjusted reproduction number offset by the case detection rate, R0 × ρ × P ef f , which will enter our estimation scale as log(R0 × ρ × P ef f ). The other modification of the estimation scale in Table S5 replaces the log latent period with the log ratio of infectious to latent period durations. The new estimation scale is given in Table S6 and pairwise scatterplots for the posterior samples are shows in Figure S7. On this estimation scale, the posterior is much better behaved, with weaker pairwise correlations and little in the way of non-linear relationships between the model parameters. Figure S5: Marginal histograms and pairwise scatterplots of posterior samples for parameters for the SEIR model fit to the Sierra Leone Ebola dataset using the estimation scale in Table S4.   Table S5.
48 Figure S7: Marginal histograms and pairwise scatterplots of posterior samples for parameters for the SEIR model fit to the Sierra Leone Ebola dataset using the estimation scale in Table S6.

the Effective Population Size
When the scale of an outbreak is small relative to the population size, it may be unreasonable to assume that the entire population mixes homogeneously and participates in propagating the epidemic. An alternative is to split the population into two sub-populations, one that is effectively removed from infectious contact, and another at-risk sub-population within which infectious contacts arise via homogeneous mixing of infectious and susceptible individuals. For example, in the case of the SIR model, we split susceptibles into two compartments, S R and S E , where S R is a susceptible sub-population that is effectively removed, and S E is a susceptible population that may become exposed. In this model, the effective population size is P ef f = S E + I + R, and is interpreted as the size of the population at risk of infection. The transmission model is otherwise constructed in the same way as the canonical SIR model, except with S E replacing S.
The effective population size and the mean case detection probability are weakly identifiable parameters in that we require prior information about their scales to disentangle their effects. To see why this is so, note that ρ and P ef f enter into the complete data likelihood, (3), through the priors and through surveillance models that have means of the form, ρ∆N SI (t ). The incidence here should be understood as an increment in compartment concentrations scaled by the effective population size, since the LNA is a density dependent process (Komorowski et al., 2009, Wilkinson, 2011, Fearnhead et al., 2014. Thus, the surveillance models have means of the form, ρ N S S I (t ) − N S S I (t −1 ) P ef f , where N = N/P ef f is the equivalent representation of the LNA in terms of compartment concentrations.
Absent prior information, we will have difficulty identifying both the case detection probability and effective population size. Despite this, there are a few reasons that ρ and P ef f might be weakly identifiable, rather than completely unidentifiable. First, certain stochastic aspects of the outbreak, such as the probability of a major outbreak and persistence of transmission, depend on the population size. Furthermore, the scale of the observed incidence and the observed outbreak duration are informative about the minimal effective population size. Therefore, the fact that we observe part of the outbreak is itself informative. Finally, a rough estimate the true population size is typically available, providing an upper bound on the effective population size. By extension, the latent epidemic process is also weakly identifiable in models where the effective population size and case detection probability are estimated.
In contrast, the effective detectable population at risk, ρ × P ef f , along with parameters governing the outbreak dynamics, are directly informed by the data and remain identifiable. It might seem paradoxical that we can infer the dynamics of an outbreak when we are unable to estimate the latent process. To understand why this is so, note that a SEM can be rewritten in terms of concentrations by dividing the compartment counts by the population size, yielding the so-called "true mass-action model". The dynamics of this equivalent model, expressed, for example, by the basic reproductive number R0 and recovery rate for an SIR model, are known to be independent of the population size (de Jong et al., 1995). Combinations of model parameters yield latent paths, N , expressed in terms of increments in concentrations, and are weighted in the posterior proportionally (modulo the prior) to the likelihood of scaled paths, ρP ef f N . The temporal nature of the data is important here because the curvature of scaled paths should roughly match that of the data. Thus, we are leveraging curvature in the data to make inferences, not just the pointwise surveillance probabilities.
We check that ρ × P ef f and the parameters governing the outbreak dynamics are identifiable via a simple simulation. We drew 500 sets of parameters from the priors given in Table  S7, and simulated an outbreak and a dataset for each set of parameters. The models were fit via the LNA under the same priors from which the parameters were drawn using the MCMC procedure used to fit models for the main coverage simulation (described in the first section of Web Appendix C). The results are summarized in Table S8. The nominal coverage rates for all model parameters is approximately correct. However, the relative widths of the posterior credible intervals for the case detection rate are substantially narrower than the relative widths of the credible intervals for ρ and P ef f vis-a-vis their prior intervals. This suggests that the data are informative about ρ × P ef f . The priors for ρ and P ef f are not completely flat, and the scale of the observed counts is itself informative about P ef f . Therefore, we still expect, and observe, some contraction in the posteriors for ρ and P ef f , individually. Table S7: Parameters and priors used in simulating 500 SIR outbreaks where the effective population size was a parameter in the model. The true population size was 100,000. Each outbreak was simulated from a MJP with SIR dynamics. The observed incidence was a negative binomial sample of the true incidence.

Web Appendix G: Modeling the Spread of Ebola in West Africa
We modeled the spread of Ebola in Guinea, Liberia, and Sierra Leone under SEIR transmission dynamics within each country, incorporating cross-border transmission via virtual migration of infectious individuals. The model was first fit to a dataset simulated from the true model under known parameters, and then to incidence data from the 2013-2015 West Africa outbreak, each time using both the LNA and ODE approximation computation. The priors and model fitting procedures were largely the same for each dataset and for each approximation. Hence, the following sections apply to all Ebola models.

Parameter Interpretation State Transition β A (t)
Per-contact rate of transmission within country A.
Per-contact rate of transmission from country A to B.
Rate at which latent individuals become infectious.
Rate at which infectious individuals recover.

Priors for Effective Population Sizes and Initial Compartment Counts
At the time when transmission was assumed to commence in each country, susceptible individuals in the population were considered to either be geographic or social proximate to the transmission process, in which case they could possibly become exposed, or were detached from the transmission process. We separate the S compartment into a compartment for individuals who are susceptible and connected to exposure, S E , and individuals who are susceptible but effectively removed, S R . The fraction of the initially susceptible population that could possibly become exposed corresponds the effective population size. We identify the scale of the prior for S E by matching the total number of cases that were detected in each country to the number of cases that we would expect to detect given the effective population size under deterministic outbreak with SEIR dynamics. The final size relation for the SEIR model (Miller, 2012) relates the fraction of the population that becomes infected, π, to the basic reproduction number via: (1 − π) = exp −πR 0 .
Tables S13 and S14 give the effective fraction of the population that could possibly become exposed in each country in order for the expected number of detected cases under deterministic SEIR dynamics to match the observed number of cases under a range of values for the adjusted reproduction number, R adj , and mean case detection rate, ρ.
In our Ebola models, we used a multivariate normal approximation to a multinomial distribution for the initial distribution of individuals. The hyperparameter for country A, was set to and we compute the effective number of susceptibles as as R adj = βP ef f /µ. The mean hyper-parameters of priors for effective population sizes given in the table were used in modeling the West Africa outbreak. The mean hyper-parameters used in the simulated data example were 9.8, 10.5, and 10.6 for Guinea, Liberia, and Sierra Leone, respectively. The negative binomial overdispersion rate hyper-parameter in the simulated data example was also set to 1, reflecting that we expected less overdispersion in the setting where the model was not possibly misspecified.    Sierra Leone 1.25 40500 27000 20200 1.5 60900 40600 30500 1.75 88500 59000 44200 Table S15: Priors for the initial compartment volumes at the times when transmission was assumed to commence in Guinea, Liberia, and Sierra Leone. The initial compartment volumes for each country are assigned independent truncated multivariate normal priors (Web Appendix B). If the population size for country A is N A , and the initial state probability is denoted p 0,A = X 0,A /N A = (S 0,A , E 0,A , I 0,A , R 0,A )/N A , the prior is a truncated multivariate normal approximation of a multinomial distribution with mean N A p 0,A and covariance N A (P 0,A − p 0,A p T 0,A ).

Ebola Model MCMC Details for Models Fit via the LNA and ODE
The model fitting procedure and priors were the same for both models, and were also the same for models fit via the LNA and ODE approximations. We ran five chains for each model, initialized at random parameter values, for 150,000 iterations per chain, the first 50,000 of which consisted of an adaptive tuning phase. The model parameters, not including the initial compartment volumes, were jointly updated via MVNSS (Web Appendix C). The empirical covariance for the MVNSS algorithm was adapted over the first 100,000 iterations using the gain factor sequence, γ n = 0.5(1+0.01n) −0.9 . The contribution of isotropic Gaussian noise to the proposal was initialized at 0.001 and reduced throughout the adaptation phase according to the sequence ι n = 0.001(1 + 0.01n) −0.99 . The covariance matrix was blocked by country, treating parameters belonging to different countries as independent in the MCMC proposal kernel. Migration parameters were blocked with parameters corresponding to the destination country. The initial compartment volumes were jointly updated in a separate EllipSS update than the rest of the latent LNA paths. The MCMC alternated between one ElliptSS and one MVNSS updates per MCMC iteration. The ElliptSS bracket width was reset after the first 5,000 MCMC iterations to ω = 2 2 log(10)σ ElliptSS , where σ ElliptSS was the standard deviation of the accepted angles over the initial iterations. The MCMC estimation scales for each country were parameterized as in Table S6 with the one addition being the log ratio of adjusted reproductive numbers, subtract one, for Guinea, log (R ef f,G − 1) . Convergence was assessed visually by inspection of traceplots of posterior samples, and via potential scale reduction factors (PSRFs) (Brooks and Gelman, 1998) computed via the coda R package (Plummer et al., 2006). The LNA models each took roughly three days to run while run times for ODE models took between 1-2 hours.

Ebola Model MCMC Details for Computation with Particle Marginal Metropolis-Hastings
Computation using the MMTL approximation within PMMH was done using the pomp R package King et al. (2016b). We used 1,000 particles in the PMMH algorithm. The time step for MMTL was set to 1/7, which, for example, corresponds to τ -leaping over one day increments given weekly incidence data. The MCMC was initialized and parameterized in the same way as LNA and ODE models. Parameter updates were made using a multivariate Metropolis algorithm with Gaussian proposals. The proposal covariance matrix was adapted over an initial run of 50,000 iterations, with adaptation starting after the first 100 iterations were completed. The gain factor sequence implemented in the package is of the form γ n = n α , where the cooling term, α, was set to 0.99975. MCMC was run for 300,000 iterations following the adaptive MCMC phase. The posterior samples from all five MCMC chains were combined after discarding the initial samples from the adaptation phase. We were unable to obtain a convergent and well mixing MCMC sampler, despite substantial expenditure of time and effort, even for the dataset simulated under the assumed model. Hence, PMMH was abandoned as a computational strategy in the analysis of data from the West Africa Ebola outbreak. The multivariate PSRF, computed using the coda package in R (Plummer et al., 2006), was 1.89 and four of the 24 parameters had univariate PSRF values above 1.05, indicating that the posterior had not been adequately explored.

Single-Country Models Fit to Ebola Data From Guinea, Liberia, and Sierra Leone
A typical first step in learning about the overall outbreak dynamics is to separately model the incidence data from each country. This is less challenging than fitting a multi-country model that incorporates cross-border transmission since each model will have fewer parameters and a smaller latent state space. Furthermore iterating through simplified models is helpful in identifying parameterizations that simplify the posterior geometry (see Web Appendix B). We fit separate SEIR models, diagrammed in Figure S8, to the incidence data from each country using both the LNA and ODE approximations. Transmission was modeled in Liberia beginning March 2, 2014, and in Sierra Leone from May 4, 2014, corresponding to three weeks prior to the first confirmed or probable cases in those countries. The force of infection in each country included a constant term for infectious contact from outside the population, but did not explicitly link exogenous transmission to the prevalence in other countries. The transition rates for the single-country models are given in Table S16. To account for the small scale of each outbreak relative to the population size in the country, we estimated the effective population size as a parameter in the model. The number of susceptible individuals was then equal to the effective population size, minus the numbers of exposed, infected, and recovered individuals. To complete the model specification, the observed incidence was modeled as a negative binomial sample of the true incidence in each inter-observation interval, as in (1).
The priors for single-country model parameters were the same as those used in fitting the multi-country model, given in Tables S11 and S15. The exception was the prior for the baseline rate of transmission from outside the population, where for each country we took 1000α ∼Exponential(rate=40), reflecting our assumption that there were probably fewer than a dozen (two dozen under the more diffuse prior regime) transmission events per 1,000 infected individuals outside the country. This was based in part on results published in Dudas et al. (2017), who estimated between one-half to two dozen reintroduction events, depending Figure S8: Diagram of state transitions for SEIR models fit to Ebola incidence data from Guinea, Liberia, and Sierra Leone. Dotted boxes denote countries, nodes in circles denote the model compartments: susceptible (S), exposed (E), infectious (I), recovered (R). Compartments are subscripted with country indicators. The number of susceptible individuals is equal to the effective population size, estimated as a parameter in the model, minus the numbers of exposed, infected, and recovered individuals. Solid lines with arrows indicate stochastic transitions between model compartments, which occur continuously in time. Rates at which individuals transition between compartments are denoted by λ and are subscripted by compartments and superscripted by countries, e.g., λ L SE is the rate at which susceptible individuals become exposed in Liberia. Transmission in Liberia and Sierra Leone was assumed to commence at 10 and 19 weeks, respectively. Full expressions for the rates are given in Table S16.

Rate
State Transition on the country, between April 2014 and May 2015. We also used the same parameterizations for the estimation scales on which our MCMC samplers explored the posteriors (Table S12) Figure S11: Posterior distributions of LNA model parameters for the model fit to data from the West Africa Ebola outbreak. We show posterior medians (solid gray lines), 95% Bayesian credible intervals (light gray areas under the posterior densities), prior densities (induced priors for the reporting rate and latent period durations) over the posterior ranges (dashed green curves). Priors and interpretations of parameters are specified in Table S11.   Figure S12: Posterior distributions of ODE model parameters for the model fit to data from the West Africa Ebola outbreak under tight priors. We show posterior medians (solid gray lines), 95% Bayesian credible intervals (light gray areas under the posterior densities), prior densities (induced priors for the reporting rate and latent period durations) over the posterior ranges (dashed green curves). Priors and interpretations of parameters are specified in Table S11. and relative posterior predictive interval (PPI) widths for LNA and ODE models fit to data from the West Africa Ebola outbreak. Each point corresponds to the observed incidence in a given week. The X-Y coordinates give the PPPs under each model. The size and color of each point corresponds to the relative PPI width, computed as ( σ ODE post, − σ LN A post, )/ σ LN A post, , and the sign of the relative width is further emphasized by the shape of the point. Dots indicate that PPIs for the ODE model are wider, while triangles corresponds to observations for which the PPI produced by the LNA model was wider. Table S17: Posterior medians (95% Bayesian credible intervals) of parameters for Ebola models fit to incidence data from the 2013-2015 outbreak in Guinea, Liberia, and Sierra Leone. Country-specific parameters are denoted by subscripts G, L, and S. Priors are given in Table S11.

Posterior median (95% BCI)
Multi-country models     Table S18: Posterior estimates of initial numbers of exposed and infected individuals for the Ebola models fit to data from the West Africa outbreak. The effective number of susceptibles is equal to the effective population size minus the numbers of exposed, infected, and recovered individuals, but is not reported along with the number of recovered individuals since the effective population size is only weakly identified (Web Appendix D). Country-specific parameters are denoted by subscripts G, L, and S. Priors are given in Table S15.