Learning Dynamics from Input-Output Data with Hamiltonian Gaussian Processes

Jan-Hendrik Ewering, Robin E. Herrmann, Niklas Wahlström, Thomas B. Schön, Thomas Seel

Abstract

Embedding non-restrictive prior knowledge, such as energy conservation laws, in learning-based approaches is a key motive to construct physically consistent models from limited data, relevant for, e.g., model-based control. Recent work incorporates Hamiltonian dynamics into Gaussian Process (GP) regression to obtain uncertainty-quantifying models that adhere to the underlying physical principles. However, these works rely on velocity or momentum data, which is rarely available in practice. In this paper, we consider dynamics learning with non-conservative Hamiltonian GPs, and address the more realistic problem setting of learning from input-output data. We provide a fully Bayesian scheme for estimating probability densities of unknown hidden states, of GP hyperparameters, as well as of structural hyperparameters, such as damping coefficients. Considering the computational complexity of GPs, we take advantage of a reduced-rank GP approximation and leverage its properties for computationally efficient prediction and training. The proposed method is evaluated in a nonlinear simulation case study and compared to a state-of-the-art approach that relies on momentum measurements.

Introduction: Bridging the Gap in Physics-Informed Learning

In model-based control and robotics, the goal is to develop models that are both data-efficient and physically consistent. Physics-informed machine learning, particularly Hamiltonian Gaussian Processes (GPs), has emerged as a powerful framework by embedding energy-based inductive biases directly into probabilistic models. However, a significant practical hurdle remains: most existing Hamiltonian GP methods require measurements of the full system state, including velocities or momenta.

In real-world applications, we often only have access to noisy "output" data, such as position measurements from a GPS or encoder, while "hidden" states like momentum remain unobserved. This research addresses this gap, enabling the training of physics-constrained models using only available input-output data.

Comparison of the proposed method with existing Hamiltonian GP approaches. The proposed framework is uniquely capable of handling exogenous inputs and dissipative systems while requiring only position data ($q$) for training.

Methodology

The proposed framework integrates three core components to enable learning from incomplete state data:

  1. Non-Conservative Hamiltonian Dynamics: The system is modeled using a state-space formulation that accounts for energy storage (the Hamiltonian), energy dissipation (damping), and external control forces (exogenous inputs).
  2. Reduced-Rank Gaussian Processes: Standard GPs suffer from $O(T^3)$ scaling. By employing a reduced-rank approximation—representing the GP through a finite set of basis functions (eigenfunctions of the Laplace operator)—the model becomes linear in its parameters. This reduces computational complexity to $O(M)$, where $M$ is the number of basis functions, facilitating efficient training and prediction.
  3. Fully Bayesian Inference via PMCMC: To handle unknown states (momentum) and parameters (damping, GP hyperparameters), the authors utilize a Particle Gibbs sampler. This Particle Markov Chain Monte Carlo (PMCMC) scheme alternates between estimating hidden state trajectories using Sequential Monte Carlo (particle filtering) and updating model parameters via Bayesian updates or Metropolis-Hastings steps.

Experimental Evaluation: The Non-Harmonic Oscillator

The method's efficacy is demonstrated through a simulation of a non-harmonic oscillator. This nonlinear system is governed by the Hamiltonian $H(q, p) = \frac{q^2}{2} + \frac{p^2}{2} + 2\cos(q)$, where $q$ represents position and $p$ represents momentum.

The non-harmonic oscillator system (left) and its corresponding Hamiltonian energy landscape $H(x)$ (right). The study focuses on learning this dynamics from noisy position measurements alone.

The model was trained on a single trajectory of 1,000 time steps. In the primary "Input-Output" experiment, only noisy position measurements ($y = q + e$) were provided, leaving the momentum $p$ entirely hidden. The results were compared against "Input-State" baselines (where $p$ is known) and exact Hamiltonian GP models.

Key Insights and Results

  • Identifiability and Symmetry: A critical challenge in learning from output data is distinguishing between different energy landscapes that produce similar position trajectories. The authors found that imposing an anti-symmetry constraint on the Hamiltonian ($H(x) = -H(-x)$) significantly improved the model's ability to learn from limited data.
  • State Reconstruction and Accuracy: Despite the lack of momentum measurements, the proposed method achieved a flow magnitude RMSE of 3.19 J, nearly matching the 3.08 J achieved with full state access. The PMCMC scheme successfully reconstructed the hidden momentum states, with smoothing estimates closely tracking the true trajectory.
  • Structural Uncertainty: Unlike frequentist methods that provide point estimates, this Bayesian approach yields full probability densities for damping and noise parameters, offering a clear measure of model confidence in the system's physical properties.

Conclusion and Future Directions

While the reduced-rank GP approach offers significant computational advantages, its complexity grows with the dimensionality of the state space, potentially limiting its application to systems with many degrees of freedom. Future work will explore learning in systems without known structural symmetries and validating the framework on physical hardware subject to non-Gaussian noise and complex friction effects.

Summary updated

Abstract

Embedding non-restrictive prior knowledge, such as energy conservation laws, in learning-based approaches is a key motive to construct physically consistent models from limited data, relevant for, e.g., model-based control. Recent work incorporates Hamiltonian dynamics into Gaussian Process (GP) regression to obtain uncertainty-quantifying models that adhere to the underlying physical principles. However, these works rely on velocity or momentum data, which is rarely available in practice. In this paper, we consider dynamics learning with non-conservative Hamiltonian GPs, and address the more realistic problem setting of learning from input-output data. We provide a fully Bayesian scheme for estimating probability densities of unknown hidden states, of GP hyperparameters, as well as of structural hyperparameters, such as damping coefficients. Considering the computational complexity of GPs, we take advantage of a reduced-rank GP approximation and leverage its properties for computationally efficient prediction and training. The proposed method is evaluated in a nonlinear simulation case study and compared to a state-of-the-art approach that relies on momentum measurements.
BibTeX
@misc{ewering2025learning,
  author = {Jan-Hendrik Ewering and Robin E. Herrmann and Niklas Wahlström and Thomas B. Schön and Thomas Seel},
  title = {{Learning Dynamics from Input-Output Data with Hamiltonian Gaussian Processes}},
  year = {2025},
  eprint = {2511.05330},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.05330},
}
Figure