Reanalyzing Epidemics with Soft Physics: Trajectory-Wide Fitting of Mobility-Driven Metapopulation Models

When an epidemic is over, or even a few months in, public health agencies want a reanalysis: a best reconstruction of how many people were actually infected in each region on each day, and how strongly contact, as measured by phone mobility data, drove transmission at each point. Most current tools build this reconstruction forward in time. Ensemble Kalman filters, particle filters and forward-rolling neural networks update today's estimate from yesterday's. When case reports are delayed, dumped in backlogs, dip on weekends, or reflect a testing rate that swung from 17% to 70% within a year, those forward errors pile up. We propose to fit the whole epidemic history at once. A single optimization over every region and every day trades off two goals: matching noisy reports through a heavy-tailed loss, and approximately obeying a mobility-driven compartmental model, meaning a model that tracks how many people are susceptible, exposed, infectious and removed.

The obvious version of this idea, "apply batch trajectory optimization to an epidemic model," runs into a known contradiction. The link between mobility and transmission is not fixed. In Austin, the same volume of movement produced 62% less transmission in February 2021 than in March 2020 (Real-time pandemic surveillance using hospital admissions and mobility data). A trajectory optimizer that applies one time-invariant physics penalty would smear real behavioral shifts across the whole timeline. Our central design choice is to stop treating the model's mismatch as nuisance. We break it into an explicit, per-region "coupling" between mobility and transmission. That coupling is allowed to drift slowly, as people adopt masks and ventilation, and to jump at policy changes. Its estimated path becomes the scientific output: a map of when and where mobility stopped being a good proxy for contact.

Core Claim

Our claim is that soft-adherence trajectory optimization, with model mismatch routed into a structured, interpretable coupling term, does two things better than the alternatives. It reconstructs latent epidemic states in many-region metapopulation models more accurately under realistic reporting noise than sequential filters do. It also scales to tens or hundreds of coupled regions, where full Bayesian sampling and particle smoothing become impractical. A better reconstruction of the current state should in turn yield better short-term forecasts.

The method comes from Runge-Kutta Denoising (Rudy et al.). That work recovers trajectories and parameters of chaotic systems of up to 40 dimensions under 100% noise, including time-correlated noise, constant offsets and heavy-tailed outliers. It does this by penalizing both the data misfit and the residual of a Runge-Kutta discretization of the governing equations. It assumes the equations are right. Epidemics are exactly the case where they are partly wrong, so the contribution here is how mismatch is modeled, not the solver itself.

Concretely, let $x_t$ stack the compartments of all regions on day $t$, let $M_t$ be the observed origin-to-destination mobility matrix, let $m_{i,t}$ be a mobility index for region $i$, and let $y_t$ be the reported cases, hospitalizations and deaths. Region $i$'s transmission rate is $\beta_{i,t} = c_{i,t}\, g(m_{i,t})$. Here $g$ is a fixed mobility-to-contact map and $c_{i,t}$ is the coupling. We solve

$$ \min_{x,\,c,\,\theta}\; \sum_t \rho\big(y_t - h_\theta(x_t)\big) + \lambda \sum_t \big\| x_{t+1} - \Phi_{RK4}(x_t;\, \beta_{\cdot,t}, M_t, \theta) \big\|^2 + \sum_i \Big( \alpha_1 \|D \log c_i\|_1 + \alpha_2 \|D^2 \log c_i\|_2^2 \Big). $$

In this objective, $\rho$ is a Student-t loss and $h_\theta$ maps states to reports. $h_\theta$ includes a day-of-week factor, a slowly varying ascertainment rate and reporting delays. $\Phi_{RK4}$ is one fourth-order Runge-Kutta step of the metapopulation SEIR model, and $D$ is the first-difference operator. The L1 term on first differences lets the coupling change abruptly at interventions. The squared second-difference term lets it drift smoothly through behavioral adaptation. Whatever the coupling cannot absorb stays in the soft physics residual, which we report as a diagnostic, not hide.

Research Program

The first piece is a differentiable metapopulation SEIR solver. It takes daily mobility matrices as inputs, following the spatial structure that Rapti et al. showed is necessary to catch resurgences, and separates within-region contact from between-region seeding as in Du et al.. The objective above is solved jointly over all states, couplings and static parameters with second-order methods that exploit its banded-in-time structure. Memory therefore grows linearly with horizon times number of regions.

A point estimate is not enough for public health use, where the Austin model's reported forecast coverage is the standard to meet. We therefore produce uncertainty by randomized maximum likelihood: we re-solve the problem under perturbed observations and priors and use the spread of solutions. We check this against particle methods on small systems where those are reliable.

Identifiability is a central risk. Coupling and ascertainment both scale reported cases, so case data alone cannot separate them. We address this by fitting cases jointly with hospitalizations or deaths, which have more stable ascertainment. We also run explicit tests on simulated data in which ascertainment changes while coupling stays fixed, and the reverse.

Jointly correcting corrupted mobility matrices from epidemic residuals is tempting, but with one epidemic per region it is likely unidentifiable. We treat it only as a secondary probe: estimating a single scale correction per data source.

Baselines

The naive reference point is a deterministic metapopulation model integrated forward from initial conditions, with static parameters fit by least squares on deaths. This is the hard-constraint approach of Rapti et al.. It isolates the value of letting states deviate from the equations at all. We beat it if the soft version recovers latent states markedly better in simulation and fits held-out report types better on real data. We also run two weaker spatial references from the same code base, isolated regions and a static gravity model. Rapti et al. already report that both fail at resurgences, so these mainly confirm our implementation reproduces that finding.

The strongest sequential competitor is ensemble Kalman filtering, as applied to stochastic SEIR across German counties (Sequential data assimilation of the stochastic SEIR epidemic model). We pair it with its non-causal counterpart, the ensemble Kalman smoother, and with iterated filtering plus particle smoothing as in the Austin study (Real-time pandemic surveillance using hospital admissions and mobility data). All three receive the same compartments, mobility inputs, observation model and time-varying coupling. We match ensemble sizes and particle counts to our wall-clock budget, with equal hyperparameter search. On reported numbers, the Austin model's 95% intervals covered 93.6%, 89.9% and 87.7% of observations at one, two and three weeks ahead. No reanalysis-error figure was found in the file for these filters, nor any RMSE for the German EnKF. Beating them means lower latent-state error in simulation together with calibrated coverage at least matching these levels.

The strongest learned forecaster is MepoGNN (Cao et al.), which feeds graph-neural-network-learned transmission rates through a metapopulation SIR model. On Japan's 47 prefectures it reports a 14-day-ahead RMSE of 253.2, against 766.1 for a pure mechanistic MetaSIR and 388.3 for ColaGNN. For Swiss cantons, the Hawkes-process model of Schwabe et al. reports an RMSE of 13.34. We forecast forward from our reconstructed final state on the same splits. Matching 253.2 with an interpretable mechanistic model would be a real result, and going below it would be the strong one.

Two ablations isolate our key ingredient. The first replaces the structured coupling with a single time-invariant physics penalty, which is the plain RKD transplant the decoupling paradox predicts will fail. The second replaces the Student-t loss with a squared loss, to measure how much of the gain comes from robustness to reporting outliers.

Why not just…?

Why not just use an ensemble Kalman smoother, which is already non-causal? This is the most serious threat. For roughly Gaussian noise and modest nonlinearity, a smoother may match us. Our expected advantage is specific to backlog dumps, weekend dips and drifting ascertainment. These are the "dirty noise" regimes where Rudy et al. show global soft-adherence beats Kalman-type estimators. The simulation sweep over noise types will show whether that advantage exists for epidemic models. If the smoother ties under Gaussian noise and loses only under dirty noise, we will say so plainly.

Why not just fit a Bayesian hierarchical model by sampling, as Mellan et al. did for Brazil? That model is already fit over the whole timeline, with mobility covariates and an autoregressive residual on transmission. It is conceptually close to our coupling term, so "non-causal" is not our novelty. The differences are mechanistic between-region coupling through daily mobility matrices, and scale. On Andalusia's 8 provinces, sampling is feasible, and we will run it head to head. If it matches us there, our claim narrows honestly to scalability at the 47-prefecture and larger scales, which we test by tracking sampler cost and convergence as the number of regions grows.

Why not just train a joint-trajectory diffusion model like ForcingDAS? Jia et al. unify filtering, smoothing and reanalysis with a learned prior over trajectories, cutting error 2x to 7x relative to 3D-Var on ERA5. That prior is learned from decades of weather trajectories. An epidemic gives one realization per region, so a learned trajectory prior would mostly memorize. A mechanistic soft penalty supplies the prior without training data. We use only the idea of conditioning on future observations, not the diffusion machinery.

Why not just let a neural network learn transmission from mobility, as MepoGNN does? MepoGNN rolls forward, and its learned rates do not give an auditable account of when mobility stopped explaining transmission. The direct comparison on Japan's 14-day RMSE settles forecasting skill. Interpretability of the coupling path is a separate contribution that MepoGNN does not attempt.

Proposed Experiments

The first test is controlled simulation. We generate metapopulation SEIR epidemics on real mobility matrices: MITMA for Andalusia, Swisscom intercantonal flows, and Japan's prefectural GPS flows. Each run has a known coupling path with an injected 60% decline and abrupt intervention drops, chosen to mimic the observed Austin decoupling. We then corrupt reports with day-of-week factors, delays, backlog spikes, Student-t outliers and drifting ascertainment. Metrics are error on the unobserved exposed and infectious compartments, error on the coupling path, timing error of detected change points, and interval coverage, all compared against every baseline. The decisive check comes from the ablation with a time-invariant penalty: our structured coupling should beat it clearly whenever coupling drifts, and the two should be indistinguishable when it does not.

The second test uses real data. On Japan's 47 prefectures we reproduce MepoGNN's split and report 14-day RMSE against 253.2. On Swiss cantons we report RMSE against M2H's 13.34. On Andalusia we compare reanalysis against hierarchical sampling. For Austin we repeat the single-region analysis to check whether our estimated coupling recovers the reported 62% decline without being told about it. As held-out validation we fit on cases and forecast hospitalizations or deaths, and the reverse, so that the reconstruction is checked against an independent data stream.

The third test measures scaling: wall-clock time and memory as horizon and number of regions grow, against particle smoothing and sampling. This determines whether the practical case for the method holds.