Stochastic systems discovery
Discovers the interpretable drift and diffusion terms of nonlinear stochastic dynamical systems driven by Gaussian white noise, using sparse Bayesian learning on output-only measurements.
Walkthrough
The problem
Many structures are shaken by forces nobody measures: wind on a tower, waves on a platform, noise in a market. What we have is a noisy record of the response. The aim is to recover the governing stochastic differential equation (SDE) from that record alone, with no measurement of the input, and to keep it interpretable: a few named terms, each with an uncertainty.
The drift \(\mathbf f\) carries the deterministic dynamics. The diffusion \(\mathbf g\) carries the effect of the unknown force, modeled as Gaussian white noise. Discovery means finding both from noisy measurements of \(\mathbf X\) only.
How it works
1. Targets from the data. Brownian motion is not differentiable, so the derivative cannot be taken directly. The Kramers–Moyal formulas read the drift from the average increment of the sample paths (the linear variation) and the diffusion covariance \(\boldsymbol\Gamma=\mathbf g\mathbf g^{\top}\) from the average product of increments (the quadratic variation). With time step \(\Delta t\), and averaged over an ensemble of trajectories, the targets are
2. A library of candidate functions. The same records are evaluated on a dictionary: a constant, polynomials of the states, and the non-smooth terms \(\mathrm{sgn}(X)\), \(|X|\) and \(X|X|\). The ensemble-averaged library \(\mathbf L\in\mathbb R^{N\times K}\) has \(K\) columns: 36 for the Duffing oscillator and 58 for the two-degree-of-freedom building below.
3. Sparse Bayesian regression. Each target is explained as a sparse combination of library columns, \(\mathbf Y=\mathbf L\boldsymbol\theta+\boldsymbol\epsilon\). An \(m\)-dimensional process needs \(m\) regressions for the drift and \(m(m+1)/2\) for the diffusion covariance, and all of them are independent.
A hierarchical prior that switches terms on and off
To keep only the few terms that matter, every weight gets a discontinuous spike-and-slab prior. A latent switch \(Z_k\in\{0,1\}\) decides whether weight \(\theta_k\) sits in the spike, exactly zero so the term is out, or in the slab, a Gaussian so the term is in.
Here \(\boldsymbol\theta_r\) collects the weights whose switch is on. The slab variance \(\vartheta_s\) and the noise variance \(\sigma^2\) are treated as random too, which helps the sampler converge to a sparse solution, and the switch probability \(p_0\) gets its own Beta prior:
With the Gaussian likelihood \(\mathbf Y\mid\boldsymbol\theta,\sigma^2\sim\mathcal N(\mathbf L\boldsymbol\theta,\sigma^2\mathbf I)\), the chain of dependencies is the network below.
The joint posterior is the product of the factors along the network:
Sampling the posterior with a Gibbs sampler
The spike makes the joint posterior impossible to sample directly. A Gibbs sampler draws each unknown from its conditional distribution given the others (left of the figure). Because of the network structure, each conditional has a standard form, so every step is cheap.
The chain has 3,000 samples and the first 1,000 are discarded as burn-in. From the remaining samples, the fraction in which a term’s switch is on is its marginal posterior inclusion probability (PIP):
Terms with a PIP above 0.5 enter the final model. The mean of the retained weights gives each coefficient, and their covariance gives its uncertainty, so the output is an equation with error bars. The method is autonomous: it needs no manual calibration or cross-validation.
Test systems
The framework is tested on a Black–Scholes SDE, a parametrically excited Duffing oscillator, a two-degree-of-freedom base-isolated shear building with a Coulomb friction isolator, and, further below, a Bouc–Wen oscillator. In every case the input is unknown and only noisy measurements of the states are used. Each data set is 500 trajectories of 1 s sampled at 1,000 Hz with the Euler–Maruyama scheme, corrupted with 5% Gaussian noise.
Drift identification
For the Duffing oscillator, three terms stand out from 36 candidates, \(X_1\), \(X_2\) and \(X_1^3\), and nothing else comes close. For the building, the four linear terms and the Coulomb friction term are found in a library of 58 for the first floor, and the four linear terms for the second.
The Black–Scholes panels carry a lesson about the library. With \(|X|\) and \(X|X|\) included, the probability is shared between \(X\) and \(|X|\), each sitting near the cutoff, because a geometric Brownian motion stays positive and the two functions are then identical. Remove the redundant columns and the correct term, \(X\), is selected with probability close to one.
Diffusion identification
The diffusion is the harder half, because it is invisible in the average motion and only appears in the covariance of the increments. The framework finds \(X^2\) for Black–Scholes (shared with \(X|X|\) when the redundant columns are present, as for the drift), \(X_1^2\) for the Duffing oscillator, and a constant for each floor of the building. This is exactly the structure of the equations that generated the data. Taking the square root of the identified covariance recovers the noise strength: \(\sigma\approx10.3\) for the Duffing oscillator, against a true value of 10.
The identified coefficients, with the posterior standard deviation next to each mean:
| System | Term | True | Identified (mean ± std) |
|---|---|---|---|
| Black–Scholes | drift, \(X\) | 2 | 2.05 ± 0.06 |
| Black–Scholes | diffusion, \(X\) | 1 | 1.02 ± 0.16 |
| Duffing | drift, \(X_1\) | −1000 | −1000.02 ± 2.03 |
| Duffing | drift, \(X_2\) | −2 | −1.99 ± 0.02 |
| Duffing | drift, \(X_1^3\) | −100000 | −99885.10 ± 1402.64 |
| Duffing | diffusion, \(X\) | 10 | 10.31 ± 2.38 |
| Building, first floor | drift, \(Y_1\) | −6000 | −6000.30 ± 2.21 |
| Building, first floor | drift, \(Y_2\) | −4 | −3.97 ± 0.06 |
| Building, first floor | drift, friction \(\mathrm{sgn}(Y_2)\) | −9.81 | −9.89 ± 2.07 |
| Building, first floor | drift, \(Y_3\) | 2000 | 1999.73 ± 3.90 |
| Building, first floor | drift, \(Y_4\) | 2 | 2.09 ± 0.11 |
| Building, first floor | diffusion, constant | 10 | 10.03 ± 1.34 |
For the building, \(Y_1,\dots,Y_4\) are the displacement and velocity of the two floors. Signs follow the discovered drift.
A partially observed system: Bouc–Wen
Not every state can be measured. A Bouc–Wen oscillator models a hysteretic base isolator through a hidden state \(Z(t)\), which is practically impossible to measure, so the framework sees only displacement and velocity:
The data are generated with \(m=1\), \(k=10^4\), \(c=20\), \(\lambda=0.5\), \(A_1=A_2=0.5\), \(A_3=1\), \(\bar n=3\) and \(\sigma=2\). With the state vector \([X_1,X_2,X_3]=[X,\dot X,Z]\), the system is
Only \(X_1\) and \(X_2\) are given to the algorithm. The true drift involves \(X_3\), so it cannot appear in the library. The framework instead selects extra terms that stand in for the hidden state: 11 drift terms from a library of 36, and three diffusion terms, \(1\), \(X_1\) and \(|X_1|\). The damping term comes out as 20, the true value of \(c\). The identified effective drift and diffusion are
after dropping one term, \(0.05X_2^2\), whose weight is not significant. These are effective coefficients in the observed state space, so they differ from the first-principles equation, as they must. To test them, the identified model is trained on only 1 s of data and then simulated 500 s ahead in an unseen scenario: a new initial condition \(\mathbf X_0=[0.1,0]\) and a noise intensity of 6, three times the training value. Its predicted mean response and 95% confidence band stay close to the actual system.
Against stochastic SINDy
The only other method that identifies SDEs from data is stochastic SINDy, a frequentist least-squares approach that relies on a threshold to select terms. Both methods are given the same 1 s of data with 5% noise. The table reports the parameter estimation error \(e_\theta=\lVert\boldsymbol\theta^{*}-\boldsymbol\theta\rVert_2/\lVert\boldsymbol\theta\rVert_2\), where \(\boldsymbol\theta^{*}\) is the posterior mean for the proposed method and the least-squares weights for SINDy. Lower is better.
| Method | Drift | Diffusion | ||||||
|---|---|---|---|---|---|---|---|---|
| Black–Scholes | Duffing | 2-DOF, floor 1 | 2-DOF, floor 2 | Black–Scholes | Duffing | 2-DOF, floor 1 | 2-DOF, floor 2 | |
| Proposed | 0.0065 | 0.0019 | 4.52×10−7 | 1.64×10−5 | 1.29×10−5 | 0.00094 | 0.4668 | 0.4651 |
| Stochastic SINDy | 0.1730 | 5.19×106 | 0.6493 | 3.2617 | 0.1613 | 3.26×104 | 6.5015 | 5.0634 |
Parameter estimation error \(e_\theta\) at 5% measurement noise.
For Black–Scholes both methods find the right terms, but the SINDy coefficients are slightly off. For the Duffing oscillator and the building, SINDy picks up many extra terms, which explains the large errors and why its predictions drift away once new random forcing excites the system. The Bayesian approach finds the correct terms, so its predictions stay close to the truth. SINDy is cheaper to compute, and the paper notes it may improve with much more data: its original study used \(10^7\) steps.