Skip to content

SPIN: Stochastic Process INference

SPIN is a Python package for the non-parametric Bayesian inference of the parameter functions of autonomous diffusion processes. It can be used to infer the drift function \(\mathbf{b}: \Omega\to\mathbb{R}^d\) and (squared) diffusion function \(\mathbf{\Sigma}:\Omega\to\mathbb{R}^{d\times d}\) from trajectory data of an underlying process \(\mathbf{X}_t\) on a domain \(\Omega\subset\mathbb{R}^d\), indexed over \(t\in\mathbb{R}_+\),

\[ d\mathbf{X}_t = \mathbf{b}(\mathbf{X}_t) dt + \sqrt{\mathbf{\Sigma}(\mathbf{X}_t)} d\mathbf{W}_t,\quad \mathbf{X}(t=0)=\mathbf{X}_0\ a.s. \]

Under the hood, SPIN employs a PDE-based inference method, based on the Kolmogorov equations governing the stochastic process under consideration. For more information on the underlying theory, we refer to the accompanying publication,

Key Features

  Non-parametric inference of drift and diffusion functions
  Works with stationary and time-dependent trajectory data
  PDE computations based on the finite element method
  Evaluation of the maximum a-posteriori estimate and Laplace approximation
  Generic and robust implementation, based on hIPPYlib and FEniCS

Installation and Development

SPIN depends on a mixture of pip and conda dependencies, which can be efficiently managed using Pixi. To set up a virtual environment in which SPIN can be run, simply execute in the project root directory:

pixi install

Documentation

A walk-through for solving a simple inference problem with SPIN is given in the Tutorial. We further provide runnable examples for different use-cases in our Github repository. For more information regarding the implementation of SPIN, we refer to the API reference.