Polarize
GitHub Get in touch

Scope: drift-diffusion

Goal: a DriftDiffusion chart in Storybook (Science / Stochastic dynamics) that estimates drift and diffusion as functions of the state from a synthetic time series, draws them over the known true functions, and shows the equilibrium potential beside them.

Tier: explore

Features:

F1. Estimator: bin the state and, in each bin, compute the first two Kramers–Moyal conditional moments of the increments at the sampling interval τs, divided by τs, giving drift K(1)(x) and diffusion K(2)(x) with a standard error and a sample count per bin. Bins with too few samples are drawn hatched, not hidden. Zero-build function, no DOM, tested on the synthetic data in F4. Source: Lin, Wächter, Peinke 2025, Assessing the suitability of the Langevin equation for analyzing measured data through downsampling, DOI 10.1088/2632-072x/adbba8 Evidence: W4408060900#p4.6cc6827c “where M (n)(x, t, τs) are KM conditional moments” Note: the passage gives K(n)(x, t) as the limit τs → 0 of M(n)(x, t, τs) divided by τs (its eq. 1). Evidence: W4408060900#p26.d610885d “let the drift be D(1)(x, t) = K (1)(x, t) = a and the diffusion D(2)(x, t) = K (2)(x, t) = b2” Note: the minimum count per bin is a display choice with no paper; it is a prop with a stated default, marked Source: none, exploratory (see Quote below).

F2. Chart: two panels on a shared state axis, drift (with its zero line) above diffusion, each with the estimate, its error band, and the true function from F4 drawn in a distinct style (estimate in the MEASURED style, truth in the PREDICTED style, never the same). The chart states its noise convention, Itô, inline. Source: Brückner, Broedersz 2024, Learning dynamical models of single and collective cell migration: a review, DOI 10.1088/1361-6633/ad36d2 Evidence: W4393065222#p30.9f1e3a0c “in the presence of state-dependent noise, meaning that σ(x, v) is not a constant, the inferred deterministic term depends on the chosen noise-convention” Source: Dakos et al. 2012, Methods for Detecting Early Warnings of Critical Transitions in Time Series Illustrated Using Simulated Ecological Data, DOI 10.1371/journal.pone.0041010 Evidence: W1966512215#p19.7897c253 “From the time series, however, we can estimate drift, diffusion and jump statistics that may serve as leading indicators of the transition.”

F3. Equilibrium potential panel: Ueq(x) from the true model, Ueq = U + (1−α)σ² ln μg², with α = 0 (Itô), beside the potential read off the data’s histogram, −σ² ln P(x), both shifted to a common minimum (μ and N are arbitrary shifts). Source: Quintanilha Valente, Bruni, González Arenas 2025, Effects of Multiplicative Noise in Bistable Dynamical Systems, DOI 10.3390/e27020155 Evidence: W4407082151#p6.47a45df8 “The equilibrium probability distribution over long times takes the form(7)Peq(x)=Ne−1σ2Ueq(x)” Evidence: W4407082151#p6.47a45df8 “(8)Ueq(x)=U(x)+(1−α)σ2lnμg2(x), where μ is an arbitrary scale parameter”

F4. Synthetic demo data: the bistable model U(x) = ¼x⁴ − ½x² + px with g(x) = 1 + λx² and drift f(x) = −½g²(x)U′(x), simulated with Euler–Maruyama (Itô) at a fine step from a seeded generator, then sampled at a coarser τs. Two presets: additive (λ = 0) and multiplicative (λ > 0). The data are labelled synthetic and the true functions are known, so F1 is tested against them. Source: Quintanilha Valente, Bruni, González Arenas 2025, DOI 10.3390/e27020155 Evidence: W4407082151#p8.5429dce3 “(11)U(x)=14x4−12x2+px, in which the term px breaks the parity symmetry. For the diffusion function, we choose(12)g(x)=1+λx2, where λ quantifies the multiplicative nature of the noise. For λ=0, the noise is additive.” Evidence: W4407082151#p6.47a45df8 “(5)f(x)=−12g2(x)dU(x)dx” Source: Pillonetto, Giaretta, Bisiacco 2026, Learning stochasticity via a nonparametric approach to state-dependent noise estimation, DOI 10.1038/s41467-026-75727-w Evidence: W7213410222#p82.350fd296 “trajectories are generated using the Euler–Maruyama scheme89 with a sufficiently small integration step and subsequently sampled at the coarser interval Δt” Note: the demo’s p, λ, σ, step and τs values are chosen for the picture, not from a paper: Source: none, exploratory (see Quote below).

F5. Sampling caveat: the chart prints τs and, in a (the badge stays inline, the explanation in the drawer), says that the estimates are made at a finite sampling interval and that a time series has separate sampling, correlation and jump time scales, so a coarse τs biases K(1) and K(2). Source: Lin, Wächter, Peinke 2025, DOI 10.1088/2632-072x/adbba8 Evidence: W4408060900#p4.6cc6827c "A given time series typically consists of three independent time scales: the sampling interval τs, the correlation timescale TC, and the average timescale between jumps TJ (if present)."

Quote (for the exploratory values in F1 and F4): “the exploratory version should be way more lenient”

Out of scope: jump terms (K(4), K(6)), coloured noise, Stratonovich estimates, real recordings, time-dependent drift.