← All research

Emory NSF REU

Structured MAGI with Warm Starts for Partially Observed Bayesian ODE Inverse Problems

Tianshi Xu, Mingke Tian, Yuanzhe Xi

Estimating the parameters of an ODE from noisy data is hard when some components are never observed. MAGI solves the inverse problem without numerical integration, but its sampler is slow to find good regions from a cold start. Structured MAGI adds two stages that hand MAGI a strong starting point: multi-task GP smoothing, then a physics-informed network.

The PINN-in-MAGI framework: (1) multi-task GP smoothing of noisy, partial observations; (2) a physics-informed network that estimates parameters and trajectories; (3) MAGI joint posterior sampling initialized from those estimates.
Figure 1. The PINN-in-MAGI framework: (1) multi-task GP smoothing of noisy, partial observations; (2) a physics-informed network that estimates parameters and trajectories; (3) MAGI joint posterior sampling initialized from those estimates.

1Problem setup

The system follows an ODE with unknown parameters, and only some components are observed, at their own times and with noise:

\[\begin{gathered}\dot{\mathbf{X}}(t)=\mathbf{f}\big(\mathbf{X}(t),\boldsymbol{\theta},t\big),\\ Y_d(\tau_{d,j})=X_d(\tau_{d,j})+\epsilon_{d,j},\qquad \epsilon_{d,j}\sim\mathcal{N}(0,\sigma_d^2)\end{gathered}\]

where

\(\mathbf{X}(t)\)
the system state, for example the S, I, R, W compartments of an epidemic model
\(\boldsymbol{\theta}\)
the unknown parameters
\(Y_d(\tau_{d,j})\)
the \(j\)-th observation of component \(d\)
\(\sigma_d\)
the noise level of component \(d\)

The goal is the joint posterior of \(\boldsymbol{\theta}\) and the full trajectory \(\mathbf{X}\), including the unobserved components.

2Stage 1: multi-task Gaussian process smoothing

\[\hat{\mathbf{X}}(t_i):=\mathbb{E}_{\text{MTGP}}\big[\mathbf{f}(t_i)\mid\mathcal{Y}\big],\qquad \mathbb{V}\big[\mathbf{f}(t_i)\mid\mathcal{Y}\big]=\Sigma_{\text{MTGP}}(t_i)\]

where

\(\mathcal{Y}\)
all observations
\(\hat{\mathbf{X}}(t_i)\)
the denoised trajectory at grid time \(t_i\)
\(\Sigma_{\text{MTGP}}(t_i)\)
its posterior covariance

Sharing information across components lets the GP fill gaps in one compartment using the others. The variance tells the next stage how much to trust each point.

3Stage 2: physics-informed network

\[\begin{aligned}\mathcal{L}_{\text{PINN}}(\phi,\boldsymbol{\theta})=\;&\lambda_{\text{data}}\sum_{d\in\mathcal{D}_{\text{obs}}}\sum_{i=1}^{M}w_d(t_i)\big\|g_d(t_i;\phi)-\hat{X}_d(t_i)\big\|^2\\ &+\lambda_{\text{ODE}}\sum_{d=1}^{D}\sum_{i=1}^{M}\big\|\mathcal{R}_d(t_i;\phi,\boldsymbol{\theta})\big\|^2+\lambda_{\text{norm}}\sum_{i=1}^{M}\Big(\sum_{d\in\mathcal{L}}g_d(t_i;\phi)-1\Big)^2\end{aligned}\]

where

\(g_d(\cdot;\phi)\)
the network's estimate of component \(d\)
\(w_d(t_i)\)
weights from the GP uncertainty
\(\mathcal{R}_d=\dot g_d-f_d(g,\boldsymbol{\theta},t)\)
the ODE residual
\(\mathcal{L}\)
the compartments that must sum to one
\(\lambda_{\text{data}},\lambda_{\text{ODE}},\lambda_{\text{norm}}\)
term weights

The network is trained on data alone first, then jointly on denoised data, then jointly on the noisy observations, giving parameter and trajectory estimates that respect the dynamics.

4Stage 3: MAGI joint posterior, warm-started

\[\begin{aligned}p\big(\boldsymbol{\theta},\mathbf{X}\mid\mathbf{Y},W_{\mathcal{T}}=0\big)\;&\propto\;\pi_\Theta(\boldsymbol{\theta})\cdot p\big(\mathbf{X}(\mathcal{T})\big)\cdot p(\mathbf{Y}\mid\mathbf{X})\cdot p\big(W_{\mathcal{T}}=0\mid\mathbf{X},\boldsymbol{\theta}\big),\\ W_{\mathcal{T}}\;&=\;\max_{t\in\mathcal{T},\,d}\big|\dot{X}_d(t)-f_d(\mathbf{X}(t),\boldsymbol{\theta},t)\big|\end{aligned}\]

where

\(\pi_\Theta\)
the parameter prior
\(p(\mathbf{X}(\mathcal{T}))\)
a GP prior \(\mathbf{f}(x)\sim\mathcal{GP}(\mathbf{0},K((x,d),(x',d')))\) on a discretization \(\mathcal{T}\)
\(p(\mathbf{Y}\mid\mathbf{X})\)
the Gaussian likelihood \(\mathcal{N}(x_d,\sigma_d^2 I)\)
\(W_{\mathcal{T}}=0\)
the manifold constraint that ties the trajectory to the ODE

The PINN's estimates initialize \(\mathbf{X}\), \(\boldsymbol{\theta}\), and \(\sigma\) for Hamiltonian Monte Carlo, which then returns parameter and trajectory estimates with uncertainty.

5Conclusion

Smoothing and physics-informed estimation are cheap, and MAGI's sampling is principled. Chaining them gives MAGI a starting point near the posterior mode, so it keeps full Bayesian uncertainty while spending its effort where the posterior actually is.

Key references

  1. S. Yang, S. W. K. Wong, and S. C. Kou. Inference of Dynamic Systems from Noisy and Sparse Data via Manifold-Constrained Gaussian Processes. PNAS 118(15), 2021.
  2. M. Raissi, P. Perdikaris, and G. E. Karniadakis. Physics-Informed Neural Networks. Journal of Computational Physics 378, 2019.
  3. E. V. Bonilla, K. M. A. Chai, and C. K. I. Williams. Multi-task Gaussian Process Prediction. NeurIPS, 2007.
  4. R. M. Neal. MCMC Using Hamiltonian Dynamics. Handbook of Markov Chain Monte Carlo, 2011.