Sample the Contacts, Integrate the Compartments

Epidemic forecasters face two moving targets. The disease model itself may be too simple, for example lacking an incubation stage or a hospital stage. The contact pattern that spreads the disease also shifts when schools close or people avoid crowds. Today each problem is handled separately. Either one adds compartments and loses identifiability, or one freezes the contact graph into a static approximation, or one hands both problems to a neural network that has no notion of conserved population.

This proposal handles both inside one probabilistic filter. The filter is a Rao-Blackwellized particle filter: a sequential Monte Carlo method that uses random samples ("particles") only for the few variables that are genuinely nonlinear and tracks every other variable exactly with a Kalman filter attached to each particle. Two kinds of quantity are sampled: the low-dimensional controls of the epidemic, meaning the transmission rate and a handful of weights saying how much each contact layer (household, school, work, travel) is currently in use; and the per-region susceptible counts. Given those, the counts of exposed and infectious people in every region evolve linearly, so they are integrated out exactly.

The payoff is specific. The contact graph adapts online through sampled layer weights. Extra latent stages add dimensions only to the exactly tracked part, so they should cost no additional particles. The filter also produces a low-variance marginal likelihood at every step, which lets it choose, while the outbreak unfolds, which level of compartment detail the data actually supports.

Core Claim

A metapopulation SEIR-type model on a re-weighted multi-layer contact graph falls inside the conditionally linear-Gaussian class formalized by The marginalized particle filter – analysis, applications and generalizations. That paper splits the state into a sampled nonlinear block and a Kalman-tracked linear block, and allows the nonlinear block's transition to depend linearly on the linear block. To set this up, write $\theta_t$ for the sampled controls: the log transmission rate $\log\beta_t$, the layer weights $w_{k,t}$, and the reporting fraction. Write $S_t$ for the vector of susceptible counts per region and $z_t=[E_t; I_t]$ for the stacked exposed and infectious counts per region. With fixed layer adjacency matrices $A_k$, the contact graph and the infection dynamics are

$$A_t=\sum_{k} w_{k,t}A_k,\qquad z_{t+1}=F(\theta_t,S_t)\,z_t+v_t,\qquad y_t=H(\theta_t)\,z_t+e_t .$$

Here $F$ contains the terms $\beta_t\,\mathrm{diag}(S_t/N)A_t$, the incubation rate and the recovery rate. $y_t$ is the vector of reported cases. $v_t$ and $e_t$ are Gaussian noises: $v_t$ is the large-population approximation of demographic randomness, and $e_t$ is a variance-scaled approximation of count noise. The susceptible update $S_{t+1}=S_t-\beta_t\,\mathrm{diag}(S_t/N)A_tI_t$ is linear in $I_t$ given $S_t$. It therefore acts as an extra measurement for each particle's Kalman filter, exactly as in Schön et al.'s general case.

The claim has three parts. First, compartments that enter linearly add no Monte Carlo variance, so the forecast skill of the filter should not degrade as stages are added, while a plain particle filter does degrade. Second, the sampled layer weights track behavioral shifts that static graph approximations cannot follow. Third, the exact conditional likelihoods support online selection among model structures.

Relation to Prior Work

The method comes from The marginalized particle filter – analysis, applications and generalizations and from the partial-marginalization principle in An Introduction to MCMC for Machine Learning. The structural analogy is FastSLAM (Bayesian Map Learning in Dynamic Environments). There, a low-dimensional robot pose is sampled and a high-dimensional map becomes tractable given that pose. Here the layer weights play the role of the pose and the regional infection state plays the role of the map. This construction has been applied to navigation and mapping, never to coupled epidemic dynamics on graphs.

The closest epidemic work uses Gaussian data assimilation, not marginalized particle filtering.

  • Predictability in process-based ensemble forecast of influenza runs an ensemble adjustment Kalman filter on a humidity-forced SIRS model for 95 US cities. It has no contact graph, and it reports that assimilation cannot rescue a misspecified model. That finding motivates our online structure selection.
  • Real-time updating of dynamic social networks for COVID-19 vaccination strategies reconstructs a dynamic contact network with variational assimilation (3D-VAR/BLUE) under an SIR-plus-vaccinated model. The authors note that moving to SEIR is computationally hard. We differ by sampling a few layer weights rather than estimating the whole edge set, and by making the added compartments free in Monte Carlo variance.

The graph side constrains the design.

  • Static graph approximations of dynamic contact networks for epidemic forecasting shows that aggregating temporal contacts overestimates peak infection by 18.5%, and that the frequency-filtered EdgeMST graph cuts the error to 5.4%. Its approximation is frozen, and it assumes past contact frequencies persist.
  • DynaSTy adapts to time-varying adjacency through attention bias, but costs quadratic time in the number of nodes and has no mass conservation.

We deliberately avoid learning edges. The layer decomposition is a strong simplification, and testing whether it is sufficient is part of the program.

The neural-mechanistic hybrids are the forecasting competitors.

  • HeatGNN learns time-varying SIR rates and a mechanistic affinity graph by gradient descent.
  • EpiDiff steers a diffusion forecaster with an SIR prior whose uncertainty comes from an unscented transform.

Neither maintains a recursive posterior, and both use plain SIR. Modeling COVID-19 Dynamics in German States Using Physics-Informed Neural Networks recovers time-varying transmission offline. It also shows that omitting latent or hospital stages shifts peak timing and amplitude, which is direct evidence that compartment detail matters.

Research Program

The filter. We will build the filter for metapopulation graphs of up to roughly 50 regions. Each particle carries $\theta_t$, which follows a random walk on log-transmission and on softmax-parameterized layer weights, together with $S_t$. Each particle also carries a Kalman mean and covariance for $z_t$.

Cost. The Riccati bottleneck that Schön et al. identify is real here. The covariance update depends on each particle's $\theta_t$, so the cost per particle is cubic in the number of regions times the number of stages. We will measure it with their equivalent-flop accounting rather than hide it. At around 50 regions with up to four stages this is a few-hundred-dimensional covariance, which is affordable for hundreds of particles.

Online structure selection. We will run filters for SIR, SEIR, SEIR with two or three Erlang latent stages, and SEIHR in parallel. Each produces exact conditional predictive likelihoods, so the posterior probability of each structure can be updated online. The analysis question is when and why the evidence shifts, for example around variant waves or vaccination onset.

Breaking-point study. The linear-Gaussian approximation of the infection block should hold for large regional populations. It should fail for small groups. We will map this boundary on individual-level contact data that has been coarsened into communities of varying size.

Baselines

The naive reference point has two parts. The first is a persistence forecast that repeats the last week's counts. The second is a deterministic SEIR model integrated on the static EdgeMST graph from Static graph approximations of dynamic contact networks for epidemic forecasting, with parameters fitted on the training window. This shows what a frozen graph and a frozen model achieve. On stationary contact data that paper reports a 5.4% peak-infected error for EdgeMST across seven networks. Beating it on stationary data is not required. Beating it after an injected behavioral shift is.

The strongest assimilation competitor is the ensemble adjustment Kalman filter of Predictability in process-based ensemble forecast of influenza. We will apply it to the identical graph SEIR state augmented with the layer weights and transmission rate. Its ensemble size will be set so that its equivalent-flop cost matches ours. Its inflation and localization will be tuned with the same validation budget as our particle count and random-walk scales. The file contains no forecast-accuracy number from that paper, so there is no reported result on Lacuna for EAKF on our benchmarks, and it will be reproduced. Beating it means a better log predictive score and better 90%-interval coverage at equal flops, especially in windows with regime changes.

The strongest point forecaster is EpiDiff. It reports a 7-day RMSE of 188 on covid-JP, against 222 for STAN. We will use the same prefecture data and the same horizon, and run EpiDiff's released configuration if available, otherwise a reimplementation under its reported settings. Our filter is mechanistic and uses far less training. We therefore treat an RMSE below 222 as competitive and below 188 as a clear win. We will also compare calibration, which EpiDiff addresses only through its prior's uncertainty. HeatGNN reports no per-horizon errors in the file, so there is no reported result on Lacuna for HeatGNN RMSE. It will be run as a secondary neural baseline.

Two ablations isolate the key ingredients.

  • Marginalization ablation. A bootstrap particle filter on the identical model, sampling $z_t$ as well, at equal flops. This tests whether exact integration of the infection block is what helps.
  • Graph-adaptation ablation. Our filter with layer weights frozen at their training-window values. This tests whether the adaptive graph is what helps.

Why not just…?

Why not just run an ensemble Kalman filter on the whole state? This is the most serious threat. On smooth, high-count regional data a well-tuned EAKF may match us, because the infection block is nearly Gaussian anyway. Our advantage should appear only where the layer-weight or transmission posterior is skewed or multimodal, such as the weeks straddling a lockdown, or where counts are low. The equal-flop comparison, split into regime-change and stationary windows, settles this. If EAKF ties everywhere, we will report that the marginalization buys nothing in practice. The online model-selection contribution would then stand alone, since EAKF likelihoods are less reliable for that purpose.

Why not just use a plain particle filter with more particles? Schön et al.'s analysis predicts that extra linear dimensions force the particle count up when they are sampled, but not when they are marginalized. The marginalization ablation tests this prediction directly by plotting effective sample size and log score against the number of latent stages at fixed flops. If the curves do not separate, the method's central rationale fails.

Why not just freeze the graph with EdgeMST and fit a richer ODE? On stationary contact data it will likely do as well as we do. Its own authors note that it assumes contact frequencies persist. The decisive test injects a known change in layer weights on synthetic multi-layer networks and on the Copenhagen Bluetooth network. The frozen-weight ablation then separates adaptation from everything else.

Why not just train a spatio-temporal graph network or EpiDiff? For 7-day point accuracy this may remain the better choice. We concede that point and compete on calibrated uncertainty, online updating without retraining, and interpretable estimates of layer weights and model structure. The PINN of Rothenbeck et al. is excluded as a main competitor because it is an offline batch fit. It serves only as a check on our filtered transmission trajectories for the 16 German states.

Proposed Experiments

Synthetic ground truth. We will use 1,000-node Barabási-Albert multi-layer networks following the setup of Real-time updating of dynamic social networks for COVID-19 vaccination strategies, coarsened into communities. We will simulate stochastic SEIR outbreaks with a mid-outbreak change in layer weights and a known number of latent stages. We will measure layer-weight recovery error, the posterior probability placed on the true structure, effective sample size, and log predictive score, across particle counts and community sizes. This experiment is the cleanest test of all three parts of the claim.

Real regional data. On covid-JP with 47 prefectures, the layers will be built from prefecture adjacency and population-gravity coupling. We will compare 7-day RMSE against EpiDiff's 188 and STAN's 222, and log score and coverage against EAKF. On the RKI archive for the 16 German states, we will compare filtered transmission trajectories with the PINN estimates. We will also check whether online structure selection moves toward vaccination or hospital compartments after vaccination begins, matching that paper's finding that vaccination uptake correlates with transmission.

Contact data with injected shifts. On the French high-school sensor network and the Copenhagen network, layers will be derived from contact timing. We will inject shifts and measure peak-infected error against EdgeMST.

What would falsify the proposal. Any one of three outcomes would count against it, and we will report whichever occurs:

  • no flop-matched gain over the bootstrap filter as stages are added;
  • no gain from adaptive weights after a known shift;
  • online structure selection that does not recover the true structure on synthetic data.