Skip to main content

ODE Filters

PyPI Python CI Docs Coverage

A JAX-based implementation of probabilistic ODE solvers using Gaussian filtering and smoothing. This package provides tools for solving ordinary differential equations while quantifying uncertainty through Bayesian inference.

Features

  • Pure JAX implementation - Fully differentiable and JIT-compilable
  • Square-root filtering - Numerically stable EKF and RTS smoothing
  • Flexible priors - Integrated Wiener Process (IWP), Matern, and joint priors
  • First and second-order ODEs - Native support for both ODE types
  • Constraint handling - Conservation laws and time-varying measurements
  • State-parameter estimation - Joint inference with hidden states
  • Black-box measurements - Custom observation models with autodiff Jacobians
  • Transformed measurements - Nonlinear state transformations with chain-rule Jacobians
  • Pluggable linearization - EK0 / EK1 / IEKF corrections, selectable per solve
  • Adaptive step sizes - jit/vmap/grad-safe adaptive solving, with optional fixed-point smoothing
  • Parameter estimation - Differentiable marginal likelihood with an Optax-friendly fit API

Installation

Install the latest release from PyPI:

pip install ode-filters

Or install from source with development dependencies:

git clone https://github.com/paufisch/ode_filters.git
cd ode_filters
pip install -e ".[dev]"

Quick Example

import jax.numpy as np
from ode_filters import (
    IWP,
    ODEInformation,
    gaussian_filter,
    rts_smoother,
    taylor_mode_initialization,
)

# Define ODE: dx/dt = -x (exponential decay)
def vf(x, *, t):
    return -x

x0 = np.array([1.0])
tspan = (0.0, 5.0)  # a tuple: hashable for use as a jax.jit static argument

# Set up the prior and the ODE-information measurement model
prior = IWP(q=2, d=1, Xi=0.5 * np.eye(1))
mu_0, Sigma_0_sqr = taylor_mode_initialization(vf, x0, q=2)
measure = ODEInformation(vf, prior.E0, prior.E1)

# Filter on a fixed grid, then smooth
result = gaussian_filter(mu_0, Sigma_0_sqr, prior, measure, tspan, N=50)
m_smooth, P_smooth_sqr = rts_smoother(prior, result)

# result.m / result.P_sqr -> filtered means / square-root covariances at the grid
# result.log_likelihood   -> calibrated marginal log-likelihood

For adaptive step sizes, use gaussian_filter_adaptive(mu_0, Sigma_0_sqr, prior, measure, save_at=...) — it is jit / vmap / grad-safe; pass smoother=True to also get a fixed-point smoothing pass that rts_smoother consumes.

Package Structure

ode_filters/
├── filters/          # EKF and RTS smoothing loops
├── inference/        # Square-root Gaussian algebra
├── measurement/      # ODE and observation models
└── priors/           # Gaussian Markov process priors

Documentation

Full documentation is available at paufisch.github.io/ode_filters.

Development

Run the test suite:

uv run pytest --cov=ode_filters --cov-report=term-missing

Build documentation locally:

uv run mkdocs serve

License

MIT License - see LICENSE for details.

Metadata

Release files for ode-filters 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ode-filters 0.7.2
File Size Uploaded Provenance Actions
ode_filters-0.7.2.tar.gz 348.4 kB Without provenance Details for ode_filters-0.7.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ode-filters 0.7.2
File Interpreter ABI Platform Actions
ode_filters-0.7.2-py3-none-any.whl Python 3 none any Details for ode_filters-0.7.2-py3-none-any.whl

Total release size: 437.1 kB

Release files / ode_filters-0.7.2.tar.gz

Download URL ode_filters-0.7.2.tar.gz
Size 348.4 kB
Tags Source
SHA-256 checksum
How to use checksums
93ffb6340a8caf9b3ffe941da5498edfde565825cd74d7b2f5df40098a16292b
BLAKE2b-256 checksum
How to use checksums
12b3f53273a662d486441060d950d3c689812f82045d04d819ad3547f1769cd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ode_filters-0.7.2-py3-none-any.whl

Download URL ode_filters-0.7.2-py3-none-any.whl
Size 88.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82915cbe1cef3ada00691bb9c8165c8446bf39b71eb29cc92510736fc781e155
BLAKE2b-256 checksum
How to use checksums
5774e08e0680403ec4921e33eea3ba057fcf39517cdbd925c986f2f0833a5e59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for ode-filters 0.7.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page