Motivation Methods Simulation Studies Real Data Analysis Conclusions Bayesian Model Selection For Partially Observed Epidemic Models Panayiota Touloupou joint work with Simon E.F. Spencer, Bärbel Finkenstädt Rand, Peter Neal, Trevelyan J. McKinley P. Touloupou et al. CRiSM Workshop: Estimating Constants April 21, 2016 Bayesian Model Selection For Partially Observed Epidemic Models April 21, 2016 Motivation Outline Methods 1 Motivation 3 Simulation Studies 2 4 5 Simulation Studies Real Data Analysis Conclusions Methods Real Data Analysis Conclusions P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models April 21, 2016 Motivation Outline Methods 1 Motivation 3 Simulation Studies 2 4 5 Simulation Studies Real Data Analysis Conclusions Methods Real Data Analysis Conclusions P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models April 21, 2016 Motivation Methods Simulation Studies Statistical Epidemic Modelling Real Data Analysis Conclusions Insights into dynamics of infectious diseases ã Prevention ã Control spread of the disease Epidemiological data present several challenges ã Missing data (typically high dimensional) ã Diagnostic tests imperfect Model selection ã Each model an epidemiologically important hypothesis P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 1 / 33 Motivation Methods Our Setup Simulation Studies Real Data Analysis Conclusions Longitudinal observations Individuals form groups (e.g. households) P. Touloupou et al. : Individual Bayesian Model Selection For Partially Observed Epidemic Models 2 / 33 Motivation Methods Our Setup Simulation Studies Real Data Analysis Conclusions Longitudinal observations Individuals form groups (e.g. households) Day 1 : Non Infected P. Touloupou et al. Day 4 : Infected Day T − 2 Bayesian Model Selection For Partially Observed Epidemic Models Day T Study Period 2 / 33 Motivation Methods Simulation Studies Our Setup Real Data Analysis Conclusions Longitudinal observations Individuals form groups (e.g. households) Day 1 Day 2 : Non Infected P. Touloupou et al. Day 3 Day 4 : Infected Day T − 2 Day T − 1 Bayesian Model Selection For Partially Observed Epidemic Models Day T Study Period 2 / 33 Motivation Methods Simulation Studies Our Setup Real Data Analysis Conclusions Longitudinal observations − −+− − Day 1 −: Individuals form groups (e.g. households) − +−− − Day 2 Test Negative P. Touloupou et al. Day 3 +: Day 4 Test Positive − −−− − Day T − 2 Day T − 1 Bayesian Model Selection For Partially Observed Epidemic Models − −−− − Day T Study Period 2 / 33 Motivation Methods Objective Simulation Studies Real Data Analysis Conclusions Analysis of this type of data can be challenging ã Times of acquiring and clearing infection are unobserved ã Intractable likelihood - need to know missing times ã Usual solution: large scale data augmentation MCMC Bayesian model selection ã Evidence in favour of candidate models ã Each model an epidemiologically important hypothesis Objectives: P. Touloupou et al. Develop statistical tools for comparison of competing hypotheses Special attention on missing data Bayesian Model Selection For Partially Observed Epidemic Models 3 / 33 Motivation Outline Methods 1 Motivation 3 Simulation Studies 2 4 5 Simulation Studies Real Data Analysis Conclusions Methods Real Data Analysis Conclusions P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models April 21, 2016 Motivation Methods Simulation Studies Model Selection For Epidemics Real Data Analysis Conclusions A lot of epidemiologically interesting questions take the form of model selection questions What is the transmission mechanism of the disease? Do individuals develop immunity over time? Do water troughs spread E. coli O157? P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 4 / 33 Motivation Methods Simulation Studies Real Data Analysis Conclusions Posterior Probabilities And Marginal Likelihoods Would like the posterior probability in favour of model i π(y|Mi )P(Mi ) P(Mi |y) = X π(y|Mj )P(Mj ) j P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 5 / 33 Motivation Methods Simulation Studies Real Data Analysis Conclusions Posterior Probabilities And Marginal Likelihoods Would like the posterior probability in favour of model i π(y|Mi )P(Mi ) P(Mi |y) = X π(y|Mj )P(Mj ) j Equivalently, the Bayes factor comparing models i and j Bij = P. Touloupou et al. π(y|Mi ) π(y|Mj ) Bayesian Model Selection For Partially Observed Epidemic Models 5 / 33 Motivation Methods Simulation Studies Real Data Analysis Conclusions Posterior Probabilities And Marginal Likelihoods Would like the posterior probability in favour of model i π(y|Mi )P(Mi ) P(Mi |y) = X π(y|Mj )P(Mj ) j Equivalently, the Bayes factor comparing models i and j Bij = π(y|Mi ) π(y|Mj ) All we need is the marginal likelihood, Z π(y|Mi ) = π(y|θ, Mi )π(θ|Mi ) dθ but how can we calculate it? P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 5 / 33 Motivation Methods Simulation Studies Marginal Likelihood Estimation Real Data Analysis Conclusions Most direct approach: Importance sampling ã Use asymptotic normality of the posterior to find efficient proposal Many existing other approaches: ã ã ã ã P. Touloupou et al. Harmonic mean Chib’s methods Power posteriors Bridge sampling Bayesian Model Selection For Partially Observed Epidemic Models 6 / 33 Motivation Methods Simulation Studies Real Data Analysis Importance Sampling1 1 2 3 4 Obtain samples from the posterior π(θ|y) with MCMC Use MCMC samples to inform the proposal distribution ⇒ q(θ) Draw N samples from q(θ) Estimate the marginal likelihood by bIS (y) = π 1 Conclusions N X π(y|θ i )π(θ i ) i=1 q(θ i ) Clyde et al. (2007). Current Challenges in Bayesian Model Choice P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 7 / 33 Motivation Methods Missing Data! Simulation Studies Real Data Analysis Conclusions But how to deal with the missing data? P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 8 / 33 Motivation Methods Simulation Studies Missing Data! Real Data Analysis Conclusions But how to deal with the missing data? #1 #2 #3 P. Touloupou et al. [1] [1] xt−2 xt−1 xt−2 [2] xt−1 [3] xt−1 [1] yt−2 [2] yt−2 xt−2 [3] yt−2 [2] [3] [1] xt [1] yt [2] xt [2] yt [3] xt [3] yt [1] [1] xt+1 xt+2 xt+1 [2] xt+2 [3] xt+2 xt+1 [2] [3] Bayesian Model Selection For Partially Observed Epidemic Models [1] xt+3 [1] yt+3 [2] xt+3 [2] yt+3 [3] xt+3 [3] yt+3 8 / 33 Motivation Methods Simulation Studies Real Data Analysis Importance Sampling With Missing Data 1 2 3 4 5 Conclusions Obtain samples from the joint posterior π(x, θ|y) with MCMC Use MCMC samples to inform the proposal distribution ⇒ q(θ) Draw N samples from q(θ) For each sampled θ i draw missing data x i from the full conditional using Forward Filtering Backward Sampling Estimate the marginal likelihood by P. Touloupou et al. bIS (y) = π N X π(y|x i , θ i ) π(x i |θ i ) π(θ i ) π(x i |y, θ i ) q(θ i ) i=1 Bayesian Model Selection For Partially Observed Epidemic Models 9 / 33 Motivation Methods Harmonic Mean2 Simulation Studies Real Data Analysis Conclusions The marginal likelihood π(y) can be approximated " N 1 X 1 bHM (y) = π N π(y|x i , θ i ) i=1 #−1 based on N draws (x 1 , θ 1 ), (x 2 , θ 2 ), . . . , (x N , θ N ) from the joint posterior π(x, θ|y). Can be computed directly from MCMC output Asymptotically consistent Exhibit large or even infinite variance Newton M.A. and Raftery A.E. (1994) Approximate Bayesian inference with the weighted likelihood bootstrap J. R. Stat. Soc. Ser. B. Stat. Methodol, 56, 3–48 2 P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 10 / 33 Motivation Methods Chib’s Methods3 Simulation Studies Real Data Analysis Conclusions Based on the observation that π(y) = π(y|x, θ) π(x, θ) π(x, θ|y) for fixed θ ∗ , x ∗ (high-density posterior point) the log marginal likelihood can be estimated by bChib (y) = log π(y|x ∗ , θ ∗ ) + log π(x ∗ , θ ∗ ) − log π b (x ∗ , θ ∗ |y) log π =⇒ is estimated by breaking the parameter vector into appropriate blocks Required a separate MCMC run to calculate each block Chib S. (1995) Marginal likelihood from the Gibbs output J. Amer. Statist. Assoc, 90, 1313–1321. Chib S. and Jeliazkov I. (2001) Marginal likelihood from the MH output J. Amer. Statist. Assoc, 96, 270–281 3 P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 11 / 33 Motivation Methods Simulation Studies Power Posteriors4 Real Data Analysis Conclusions Power Posterior defined as π(x, θ|y, t) ∝ π(y|x, θ)t π(x, θ) where t ∈ [0, 1] is a temperature parameter The log of the marginal likelihood can be represented by log π(y) = Z 0 1 n o Ex,θ|y,t log π(y|x, θ) dt =⇒ is calculated numerically by discretising 0 = t0 < t1 < · · · < tn = 1, and then using trapezium rule. 4 Friel N. and Pettitt A. N. (2008) Marginal likelihood estimation via power posteriors J. R. Stat. Soc. Ser. B. Stat. Methodol. 70, 589–607 P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 12 / 33 Motivation Methods Simulation Studies Power Posteriors: Example Real Data Analysis Conclusions Obtain samples from the power posterior at each temperature ti Variability depends ã Number of ti ’s ã Spacing of ti ’s ã Number of MCMC samples Large number =⇒ more computational effort P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 13 / 33 Motivation Methods Simulation Studies Real Data Analysis Reversible Jump MCMC 1 Posterior Model 1 Posterior Model 2 Prior Model 1 Prior Model 2 1 0.5 0.5 0 Conclusions M1 M2 Model 1 θ1 k model indicator 0 model-specific parameters M1 M2 Model 2 θ2 data P. Touloupou et al. y Bayesian Model Selection For Partially Observed Epidemic Models 14 / 33 Motivation Outline Methods 1 Motivation 3 Simulation Studies 2 4 5 Simulation Studies Real Data Analysis Conclusions Methods Real Data Analysis Conclusions P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models April 21, 2016 Motivation Methods Simulation Studies Real Data Analysis Conclusions Simulation Study: Pnemonococcal Carriage5 Household based longitudinal study on carriage of Streptococcus Pneumoniae Diagnostic tests obtained every 4 weeks ã 10 months period ã Classified as Negative / Positive The population is divided into two age groups: ã Children ã Adults : under 5 years old : over 5 years old 5 Touloupou et al. (2016) Model comparison with missing data using MCMC and importance sampling. arXiv 1512.04743 P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 15 / 33 Motivation Methods Simulation Studies Model Details6 Real Data Analysis Conclusions Discrete time Susceptible-Infected-Susceptible model The transition probabilities age group i dependent: βC i IC (t) + βAi IA (t) · δt Pi (S −→ I )δt = 1 − exp − ki + (z − 1)w Pi ( I −→ S)δt = 1 − exp (−µi · δt) 66 : 166 2600 Observed Data : 94 6500 Missing Data Melegaro et al. (2004) Estimating the transmission parameters of pneumococcal carriage in households. Epidemiology and Infection, 132, P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 433–441 6 16 / 33 Motivation Methods Simulation Studies Real Data Analysis Results: Marginal Likelihood Estimation -1238 -1237 ISN1 ISN2 ISN3 ISN4 ISmix ISt4 ISt6 ISt8 ISt10 -1236 -1237.5 -1235 -1234 -1233 -1237.25 -1232 -1237 -1231 Conclusions -1230 Chib PP HM -931 -929 -927 -925 -923 Log marginal likelihood -921 -919 • ISNj : N(µ, j Σ) • IStd : td (µ, Σ) • ISmix : 0.95 × N(θ; µ, Σ) + 0.05π(θ) • µ, Σ: from MCMC P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 17 / 33 Motivation Methods Simulation Studies Real Data Analysis Conclusions Heterogeneity In Community Acquisition Rates Do adults and children acquire infection at the same rate? We compare two models: ã M1 : kA = 6 kC ã M2 : kA = kC P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 18 / 33 Motivation Methods Simulation Studies Real Data Analysis Results: Bayes Factor Estimation 2 ISmix 3 4 5 Chib ISmix -3 -2 -1 0 Chib RJcor RJcor ISmix ISmix HM HM RJ RJ PP PP 2 5 8 11 15 Log B12 19 23 (a) Data simulated from model M1 P. Touloupou et al. -4 Conclusions -22 -16 -10 -4 Log B12 0 4 8 (b) Data simulated from model M2 Bayesian Model Selection For Partially Observed Epidemic Models 19 / 33 Motivation Methods Simulation Studies Real Data Analysis Conclusions Results: Evolution Of The Log Bayes Factor 8 10 12 Initial MCMC run for IS and Chib RJ pilot + RJcor burn in Log B12 6 HM 4 PP RJcor -2 0 2 Chib 0 P. Touloupou et al. 30 60 90 120 Time (minutes) 150 180 210 240 Bayesian Model Selection For Partially Observed Epidemic Models IS 20 / 33 Motivation Outline Methods 1 Motivation 3 Simulation Studies 2 4 5 Simulation Studies Real Data Analysis Conclusions Methods Real Data Analysis Conclusions P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models April 21, 2016 Motivation Methods Study Designs Simulation Studies Real Data Analysis Conclusions Two longitudinal studies of E. coli O157:H7 Subjects Study duration Sampling interval Dataset 1 160 cattle 14 weeks 2 times/week Each sampling event included a ã Faecal pat sample ã Recto-anal mucosal swab (RAMS) Dataset 2 168 cattle 22 weeks 14 days Tests were assumed to have perfect specificity but imperfect sensitivity P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 21 / 33 Motivation Methods Simulation Studies Real Data Analysis Patterns Of Infection Conclusions Cattle in Pen 5 8 ● ● ● ● ● ● ● 7 ● ● ● ● ● ● ● 6 ● ● ● ● ● ● ● ● 5 ● ● ● ● ● ● ● ● ● 4 ● ● ● ● ● ● ● ● ● ● ● 3 ● ● ● ● ● ● ● ● 2 Positive Faecal ● ● ● ● ● ● ● ● ● ● ● 1 Animal Positive RAMS ● ● ● ● ● ● ● ● ● 1 ● 15 ● 29 ● Negative ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 43 57 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 71 85 99 Time (Day) P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 22 / 33 Motivation Methods Simulation Studies Real Data Analysis Conclusions Application 1: E. Coli O157 In Feedlot Cattle Do animals develop immunity over time? We compare two models for infection period: Geometric: lack of memory. Negative Binomial: probability of recovery depends on duration of infection. The Negative Binomial is a generalisation of the Geometric: P. Touloupou et al. Setting Negative Binomial dispersion parameter κ = 1 leads to Geometric. Bayesian Model Selection For Partially Observed Epidemic Models 23 / 33 Motivation Methods Simulation Studies Application 1: Results 1.5 IS RJMCMC Conclusions RJMCMC and IS agree on the estimate of the Bayes factor 1.0 IS estimator: faster convergence 0.5 Bayes factor supports the Negative Binomial model 0.0 Log BNG Real Data Analysis 0 P. Touloupou et al. 30 60 90 120 Time (in minutes) 150 180 The longer the colonization, the greater the probability of clearance – may indicate an immune response in the host Bayesian Model Selection For Partially Observed Epidemic Models 24 / 33 Motivation Methods Simulation Studies Real Data Analysis Application 2: Role Of Pen Area/Location 1 North Pen Set Pen Size 6m×17m Pen 14 Pen 15 Pen 6 Pen 7 Pen 8 Pen 9 Pen 10 Conclusions North = small Pen 16 Pen 17 Pen 18 Pen 19 Pen 20 Scale House Catch pens from scale house South = big Supplement and Premix Storage Pen 11 Pen 12 Pen 13 Pen 5 P. Touloupou et al. South Pen Set Pen Size 6m×37m Pen 1 Pen 2 Pen 3 Pen 4 Bayesian Model Selection For Partially Observed Epidemic Models 25 / 33 Motivation Methods Simulation Studies Real Data Analysis Application 2: Role Of Pen Area/Location Conclusions Do north and south pens have different risk of infection? Allow different external (αs , αn ) and/or within-pen (βs , βn ) transmission rates. Candidate models: P. Touloupou et al. Model 1 2 3 4 External North South αn αs α α αn αs α α Within-pen North South βn βs βn βs β β β β Bayesian Model Selection For Partially Observed Epidemic Models 26 / 33 Motivation Methods Simulation Studies Real Data Analysis Application 2: Posterior Probabilities Conclusions Posterior Probability 0.8 RJMCMC and IS provide identical conclusions. ● 0.6 Evidence to support different within-pen transmission rates. 0.4 0.2 ● ● 0.0 1 2 Method P. Touloupou et al. 3 Model IS 4 RJMCMC Animals in smaller pens more at risk of within-pen infection Bayesian Model Selection For Partially Observed Epidemic Models 27 / 33 Motivation Methods Simulation Studies Real Data Analysis Application 3: Investigating Transmission Between Pens Conclusions Dataset 2: pens adjacent in a 12 × 2 rectangular grid. No direct contact across feed buck. Shared waterers between pairs of adjacent pens. Pen 24 Pen 1 Pen 23 Pen 22 Pen 21 Pen 20 Pen 19 Pen 18 Pen 17 Pen 16 Pen 15 Pen 14 Pen 13 Pen 2 Pen 4 Pen 6 Pen 8 Pen 10 Pen 11 Pen 12 P. Touloupou et al. Pen 3 Pen 5 Pen 7 Pen 9 Bayesian Model Selection For Partially Observed Epidemic Models 28 / 33 Motivation Methods Simulation Studies Real Data Analysis Application 3: Investigating Transmission Between Pens Conclusions Do waterers spread infection? (a) Model 1: No contacts between pens P. Touloupou et al. (b) Model 2: Transmission via a waterer (c) Model 3: Transmission via any boundary Bayesian Model Selection For Partially Observed Epidemic Models 29 / 33 Motivation Methods Simulation Studies Real Data Analysis Application 3: Posterior Probabilities Conclusions Posterior Probability 0.6 RJMCMC: hard to design efficient jump mechanism 0.5 Using IS results still possible 0.4 0.3 0.2 ● ● 1 P. Touloupou et al. 2 Model 3 Evidence for transmission between pens sharing a waterer rather than another boundary Bayesian Model Selection For Partially Observed Epidemic Models 30 / 33 Motivation Outline Methods 1 Motivation 3 Simulation Studies 2 4 5 Simulation Studies Real Data Analysis Conclusions Methods Real Data Analysis Conclusions P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models April 21, 2016 Motivation Methods Simulation Studies Concluding Remarks Real Data Analysis Conclusions Show how IS can be used to test epidemiological questions of interest In this study the importance sampling estimator outperformed existing tools ã Smallest Monte Carlo error Importance sampling approach very easy to implement and trivially parallelisable Bayes factors depend on choice of prior ã Simulations needed to avoid Lindley’s paradox P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 31 / 33 Motivation Methods Simulation Studies Variations/Extensions Real Data Analysis Conclusions When the full conditional is not available we use a related full conditional ã IS corrects for not using the true full conditional My collaborator Peter Neal used the particle filtering to estimate π(x|θ) We recently applied Bridge Sampling for estimating the marginal likelihood ã IS a special case ã Slightly reduced variances ã We use IS due to ease of implementation P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 32 / 33 Motivation Methods Simulation Studies Thanks for Listening! P. Touloupou et al. Real Data Analysis Bayesian Model Selection For Partially Observed Epidemic Models Conclusions April 21, 2015 Appendix Results - Posterior summaries of model parameters Parameter External transmission probability Symbol 1 − e−α Internal transmission probability 1 − e−β Shape parameter κ Mean period of infection Initial probability of infection Sensitivity of RAJ test Sensitivity of faecal test m µ θR θF Geometric 0.0090 [0.0064, 0.0117] 0.0107 [0.0077, 0.0141] 8.9942 [7.7460, 10.4369] —– 0.1001 [0.0568, 0.1545] 0.7750 [0.7304, 0.8156] 0.4639 [0.4206, 0.5073] Negative Binomial 0.0081 [0.0057, 0.0109] 0.0102 [0.0073, 0.0137] 9.9740 [7.1977, 10.6487] 1.6245 [0.8361, 2.8972] 0.0997 [0.0557, 0.1546] 0.7771 [0.7311, 0.8203] 0.4657 [0.4213, 0.5097] Posterior mean of the parameters of each model along with the 95% credible interval in brackets. Motivation Methods Parameter Estimation Simulation Studies 0.025 Conclusions 0.025 North South 0.020 Within Pen Rate 0.020 Within Pen Rate Real Data Analysis 0.015 0.010 0.005 0.015 0.010 0.005 0.000 0.000 0.000 0.005 0.010 0.015 0.020 External Rate (d) Model 2 - Posterior Prob 0.77 P. Touloupou et al. 0.000 0.005 0.010 0.015 0.020 External Rate (e) Model 4 - Posterior Prob 0.16 Bayesian Model Selection For Partially Observed Epidemic Models 34 / 33 Motivation Methods Parameter Estimation Simulation Studies 0.025 Conclusions 0.025 North South North South 0.020 Within Pen Rate 0.020 Within Pen Rate Real Data Analysis 0.015 0.010 0.005 0.015 0.010 0.005 0.000 0.000 0.000 0.005 0.010 0.015 0.020 External Rate (f) Model 1 - Posterior Prob 0.06 P. Touloupou et al. 0.000 0.005 0.010 0.015 0.020 External Rate (g) Model 3 - Posterior Prob 0.01 Bayesian Model Selection For Partially Observed Epidemic Models 34 / 33 Motivation Methods Simulation Studies Real Data Analysis The Choice of Prior Matters! Conclusions Simulation study: Heterogeneity in Transmission Rates Among Pens Prior of Transmission Rates Gamma(0.1,0.1) Data generated from Model 2 Gamma(1,1) Gamma(1,100) Data generated from Model 4 Posterior Probability 1.00 0.75 0.50 0.25 0.00 1 2 3 4 1 2 3 4 Model P. Touloupou et al. Bayesian Model Selection For Partially Observed Epidemic Models 34 / 33