Generative Modeling of Clinical Time Series via Latent Stochastic Differential Equations

Muhammad Aslanimoghanloo, Ahmed ElGazzar, Marcel van Gerven · DOI

Abstract

Clinical time series data, such as those found in Electronic Health Records (EHR) and Intensive Care Unit (ICU) monitors, are characterized by irregular sampling, missing values, and inherent biological stochasticity. While Neural Ordinary Differential Equations (ODEs) provide a continuous-time framework for such data, their deterministic nature limits their ability to quantify uncertainty. This paper proposes a generative framework using Latent Stochastic Differential Equations (SDEs) to model patient health trajectories. By incorporating both drift (deterministic trend) and diffusion (stochastic noise), the model provides superior forecasting accuracy and well-calibrated uncertainty estimates. Evaluations on synthetic lung cancer data and real-world ICU datasets demonstrate that Latent SDEs outperform traditional LSTMs and Neural ODEs, particularly in sparse data regimes.

Introduction

The "messy" reality of clinical data presents significant challenges for standard machine learning models. Vital signs and laboratory measurements are often recorded at irregular intervals, and many entries are missing. Furthermore, biological systems are inherently random; two patients in identical initial states may follow different clinical paths due to unobserved physiological factors.

Existing approaches have notable limitations. Recurrent Neural Networks (RNNs) and LSTMs operate on discrete time steps, requiring complex preprocessing like padding or resampling to handle irregular intervals. Neural ODEs solve the timing issue by modeling dynamics continuously but are deterministic, assuming a fixed future trajectory given an initial state. There is a critical need for models that are both continuous-time and probabilistic to capture the uncertainty essential for clinical decision-making.

Methods

The proposed Latent SDE framework utilizes a variational encoder-decoder architecture to map observed clinical data into a latent space where dynamics are governed by stochastic processes.

Architecture of the Latent SDE framework for clinical time series modeling.

Architecture Components

  1. Encoders: The model employs two encoders. The first maps discrete observations and static patient covariates (e.g., age, weight) into the latent space. The second transforms external treatment sequences (e.g., medication schedules) into a continuous-time control signal, $\hat{u}(t)$.
  2. Latent Dynamics: The core of the model is a "Generative SDE" defined by:
  3. Drift: Represents the deterministic evolution of the disease or recovery process.
  4. Diffusion: Captures the stochasticity or inherent variability within the biological system.
  5. Variational Inference: Since the exact likelihood of random paths is intractable, the authors use an "Augmented SDE" to approximate the posterior distribution. This is optimized using an Evidence Lower Bound (ELBO) and Girsanov’s theorem to manage the change of measure between the generative and augmented processes.
  6. Decoder: The decoder projects the latent states back into the original data space to produce reconstructions of observed data and forecasts for future time points.

Experimental Setup

The framework was validated across two distinct scenarios:

  • Synthetic PKPD Model: A simulated lung cancer Pharmacokinetic-Pharmacodynamic model was used to test the model's ability to recover unobserved latent variables (e.g., tumor volume) from noisy observations (e.g., cell counts).
  • PhysioNet 2012 (ICU Data): A real-world dataset comprising 12,000 ICU stays. The model was tasked with forecasting Heart Rate (HR), Mean Arterial Pressure (MAP), and Body Temperature (BT).

Results and Discussion

The Latent SDE consistently outperformed baseline models across multiple metrics, including Continuous Ranked Probability Score (CRPS) and Negative Log-Likelihood (NLL).

Key Findings

  • Superior Forecasting: On synthetic data, the Latent SDE achieved an NLL of 0.08, significantly better than Neural ODEs (0.11) and LSTMs (0.13). In the ICU dataset, it showed marked improvements in forecasting HR and BT.
  • Robustness to Sparsity: Stress tests revealed that the Latent SDE remains stable even when 80% of the data is removed. In contrast, the performance of discrete-time LSTMs degrades sharply under high sparsity.
  • Uncertainty Quantification: By modeling the diffusion term, the Latent SDE provides a distribution of possible futures. This calibrated uncertainty is vital for clinicians to distinguish between high-confidence predictions and cases requiring more data.

Limitations

Despite its advantages, the Latent SDE framework has limitations. Training SDEs is computationally intensive compared to ODEs or standard neural networks. Additionally, the model currently relies on a Markovian assumption, which may not capture long-term dependencies in certain chronic conditions. Future work may involve integrating expert-designed medical ODEs into the neural framework to enhance interpretability and scaling the model to longer-term outpatient monitoring.

Conclusion

Latent Stochastic Differential Equations offer a robust solution for modeling the continuous and probabilistic nature of clinical time series. By effectively handling irregular sampling and providing reliable uncertainty estimates, this framework represents a significant step toward more reliable predictive tools in medicine.

Summary updated

BibTeX
@article{aslanimoghanloo2026generative,
  author = {Muhammad Aslanimoghanloo and Ahmed ElGazzar and Marcel van Gerven},
  title = {{Generative Modeling of Clinical Time Series via Latent Stochastic Differential Equations}},
  journal = {J. Biomed. Informatics},
  year = {2026},
  doi = {10.1016/j.jbi.2026.105043},
}
Figure