Probabilistic numerics: solvers that report their own error
Design · BayesCG, Bayesian quadrature, ODE filters, Bayesian optimisation and probabilistic finite differences, each in the repository that owns its classical method
1 Dec 2026 · draft for review
Status: the homes and the two moves were agreed in review on 1 Dec 2026; the questions at the end are open.
Repositories: gaussx (BayesCG, linear conditioning, the ODE filter’s prior), integrix (measures, kernel means, Bayesian quadrature, the ODE filter), argminax (Bayesian optimisation), gridax (probabilistic finite differences), filterax (the ODE-parameter likelihood, the solver’s covariance as model error), pyrox-gp (uncertain-input GPs, the GP surrogate), kernellib (closed-form kernel means), vardax and radtrax (first consumers).
Related: geostack#290 (solver boundaries: gaussx owns every generic solve, integrix every time-integration scheme), Stack layer map (tiers), capability indexes.
1Decision¶
Every numerical method in the stack sees a finite set of evaluations and returns one number. A probabilistic method treats those evaluations as observations of the unknown answer and returns a posterior: the classical answer as its mean, plus what the evaluations could not pin down. Each method goes in the repository that already owns its classical counterpart, and no tier changes.
| Method | Home | Classical counterpart there | First user |
|---|---|---|---|
| BayesCG | gaussx strategies | CGSolver | vardax posterior covariances |
| Bayesian quadrature | integrix.expect | monte_carlo, qmc | a radtrax band integral |
| ODE filter | integrix.march | the steppers | Lorenz-63 and Lorenz-96 cycles |
| Bayesian optimisation | argminax.bayesopt | the optimisers | calibrating a costly run |
| Probabilistic finite differences | gridax.stencils | nonuniform_coeffs | to be named (step 5) |
Solid arrows are imports; gridax’s import of gaussx already exists, behind its jax extra. Dotted arrows are structural protocols: kernellib and pyrox-gp implement methods that integrix, argminax and gridax call, and filterax reads the arrays of an integrix solution; no import is added in either direction.
Eight decisions shape the page:
BayesCG is a gaussx solve strategy. Its posterior covariance is the prior minus a low-rank term, returned as a
GaussianStatewhose covariance is aLowRankUpdate.Bayesian quadrature returns an
Expectation. The scalar result ofintegrix.expectalready carries a value and a standard error; the quadrature posterior’s standard deviation fills the second.Integralis unchanged.gaussx’s kernel expectations move to
integrix.expect.kernel_expectations,compute_psi_statisticsandAnalyticalPsiStatisticsbecome the Gaussian case of integrix’s kernel means and its kernel-mean protocol. Nothing outside gaussx uses them on main.gaussx’s uncertain-input GP predictions move to pyrox-gp.
uncertain_gp_predict,uncertain_gp_predict_mc,uncertain_svgp_predict,uncertain_vgp_predictanduncertain_bgplvm_predictare GP models; nothing outside gaussx uses them on main.The ODE filter is built on gaussx, with probdiffeq as a test oracle. The stack keeps one Kalman implementation; probdiffeq is a test dependency of integrix, never a runtime one. The filter comes with what probdiffeq shows it needs: Taylor-mode initial derivatives, a fixed-point smoother and three calibrations.
Bayesian optimisation lives in argminax behind a surrogate protocol. A surrogate is anything with
predict(X) → (mean, variance); pyrox-gp’sConditionedGPalready has that method.Probabilistic finite differences sit beside the classical stencils in
gridax.stencils. The kernel is any differentiable callable , so kernellib’spairwiseserves without an import; JAX differentiates it, and the weights and variance come fromgaussx.conditional, the same conditioning Bayesian quadrature uses. It waits for a named consumer.What conditions on data goes to filterax. The line between integrix and filterax is what a method conditions on. The ODE filter conditions on the ODE’s residual, so it is a solver and stays in integrix. The likelihood that fits an ODE’s parameters to data, and the solver’s covariance used as model error in an ensemble filter, condition on data, so they are estimation and go to filterax. Both rest on the same gaussx algebra.
What does not change: the tiers in scripts/dependency_graph.py, the classical solvers, steppers and stencils (each probabilistic method is opt-in and the classical one stays the default), and the public names of kernellib, vardax and radtrax.
2Motivation¶
Most numerical methods in the stack return a number with no error bar, though each saw only a finite set of evaluations. The few that estimate an error (integrix’s Gauss–Kronrod and quasi-Monte Carlo rules, adaptive step-size control) keep it as a tolerance check rather than hand a distribution downstream.
| Unknown | What the method evaluates | Where it bites today |
|---|---|---|
| a solve | products along directions | three capped CGs in vardax |
| a band integral | radiance at a few wavelengths | radtrax channel values |
| a trajectory | the vector field at each step | step error never reaches |
| a minimiser of | at a point, one full run each | hand-tuned calibration |
| a derivative at | at a few stencil points | gradients of noisy, scattered data |
vardax stops three CG iterations early and treats the rest as solved. IncrementalFourDVar runs GaussNewtonCG with at most 30 inner steps by default. LaplaceCovariance applies through lx.CG(max_steps=200), and GaussNewtonHessian caps each covariance mat-vec at n_krylov = 50 steps. Every marginal variance and posterior sample drawn from either operator is the result of a truncated solve, and nothing reports how much was left out.
A channel value carries no error from its spectral sampling. A band integral over a spectral response (radtrax has landsat_srf and ecostress_srf) is evaluated from a handful of line-by-line runs. When the wavelengths are too few, nothing warns.
The time-stepping error is not part of the model-error covariance. A data-assimilation cycle tunes by hand. The part of it that comes from the integrator could be computed, though it is usually the smaller part next to spatial discretisation and parametrisation error. The spatial part comes from the stencils; probabilistic stencils (below) are the first piece of it, and carrying it into needs the probabilistic method of lines, which this page leaves for later.
There is no rule for where to evaluate next. Without an estimate of what is still unknown, a calibration over expensive runs has no way to choose its next run or to stop.
A derivative of data carries no error from the stencil. nonuniform_coeffs gives weights exact for polynomials up to the stencil’s degree, and nothing says how far a field that is not a polynomial, or is measured with noise, departs from that. The geostrophic velocity across an altimeter track is a slope of noisy, unevenly spaced sea-surface height ,
with the along-track distance, gravity, the Coriolis parameter, and positive to the left of the direction of travel. Its error bar today is guessed.
The classical rules do not go away. Many are the posterior mean under a particular prior: the trapezoid rule under Brownian motion, conjugate gradients under the prior covariance , and a multistep method under an integrated Wiener process. The probabilistic version keeps that mean and adds the variance.
3User stories¶
As a vardax user, I want the marginal variances from
LaplaceCovarianceto include what the capped CG left unsolved, so that a small Krylov budget gives wider error bars rather than silently narrower ones.
As a radtrax developer, I want a channel value with a standard error from its spectral sampling, so that I can see when a band needs more line-by-line runs, and where.
As someone running a twin experiment, I want a forecast whose covariance includes the integrator’s error, so that the step-size part of is computed rather than tuned.
As a modeller fitting a small ODE model’s parameters to noisy data, I want a likelihood that includes the solver’s own error, so that a coarse step widens the fit’s uncertainty rather than biasing it silently.
As a modeller calibrating a parameter that costs a full simulation per evaluation, I want the next run chosen by a surrogate of the cost, so that eight runs do the work of a grid of fifty.
As an oceanographer computing geostrophic currents from along-track altimetry, I want a stencil that returns the slope’s variance from the spacing and the noise, so that the current carries an error bar instead of a guess.
As a gaussx maintainer, I want gaussx to hold Gaussian algebra and solves, not GP models or kernel integrals, so that its scope matches its name.
4Background maths¶
Symbols¶
| Symbol | Shape | Meaning |
|---|---|---|
| a symmetric positive-definite operator | ||
| , | right-hand side and solution | |
| search directions after steps | ||
| , | prior and posterior mean of | |
| , | prior and posterior covariance of | |
| scalar function | the function a GP prior is put on: an integrand, or a field to differentiate | |
| measure | what an integral is taken against | |
| scalar | a kernel | |
| values of at the nodes | ||
| kernel matrix at the nodes | ||
| kernel means, | ||
| weights of a rule or a stencil | ||
| the state and its first derivatives | ||
| , | select and from | |
| data at time | ||
| , | , | observation operator and noise covariance |
| linear functional | what is wanted from : at , or (not a loss) | |
| scalars | the target point and the stencil points | |
| applied to the first argument of , at each node | ||
| scalar | applied to both arguments of |
One pattern¶
All five methods put a Gaussian prior on the unknown answer, treat each evaluation as an exact linear (or linearised) observation of it, and condition. They differ in what the unknown is and what an evaluation observes.
| Method | Unknown | Prior | One evaluation observes |
|---|---|---|---|
| BayesCG | a column of | ||
| Bayesian quadrature | a GP on | at a node | |
| ODE filter | an integrated Wiener process | the ODE residual, as zero | |
| Bayesian optimisation | a GP on | at a point | |
| Probabilistic finite differences | , the derivative at | a GP on | at a stencil point |
Bayesian quadrature and finite differences are the same computation with a different . The node values and the wanted quantity are jointly Gaussian, with covariance
and the answer is the conditional of the last entry given the others. With , is the kernel-mean vector and the initial error; with at , both are derivatives of . gaussx’s conditional computes that conditional today, so both methods call it rather than each writing .
BayesCG¶
After iterations with search directions , conditioning the prior on gives
With the mean is exactly the CG iterate (Cockayne et al., 2019), but that prior cannot be formed. A usable is either a Krylov prior estimated from a few extra iterations or, in vardax, the background covariance . Either way is minus a rank- term, which is what gaussx’s LowRankUpdate stores.
Bayesian quadrature¶
With evaluations at nodes , the kernel matrix and the kernel means , the integral is Gaussian with
The double integral is the initial error, the variance before any evaluation. The same two quantities give the worst-case error of any rule with weights over the unit ball of the kernel’s reproducing-kernel Hilbert space, which is the maximum mean discrepancy between and the rule (Briol et al., 2019):
gaussx’s is under a Gaussian measure. Its is a different quantity from the initial error, so the initial error is new.
ODE filter¶
The state stacks and its first derivatives, under a -times integrated Wiener prior (gaussx’s IntegratedWienerSDE with order = q). A step predicts from the prior’s exact discretisation, then conditions on the residual of the ODE , observed as zero (Schober, Särkkä and Hennig, 2019):
Linearising at the predicted mean gives the EK1 update; dropping its Jacobian (using zero in its place) gives EK0, which is cheaper and explicit. The predicted residual’s size is the local error that drives step-size control.
Initial derivatives. The prior starts from , and only is given. Every higher derivative follows from the ODE (, , and so on), and Taylor-mode automatic differentiation computes all of them in one pass. Nested forward-mode derivatives give the same numbers at a cost that grows exponentially with . Starting the derivatives at zero instead makes the first steps wrong and spoils the calibration. Accurate initialisation is one of the three fixes Krämer and Hennig (2024) give for unstable high-order filters, with the preconditioning and the square-root form below.
Filter, smoother and fixed-point smoother. The filter’s is conditioned on the residuals up to , which is what a forecast needs. A fixed-interval smoother (gaussx’s rts_smoother) conditions every time on all the residuals, the better posterior for a whole trajectory, but it keeps every step, which adaptive steps make awkward. A fixed-point smoother keeps only the smoothed state at chosen save times as the solve goes, so an adaptive solve returns smoothed values on a save grid without storing the trajectory; probdiffeq recommends it as the method of choice for adaptive steps, after Krämer (2025), who reports that it keeps an adaptive solver’s memory fixed.
Calibration. The diffusion of the prior sets the size of the covariance. It can be fixed, estimated once for the whole run by maximum likelihood from the normalised residuals, or estimated afresh at each step from the latest residual. The single estimate suits a problem whose difficulty is steady; the per-step one follows a problem whose local error changes along the run. Bosch, Hennig and Tronarp (2021) compare these choices and how they work with adaptive steps.
ODE parameters from the filter’s likelihood¶
With data , , at times, the smoother’s posterior over the trajectory for parameters is a Gauss–Markov chain, stored backward in time. A Kalman filter over that chain, with the data as its observations, returns the marginal likelihood as a by-product:
where and are the chain’s predicted moments at . Because the solver’s error is inside , a coarse step widens the likelihood rather than biasing it, and the likelihood is smooth in , so it can be optimised or sampled with no adjoint through a classical solver (Tronarp, Bosch and Hennig, 2022). filterax’s KalmanSmoother already runs this pass: an exact Kalman filter and RTS smoother over irregular observation times, with masked entries and the log-likelihood. The ODE posterior supplies its transitions and process noise, in reversed time, so the likelihood is one constructor, KalmanSmoother.from_ode_solution.
Bayesian optimisation¶
With a surrogate’s predictive mean and standard deviation for the cost , and the best cost observed so far, the expected improvement is a closed-form Gaussian expectation:
Here and are the standard normal distribution and density functions. The next run is the maximiser of EI, found by a multi-start gradient optimiser (Garnett, 2023).
Probabilistic finite differences¶
With values on a stencil around , measured with noise variance (zero for exact values), the derivative is Gaussian with
The weights are the stencil. In one dimension, as the lengthscale of a squared-exponential kernel grows without bound, the kernel interpolant tends to the polynomial interpolant (Driscoll and Fornberg, 2002), so tends to the weights of nonuniform_coeffs. The variance is the truncation error, now a distribution, and the same formula takes scattered points and noisy values. probfindiff implements this (Krämer, Schmidt and Hennig, 2022).
5Background numerics¶
BayesCG. The extra cost over CG is storing and , values, and one solve. At and that is floats, which fits. CG’s directions lose -orthogonality in finite precision, so the posterior covariance needs reorthogonalised directions or an explicit solve with rather than the CG recurrences’ diagonal form.
Bayesian quadrature. is small (tens of nodes), so a dense Cholesky of with a jitter is fine. The cost is in the kernel means: a closed form when the kernel and measure have one (a squared-exponential kernel against a Gaussian or a box measure), else a numerical rule. The numerical rule’s own error must sit well below the quadrature variance, or the variance is wrong.
ODE filter. The state has entries. A dense covariance is fine for Lorenz-sized systems and impossible for a sesmax state. The prior’s covariance factors as a Kronecker product (a block times , as gaussx’s Kronecker stores it) under EK0, and as a block diagonal under a diagonal EK1, so both large-state forms reduce to gaussx’s structured operators. Two numerical traps:
The integrated Wiener transition at small steps spans many orders of magnitude across its derivatives. A Nordsieck-style rescaling of the state (preconditioning; Krämer and Hennig, 2024) is needed for , and gaussx’s
IntegratedWienerSDEdoes not have it.The covariance has to stay positive semi-definite over thousands of steps, so the filter runs in square-root form; gaussx’s Kalman filters already offer it.
Taylor-mode differentiation in JAX is jax.experimental.jet, which is experimental; recursive forward mode is the fallback, exact and cheap for . A fixed-point smoother holds one state and its covariance per save time. The parameter likelihood costs one smoothed solve and one Kalman pass per , and its gradient comes from differentiating both.
Stiff problems are a third limit: EK0 behaves like an explicit method and is unstable on stiff terms, and EK1 needs the Jacobian, so the filter’s first users are small non-stiff systems.
Bayesian optimisation. Each round refits the surrogate ( for runs, negligible for tens of runs) and maximises the acquisition from several starts. The cost per round is dominated by the expensive run it chooses.
Probabilistic finite differences. A stencil has a handful of points, so is a few-by-few dense matrix and the cost is in forming and , by JAX derivatives of the kernel callable. On a uniform grid the weights are the same at every interior point and are computed once; on scattered points each target needs its own solve, batched with vmap. becomes ill-conditioned as the lengthscale grows past the stencil’s width, which is the regime that approaches the classical weights: like nonuniform_coeffs, the solve works in units of the stencil’s widest distance, and the flat-limit oracle stops at a lengthscale where float64 still resolves .
6What it builds on¶
Surveyed on origin/main, 1 Dec 2026.
| Need | Upstream name | State |
|---|---|---|
| solve with a report | gaussx linear_solve_with_info, SolveInfo | exists |
| solver interface | gaussx AbstractSolverStrategy, CGSolver | exists |
| low-rank covariance | gaussx LowRankUpdate | exists |
| mean and covariance | gaussx GaussianState | exists |
| condition on , matrix-free | gaussx | gap |
| conditioning on entries | gaussx conditional | exists, entries only |
| integrated Wiener prior | gaussx IntegratedWienerSDE | exists |
| its preconditioning | gaussx | gap |
| square-root predict and update | gaussx Kalman filters | exist, filter-level |
| structured covariances | gaussx Kronecker, BlockDiag | exist |
| sigma-point rules | gaussx GaussHermiteIntegrator and others | exist |
| kernel expectations | gaussx kernel_expectations | exists, moves |
| scalar result with an error | integrix Expectation | exists |
| measures | integrix | gap |
| quadrature rules | integrix GaussKronrod; functax quad | exist |
| stepper interface | integrix AbstractStepper, run | exists |
| step-size control | integrix imex_stepsize_controller; diffrax | exists |
| Taylor-mode derivatives | none in the stack | gap |
| fixed-interval smoother | gaussx rts_smoother | exists |
| fixed-point smoother | gaussx | gap |
| log-likelihood of a Kalman pass | gaussx kalman_filter | exists |
| Kalman smoother over irregular times | filterax KalmanSmoother (from_sde, smooth) | exists |
| model-error noise for ensemble filters | filterax AbstractNoise | exists |
| GP posterior with variance | pyrox-gp ConditionedGP.predict | exists |
| gradient optimisers | argminax (optimistix) | exist |
| truncated solves to fix | vardax LaplaceCovariance, GaussNewtonHessian | exist |
| spectral responses | radtrax landsat_srf, ecostress_srf | exist |
| classical stencil weights | gridax nonuniform_coeffs, difference_coeffs | exist |
| kernel as a callable | kernellib pairwise on pointwise kernels | exists |
| derivatives of a kernel | JAX autodiff; kernellib Derivative | exist |
| a joint Gaussian’s conditional | gaussx conditional | exists |
The conditioning gap. gaussx’s conditional conditions on observed entries of a joint Gaussian. BayesCG conditions on linear functionals , with a covariance that is an operator. A matrix-free condition_linear(state, H, y) that returns a GaussianState with a LowRankUpdate covariance goes in gaussx; BayesCG is its first user.
The preconditioning gap. The Nordsieck-style rescaling of IntegratedWienerSDE’s transition goes in gaussx _ssm, beside the exact discretisation it rescales. It is useful to any long integrated-Wiener smoother, not only the ODE filter.
The single-step gap. gaussx’s public square-root Kalman forms run a whole filter over a sequence of observations. The ODE filter takes one step at a time inside integrix’s loop, so it needs square-root predict and update steps as public functions. nonlinear_kalman_predict and nonlinear_kalman_update are public but take dense covariances.
The Taylor-mode gap. No library in the stack uses jax.experimental.jet. taylor_coefficients(vector_field, x0, t0, order), the first q derivatives of an initial-value problem’s solution, goes in integrix.march beside the filter that needs it.
The fixed-point gap. gaussx has a fixed-interval smoother but no fixed-point smoother. Smoothing a Gauss–Markov chain at chosen times is generic state-space work, so it goes in gaussx _ssm beside rts_smoother.
The measure gap. integrix.expect takes samples or a sampler, never a measure. Bayesian quadrature needs a small set: a Gaussian (gaussx’s GaussianState, not a new class), a box, a weighted box (a density on a box, such as a spectral response), the sphere (functax’s sphere rules) and an empirical measure.
7Ownership¶
gaussx (Core 0) owns
BayesCGSolver, its Krylov prior and the scale calibration,condition_linear, a lineax-solver form ofBayesCGSolver(as gaussx already writes_MINRES) that returns its posterior in the solution’sstats, the preconditioned integrated-Wiener transition, the single-step square-root predict and update, and the fixed-point smoother. It loseskernel_expectations,compute_psi_statistics,AnalyticalPsiStatisticsand the fiveuncertain_*_predictfunctions.integrix (Core 1) owns the measures,
kernel_mean,initial_error,bayes_quadandrule_errorinintegrix.expect, with the Gaussian kernel expectations moved in from gaussx. It owns theODEFilterstepper inintegrix.march, withtaylor_coefficientsfor its initial state. Its solution exposes the smoother’s backward chain (transitions, process noise, means) as arrays, which is all filterax reads. These are its first imports of gaussx, which it already declares as a dependency. probdiffeq is a test dependency.argminax (Core 1) minimises filterax’s negative parameter likelihood with its existing optimisers, and owns
argminax.bayesopt: theSurrogateprotocol, the acquisitions (expected improvement, probability of improvement, a lower confidence bound) and the ask/tell loop that maximises them with its own optimisers.kernellib (GeoML 1) owns closed-form kernel means as optional methods on its kernels. The methods take plain arrays, so kernellib imports nothing new.
pyrox-gp (GeoML 3) receives the uncertain-input GP predictions, now built on integrix’s kernel means. It provides the
fitthat turns runs into aConditionedGPwith learned hyperparameters, which argminax uses as a surrogate.vardax passes
BayesCGSolvertoLaplaceCovarianceandGaussNewtonHessianand reads from the solve’sstats, and adds the 4D-Var increment’s to the analysis covariance after the solve.GaussNewtonCGand optimistix are untouched.radtrax runs the Bayesian quadrature pilot on one band.
gridax (GeoNumerics) owns
probabilistic_coeffsingridax.stencils, behind itsjaxextra, which already declares gaussx.gridax.stencilsis array-agnostic and imports no JAX today, soprobabilistic_coeffsimports JAX and gaussx inside the function and namesgridax[jax]in its error when they are missing;import gridax.stencilsstays NumPy-only.bayes_quadandprobabilistic_coeffsboth condition throughgaussx.conditional.filterax (GeoML 2) owns
KalmanSmoother.from_ode_solution, the parameter likelihood, besidefrom_sde; filterax’s ensemble processes (EKI, EKS) can fit the same likelihood without gradients. It also owns a noise model that adds the ODE filter’s step covariance to a forecast ensemble’s model error. It reads the solution’s arrays and imports nothing new.
The kernel-mean protocol. A kernel may define gaussian_kernel_mean(mean, cov, nodes), box_kernel_mean(lower, upper, nodes) and the matching *_initial_error methods, all on arrays. integrix calls the method that matches the measure when the kernel has it, and otherwise integrates numerically: with gaussx’s sigma-point rules for a Gaussian, and with Gauss–Kronrod or a functax rule for a box. gaussx’s AnalyticalPsiStatistics (, , as methods) is the precedent, and folds into this protocol when it moves.
The kernel callable. probabilistic_coeffs takes a kernel as any differentiable function of two points, returning a scalar. A kernellib pointwise kernel passes its pairwise method, which takes (D,) points, so probabilistic_coeffs hands each offset over as a (1,) array; a lambda works as well. gridax imports nothing from GeoML.
The surrogate protocol. A surrogate has predict(X) → (mean, variance). The loop takes a fit(X, y) → surrogate callable, so hyperparameter learning stays with the surrogate’s library; pyrox-gp’s fit runs through pipekit-train like the stack’s other training loops. Any emulator with a predictive variance (an ensemble, say) can stand in for the GP.
8API proposal¶
The names are proposals. The markers follow the overview examples, and today* marks a name that ships with an argument that is proposed.
gaussx.
# Shapes: D_x = state size; m = CG steps; M = observations
# proposed
# solves A δx = b; the posterior of δx is 𝒩(μ_m, Σ_m), Σ_m = Σ₀ − rank-m term
class BayesCGSolver(AbstractSolverStrategy):
max_steps: int
prior: Literal["krylov", "given"] # "given": Σ₀ passed to bayes_cg
rtol: float
atol: float
# proposed
# → GaussianState(mean (D_x,), cov LowRankUpdate (D_x, D_x)), SolveInfo
def bayes_cg(operator, vector, *, solver: BayesCGSolver, prior_cov=None): ...
# proposed
# 𝒩(μ, Σ) conditioned on H x = y, matrix-free; H is (M, D_x) as an operator
# → GaussianState with cov = Σ − Σ Hᵀ (H Σ Hᵀ + R)⁻¹ H Σ as a LowRankUpdate
def condition_linear(state: GaussianState, H, y, *, noise=None): ...
# today* (preconditioned: the transition in Nordsieck-scaled coordinates)
IntegratedWienerSDE(diffusion, order, P_0, preconditioned=True)
# proposed
# p(x_s | residuals up to t) at save times s, updated as each step arrives
def fixed_point_smoother(state, transition, save_times): ...integrix.expect.
# Shapes: N = nodes; D = input dimension
# proposed: measures
Box(lower, upper) # (D,), (D,)
WeightedBox(density, lower, upper) # density: (D,) → ()
Sphere(radius)
Empirical(samples, weights) # (S, D), (S,)
# a Gaussian measure is gaussx.GaussianState(mean, cov)
# proposed
# zₙ = ∫ k(x, xₙ) dμ(x); closed form from the kernel when it has one
def kernel_mean(kernel, measure, nodes, *, rule=None) -> Array: ... # (N,)
# proposed
# ∫∫ k(x, x′) dμ(x) dμ(x′)
def initial_error(kernel, measure, *, rule=None) -> Array: ... # ()
# proposed
# 𝔼[F | f] = zᵀ K⁻¹ f, 𝕍[F | f] = initial error − zᵀ K⁻¹ z
def bayes_quad(kernel, measure, nodes, values) -> Expectation: ...
# proposed
# e(w)² = ∫∫ k − 2 wᵀ z + wᵀ K w, the MMD between μ and the rule
def rule_error(kernel, measure, nodes, weights) -> Array: ... # ()
# moved from gaussx (Gaussian measure; Ψ₀, Ψ₁, Ψ₂)
def kernel_expectations(kernel_fn, state, X_train, integrator): ...integrix.march.
# Shapes: D_x = state size; q = derivatives in the prior
# proposed
# X = [x, ẋ, …, x⁽q⁾]; predict with the IWP prior, condition on r = E₁X − f(E₀X, t) = 0
class ODEFilter(AbstractStepper):
num_derivatives: int # q
linearisation: Literal["ek0", "ek1", "diagonal_ek1"]
covariance: Literal["dense", "isotropic", "blockdiag"]
strategy: Literal["filter", "smoother", "fixedpoint"]
calibration: Literal["none", "mle", "dynamic"]
# proposed
# [x(t₀), ẋ(t₀), …, x⁽q⁾(t₀)] by Taylor mode, ẋ = f(x, t)
def taylor_coefficients(vector_field, x0, t0, *, order) -> Array: ... # (q + 1, D_x)filterax.
# Shapes: J = observation times; D_y = observed size; D_x = (q + 1) × state size
# proposed: beside from_sde
# F_k, Σ_η,k from the ODE posterior's backward chain between t_J > … > t_1
# obs_model H (D_y, D_x) picks x from X; obs_noise R (D_y, D_y)
smoother = KalmanSmoother.from_ode_solution(solution, times, obs_model, obs_noise)
# today: log p(y₁:J | θ) of the observed entries
result = smoother.smooth(observations, mask) # result.log_likelihood: ()argminax.bayesopt.
# Shapes: D_θ = parameters; n = runs so far
# proposed
class Surrogate(Protocol):
def predict(self, X) -> tuple[Array, Array]: ... # (M,), (M,)
# proposed
# EI(θ) = (c⋆ − m) Φ(u) + s φ(u), u = (c⋆ − m)/s
def expected_improvement(mean, variance, best) -> Array: ...
# proposed
# ask: θ_next = argmax acquisition; tell: add (θ, c) and refit
class BayesOpt(eqx.Module):
fit: Callable[[Array, Array], Surrogate]
acquisition: Callable
bounds: tuple[Array, Array] # (D_θ,), (D_θ,)gridax.stencils.
# Shapes: N = stencil points
# proposed: the probabilistic twin of nonuniform_coeffs(dz, derivative)
# w = (K + σ_ε² I)⁻¹ k_𝓛, σ² = k_𝓛𝓛 − k_𝓛ᵀ w; kernel: (s, s′) → ()
def probabilistic_coeffs(
kernel, dz, derivative=1, *, noise=0.0
) -> tuple[Array, Array]: ... # (..., N), (...)9API usage examples¶
BayesCG in a vardax covariance.
import gaussx as gx
import vardax as vdx
# Shapes: D_x = 4096 state; 50 CG steps per mat-vec
# proposed
# Σ_m covers the part of Λ_x|y⁻¹ v the capped CG did not reach
solver = gx.BayesCGSolver(max_steps=50, prior="krylov", rtol=1e-6, atol=1e-6)
# today* (vardax: solver= takes a lineax solver today, and ignores Σ_m)
posterior = vdx.LaplaceCovariance(solver=solver)(analysis, model, batch)
# marginal variances of posterior # (D_x,), now with Σ_mA band integral with an error bar.
import integrix as ix
import kernellib as kl
from radtrax.geo import landsat_srf
# Shapes: N = 12 wavelengths
# today (radtrax): R(λ) of one band on a fine grid, srf.matrix[0]
srf = landsat_srf("L8", bands=("B7",))
# today (kernellib)
kernel = kl.Matern(nu=2.5, lengthscale=8.0, variance=1.0)
# proposed
# dμ(λ) = R(λ) dλ / ∫R dλ, so F is the band average radtrax reports
band = ix.expect.WeightedBox(density=response_fn, lower=lo, upper=hi)
# proposed
# F̂ = zᵀ K⁻¹ L, σ_F = √(initial error − zᵀ K⁻¹ z)
result = ix.expect.bayes_quad(kernel, band, nodes=wavelengths, values=radiances)
# result.value, result.standard_error # (), ()Here response_fn interpolates srf.matrix[0] on srf.wavelengths_hr_nm, and radiances are the 12 line-by-line runs at wavelengths.
An ODE filter on Lorenz-63.
import integrix as ix
# Shapes: D_x = 3; K = 400 steps; q = 2
# proposed
solver = ix.march.ODEFilter(
num_derivatives=2,
linearisation="ek1",
covariance="dense",
strategy="filter",
calibration="mle",
)
# today* (run takes any AbstractStepper; the filter's state is a GaussianState)
states = ix.march.run(solver, lorenz63, t0=0.0, y0=x0, dt=0.025, n_steps=400)
# states.mean[:, :3], diagonal of states.cov # (K, D_x), (K, D_x)Fitting of Lorenz-63 to noisy data.
import filterax as fx
import integrix as ix
import optimistix as optx
# Shapes: D_x = 3; J = 40 observations of all three variables
# proposed
smoother = ix.march.ODEFilter(
num_derivatives=3,
linearisation="ek1",
covariance="dense",
strategy="smoother",
calibration="mle",
)
# proposed
# −log p(y₁:J | ρ); the solver's error is inside the predicted covariances
def loss(rho, args):
solution = ix.march.run(smoother, lorenz63, 0.0, x0, 0.025, 400, args=rho)
likelihood = fx.KalmanSmoother.from_ode_solution(solution, t_obs, H, R)
return -likelihood.smooth(y).log_likelihood
# today (optimistix, which argminax wraps)
rho_hat = optx.minimise(loss, optx.BFGS(rtol=1e-6, atol=1e-6), 20.0).value # ()Calibrating one parameter.
import argminax
import pyrox_gp
# Shapes: D_θ = 1; 8 runs
# proposed
loop = argminax.bayesopt.BayesOpt(
fit=pyrox_gp.surrogate_fit(kernel), # proposed: returns a ConditionedGP
acquisition=argminax.bayesopt.expected_improvement,
bounds=(jnp.array([0.0]), jnp.array([1e-3])),
)
# proposed
result = loop.run(cost, n_runs=8, key=key)
# result.best_theta, result.history # (D_θ,), (8, D_θ + 1)A geostrophic current with an error bar.
import einx
import jax.numpy as jnp
import kernellib as kl
from gridax.stencils import probabilistic_coeffs
# Shapes: P = along-track points; N = 5 points per stencil
# today (kernellib)
kernel = kl.RBF(lengthscale=25e3, variance=0.01) # metres; m² of η
# proposed
# w, σ² for ∂η/∂s at each point from its N neighbours; σ_ε² = (0.03 m)²
weights, variance = probabilistic_coeffs(
kernel.pairwise, dz, derivative=1, noise=0.03**2
) # (P, N), (P,)
# ∂η/∂s ≈ wᵀ η, and u_n = (g/f) ∂η/∂s, positive to the left of the track
slope = einx.dot("p n, p n -> p", weights, eta_stencils) # (P,)
velocity = (9.81 / coriolis) * slope # (P,)
# σ_u = (g/|f|) σ
velocity_std = (9.81 / jnp.abs(coriolis)) * jnp.sqrt(variance) # (P,)Here dz holds each point’s signed distances to its N neighbours along the track, eta_stencils the sea-surface heights at those neighbours, and coriolis the Coriolis parameter at each point.
10Build order¶
Five steps, each gated on a closed-form oracle and, where a consumer sees the variance, a calibration check. Calibration means the true error behaves like a draw from the posterior: over many runs the normalised error, (truth − mean) / standard deviation, is close to , and the 95 % interval covers the truth within the bound its sampling distribution allows. A step that fails its calibration gate ships nothing to a consumer.
BayesCG in gaussx, then vardax.
condition_linear,BayesCGSolverandbayes_cgfirst; then vardax passes it toLaplaceCovarianceandGaussNewtonHessianbehind an argument.Oracle: with on small dense systems, the mean equals the CG iterates to round-off, and at the covariance is zero.
Calibration: with the Krylov prior, the squared error in the norm of (a pseudo-inverse, since has rank ) over random SPD systems follows a distribution with degrees of freedom.
Consumer gate: on a small linear-Gaussian vardax problem whose exact posterior variance is computed densely, the BayesCG-corrected marginals cover the truth at a budget where the plain CG marginals do not.
The two moves, then Bayesian quadrature. Move the kernel expectations to
integrix.expectand the uncertain-input predictions to pyrox-gp, with their tests and no change of behaviour; then add the measures,kernel_mean,initial_error,bayes_quad,rule_error, and kernellib’s closed forms.Oracle: the moved functions pass their gaussx tests unchanged. Kernel means match adaptive quadrature to 10-10. Under a Brownian-motion kernel on a box, the posterior mean equals the trapezoid rule.
Calibration: coverage on integrals of random draws from the prior; then one radtrax band as a pilot, against a dense line-by-line reference.
The ODE filter. gaussx’s preconditioned transition, single-step square-root functions and fixed-point smoother first; then
ODEFilterandtaylor_coefficientsin integrix, andKalmanSmoother.from_ode_solutionin filterax.Oracle: a linear ODE , solved exactly by ; the mean converges at the order of the prior. probdiffeq, with the same prior, linearisation and calibration, matches the means and covariances on Lorenz-63.
Oracle for the new pieces: the Taylor coefficients of are all , and those of a polynomial vector field match its closed form; the fixed-point smoother equals
rts_smootherat its save times; for a linear ODE with linear-Gaussian data, the likelihood fromfrom_ode_solutionapproaches the exact Kalman likelihood of the linear system as the step shrinks.Calibration: normalised errors over steps and initial conditions, on the linear ODE and on Lorenz-63 against a fine-step reference.
Parameter gate: of Lorenz-63 recovered from noisy data, with the truth inside the fit’s interval at its nominal rate over seeds.
Bayesian optimisation in argminax, with pyrox-gp’s surrogate fit.
Oracle: the minimiser of a known test function, within a fixed budget of runs.
Gate: lower regret than random search at the same budget, over seeds.
Probabilistic finite differences in gridax, once a consumer is named (the geostrophic current is the candidate).
Oracle: in one dimension, as the lengthscale grows, the weights approach
nonuniform_coeffson the same offsets;bayes_quadandprobabilistic_coeffsagree with a directgaussx.conditionalon the assembled joint covariance.Calibration: on draws from the prior, with and without noise, the normalised errors of the derivative follow .
11Alternatives considered¶
| Alternative | Verdict |
|---|---|
| Wrap probdiffeq in integrix | test oracle only |
| ProbNum | reject |
| One new package for all four | reject |
| Bayesian quadrature in gaussx | reject |
| Bayesian optimisation in pyrox-gp | reject |
| integrix above a split kernellib | deferred |
| Wrap probfindiff in gridax | reject |
| Do nothing | reject |
Wrapping probdiffeq. probdiffeq is a maintained JAX library with the filters, smoothers, calibration and step-size adaptation this page needs. Wrapping it would ship the ODE filter fastest, at the price of a second Kalman implementation beside gaussx’s and a runtime dependency on another library’s state types. The stack has no users yet, so the gaussx build costs little in disruption, and probdiffeq stays useful as the reference the tests compare against. Beyond the filter it holds Taylor-mode initialisation (jetexpand_ode_*), fixed-interval and fixed-point smoothers, three calibrations (solver, solver_mle, solver_dynamic) and a likelihood for ODE parameters (loss_lml_timeseries); this page takes all four. Its README warns of sudden API changes, which is a further reason to keep it out of the runtime.
ProbNum. ProbNum covers linear solvers, quadrature and ODE filters, but its last release is 0.1.25 (April 2023) and it is not built on JAX.
One new package. A package holding all four methods would import gaussx, integrix and pyrox-gp, so it could only sit in GeoML, above the Core repositories that own the classical solvers and rules.
Bayesian quadrature in gaussx. gaussx already holds Gaussian-measure rules and the kernel expectations, so the Gaussian case would fit there. A band integral is against a uniform or weighted measure, though, and integration against a measure is integrix’s job; splitting by measure would put one method in two places.
Bayesian optimisation in pyrox-gp. pyrox-gp can import both the GP and argminax’s optimisers. But the loop and its acquisitions are optimisation and need only a predictive mean and variance; behind a protocol they serve any surrogate, and only the fit is GP-specific.
The tier change. The first draft of this page moved integrix to Core tier 2 above kernellib, and split kernellib into a Core package and a models package, so that integrix could import kernels. The kernel-mean protocol removes the need. A kernellib split may still be worth doing for its own reasons (keeping scikit-learn and the estimators out of the kernel layer) on its own page.
Wrapping probfindiff. probfindiff computes these weights in JAX, but its last release is 0.0.2 (February 2023). The method is a few lines on kernel derivatives and gaussx.conditional, so it is cheaper to write beside nonuniform_coeffs, where its oracle already lives.
Doing nothing. The truncated vardax solves stay invisible in its covariances, channel values carry no sampling error, and stays tuned by hand.
12Risks and open questions¶
The largest risk is an error bar that is confidently wrong: every method here is only as calibrated as its prior, which is why each step is gated on a calibration check before any consumer sees it.
BayesCG’s prior. reproduces CG but cannot be formed. Whether the Krylov prior or vardax’s is the better calibrated on vardax’s problems is the first experiment of step 1.
Scale and stiffness. The ODE filter’s large-state forms (isotropic, block diagonal) lose some calibration, and stiff systems need EK1’s Jacobian. sesmax is a later experiment, not a first user.
Taylor mode in JAX.
jax.experimental.jetmay change or go; the recursive forward-mode fallback keeps working either way.What the covariance covers. The ODE filter’s covariance is the time-stepping error only, not the model’s structural error. must still carry the rest, and a consumer that replaces with it is overconfident.
When it pays. Bayesian quadrature and optimisation pay off only when each evaluation is expensive. A band sampled on a dense line-by-line grid does not need them, so the radtrax pilot should pick a band where it is not. For a differentiable model, argminax’s gradient-based calibration usually beats Bayesian optimisation; the latter is for non-differentiable or very expensive runs.
A stencil without a consumer. Nothing in the stack asks for a derivative’s error bar today, so step 5 waits for one rather than shipping first.
Not in this page: probabilistic solvers for PDEs, which condition a GP on the PDE’s residual at collocation points (Pförtner et al., 2022), and the probabilistic method of lines, which puts probabilistic stencils in space under the ODE filter in time, so that the model-error covariance carries both discretisation errors (Krämer, Schmidt and Hennig, 2022). Both build on steps 3 and 5 and get their own page when sesmax or another model needs them. Their homes follow the solver-boundary rules of geostack#290 rather than this page’s: integrix may not import gridax, so a PDE filter cannot live there. gridax would supply the semi-discrete operator with its discretisation covariance, integrix’s ODEFilter would take that covariance as an extra Gaussian term at each step, and sesmax-core’s PDE driver, solve_pde, would join them, with no new edge.
Decisions asked of the reader:
vardax default. Once BayesCG passes its gates, does its covariance enter vardax’s posterior covariances by default, or stay behind an argument?
The 4D-Var increment. Should the increment’s be added to the analysis covariance, or only reported beside it, given that the Laplace covariance already comes from the same Gauss–Newton Hessian?
Measures’ home. The measures start in
integrix.expect. If gaussx or pyrox-gp later need them, should they move down to gaussx?Step 5’s consumer. Is the geostrophic current from along-track altimetry the right first user of probabilistic stencils, or is there one closer to the stack’s models?
13References¶
Hennig, P., Osborne, M. A. and Kersting, H. P. (2022). Probabilistic Numerics: Computation as Machine Learning. Cambridge University Press. Hennig et al. (2022).
Cockayne, J., Oates, C. J., Ipsen, I. C. F. and Girolami, M. (2019). A Bayesian conjugate gradient method (with discussion). Bayesian Analysis 14(3), 937–1012. Cockayne et al. (2019).
Briol, F.-X., Oates, C. J., Girolami, M., Osborne, M. A. and Sejdinovic, D. (2019). Probabilistic integration: a role in statistical computation? Statistical Science 34(1), 1–22. Briol et al. (2019).
Schober, M., Särkkä, S. and Hennig, P. (2019). A probabilistic model for the numerical solution of initial value problems. Statistics and Computing 29(1), 99–122. Schober et al. (2019).
Garnett, R. (2023). Bayesian Optimization. Cambridge University Press. Garnett (2023).
Krämer, N. and Hennig, P. (2024). Stable implementation of probabilistic ODE solvers. Journal of Machine Learning Research 25(111), 1–29. jmlr
.org /papers /v25 /20 -1423. Krämer, N. (2025). Adaptive probabilistic ODE solvers without adaptive memory requirements. Proceedings of the First International Conference on Probabilistic Numerics, PMLR 271, 12–24. proceedings
.mlr .press /v271 /kramer25a. Bosch, N., Hennig, P. and Tronarp, F. (2021). Calibrated adaptive probabilistic ODE solvers. AISTATS, PMLR 130, 3466–3474. proceedings
.mlr .press /v130 /bosch21a. Tronarp, F., Bosch, N. and Hennig, P. (2022). Fenrir: physics-enhanced regression for initial value problems. ICML, PMLR 162, 21776–21794. proceedings
.mlr .press /v162 /tronarp22a. Driscoll, T. A. and Fornberg, B. (2002). Interpolation in the limit of increasingly flat radial basis functions. Computers & Mathematics with Applications 43(3–5), 413–422. Driscoll & Fornberg (2002).
Krämer, N., Schmidt, J. and Hennig, P. (2022). Probabilistic numerical method of lines for time-dependent partial differential equations. AISTATS, PMLR 151, 625–639. proceedings
.mlr .press /v151 /kramer22a. Pförtner, M., Steinwart, I., Hennig, P. and Wenger, J. (2022). Physics-informed Gaussian process regression generalizes linear PDE solvers. arXiv:2212.12474.
probdiffeq 0.9.3 (5 November 2026), ProbNum 0.1.25 (3 April 2023) and probfindiff 0.0.2 (20 February 2023) on PyPI, read 1 December 2026.
- Hennig, P., Osborne, M. A., & Kersting, H. P. (2022). Probabilistic Numerics: Computation as Machine Learning. Cambridge University Press. 10.1017/9781316681411
- Cockayne, J., Oates, C. J., Ipsen, I. C. F., & Girolami, M. (2019). A Bayesian conjugate gradient method (with discussion). Bayesian Analysis, 14(3), 937–1012. 10.1214/19-BA1145
- Briol, F.-X., Oates, C. J., Girolami, M., Osborne, M. A., & Sejdinovic, D. (2019). Probabilistic integration: a role in statistical computation? Statistical Science, 34(1), 1–22. 10.1214/18-STS660
- Schober, M., Särkkä, S., & Hennig, P. (2019). A probabilistic model for the numerical solution of initial value problems. Statistics and Computing, 29(1), 99–122. 10.1007/s11222-017-9798-7
- Garnett, R. (2023). Bayesian Optimization. Cambridge University Press. 10.1017/9781108348973
- Driscoll, T. A., & Fornberg, B. (2002). Interpolation in the limit of increasingly flat radial basis functions. Computers & Mathematics with Applications, 43(3–5), 413–422. 10.1016/S0898-1221(01)00295-4