Daniel Waxman
Basis Research Institute & MIT
Joint/ongoing work with



MLDS Seminar
November 5th, 2026

dynestyx is a probabilistic programming
library for dynamical systems (DW et al., 2026)Waxman, D., Batenkov, D., Feser, J., Zane, A., Bingham, E., Marzouk, Y., & Levine, M. E. (2026). Dynestyx: A probabilistic programming library for dynamical systems (arXiv:2606.16985). arXiv. https://doi.org/10.48550/arXiv.2606.16985
\[ x_t \sim \overbrace{p(x_t \mid x_{t-1})}^{\text{transition density}} \quad\text{or}\quad \mathrm{d}x_t = \overbrace{f(x_t, t)\,\mathrm{d}t}^{\text{drift}} + \overbrace{g(x_t, t)\,\mathrm{d}W_t}^{\text{diffusion}} \]
\[ y_t \sim p(y_t \mid x_t) \]
\[ x_t \sim \overbrace{p_{\textcolor{#2A9DF4}{\theta}}(x_t \mid x_{t-1})}^{\text{transition density}} \quad\text{or}\quad \mathrm{d}x_t = \overbrace{f_{\textcolor{#2A9DF4}{\theta}}(x_t, t)\,\mathrm{d}t}^{\text{drift}} + \overbrace{g_{\textcolor{#2A9DF4}{\theta}}(x_t, t)\,\mathrm{d}W_t}^{\text{diffusion}} \]
\[ y_t \sim p_{\textcolor{#2A9DF4}{\theta}}(y_t \mid x_t) \]
\[ x_t \sim \overbrace{p_{\textcolor{#2A9DF4}{\theta}}(x_t \mid x_{t-1}, \textcolor{#E64B35}{u_t})}^{\text{transition density}} \quad\text{or}\quad \mathrm{d}x_t = \overbrace{f_{\textcolor{#2A9DF4}{\theta}}(x_t, \textcolor{#E64B35}{u_t}, t)\,\mathrm{d}t}^{\text{drift}} + \overbrace{g_{\textcolor{#2A9DF4}{\theta}}(x_t, t)\,\mathrm{d}W_t}^{\text{diffusion}} \]
\[ y_t \sim p_{\textcolor{#2A9DF4}{\theta}}(y_t \mid x_t, \textcolor{#E64B35}{u_t}) \]

A Probabilistic Programming Language
dynestyx is a library that lets us
perform each of these inference tasks
dynestyx model from the ground updynestyx
model together; remember, we write down the idealized versiondef model(obs_times=None, obs_values=None, predict_times=None):
dynamics = dsx.DynamicalModel(
initial_condition=dist.MultivariateNormal(
jnp.zeros(1), jnp.eye(1)),
state_evolution=dsx.ContinuousTimeStateEvolution(
drift=lambda x, u, t: jnp.sin(x),
diffusion=dsx.ScalarDiffusion(1.0, bm_dim=1),
),
observation_model=dsx.LinearGaussianObservation(
H=jnp.eye(1), R=0.1**2 * jnp.eye(1)),
)
dsx.sample("f", dynamics, obs_times=obs_times,
obs_values=obs_values, predict_times=predict_times)
dynestyx model from the ground updef model(obs_times=None, obs_values=None, predict_times=None):
alpha = numpyro.sample("alpha", dist.HalfNormal(0.5))
dynamics = dsx.DynamicalModel(
initial_condition=dist.MultivariateNormal(
jnp.zeros(1), jnp.eye(1)),
state_evolution=dsx.ContinuousTimeStateEvolution(
drift=lambda x, u, t: alpha * jnp.sin(x),
diffusion=dsx.ScalarDiffusion(1.0, bm_dim=1),
),
observation_model=dsx.LinearGaussianObservation(
H=jnp.eye(1), R=0.1**2 * jnp.eye(1)),
)
dsx.sample("f", dynamics, obs_times=obs_times,
obs_values=obs_values, predict_times=predict_times)
with dsx.Simulator():
sim = Predictive(model, num_samples=1)(key, predict_times=ts)
\[ p(\textcolor{#2A9DF4}{\theta} \mid y_{1:T}) \propto p(\textcolor{#2A9DF4}{\theta})\, p(y_{1:T} \mid \textcolor{#2A9DF4}{\theta}) \]
← already hard! classical Bayesian inference
\[ p(y_{1:T} \mid \textcolor{#2A9DF4}{\theta}) = \prod_{k=1}^{T} p(y_k \mid y_{1:k-1}, \textcolor{#2A9DF4}{\theta}) \]
← but where do these come from?
\[ p(y_{1:T} \mid \textcolor{#2A9DF4}{\theta}) = \int \textcolor{#222222}{p(x_0)} \prod_{k=1}^{T} \textcolor{#00897B}{p_\theta(y_k \mid x_k)}\, \textcolor{#E64B35}{p_\theta(x_k \mid x_{k-1})}\, \mathrm{d}x_{0:T} \]
Duffield, S., Iqbal, S., & Corenflos, A. (2026). cuthbert [Computer software]. https://github.com/state-space-models/cuthbert
Computation via “unrolling”
\[ p(y_{1:T} \mid \textcolor{#2A9DF4}{\theta}) = \int \textcolor{#222222}{p(x_0)} \prod_{k=1}^{T} \textcolor{#00897B}{p_\theta(y_k \mid x_k)}\, \textcolor{#E64B35}{p_\theta(x_k \mid x_{k-1})}\, \mathrm{d}x_{0:T} \]
dynestyx, we call this a
LatentPathBuilderwith LatentPathBuilder():
with Discretizer(LocalLinearizationConfig()):
mcmc = MCMC(NUTS(model), num_warmup=500,
num_samples=1_000)
mcmc.run(key, obs_times, obs_values)

Computation via filtering
\[ p(y_{1:T} \mid \textcolor{#2A9DF4}{\theta}) = \prod_{k=1}^{T} \int \textcolor{#00897B}{p_\theta(y_k \mid x_k)}\, p_\theta(x_k \mid y_{1:k-1})\, \mathrm{d}x_k \]
with Filter(ContinuousTimeEKFConfig()):
mcmc = MCMC(NUTS(model), num_warmup=500,
num_samples=1_000)
mcmc.run(key, obs_times, obs_values)

Andrieu, C., & Roberts, G. O. (2009). The pseudo-marginal approach for efficient Monte Carlo computations. The Annals of Statistics, 37(2), 697–725. https://doi.org/10.1214/07-AOS574
Andrieu, C., Doucet, A., & Holenstein, R. (2010). Particle Markov chain Monte Carlo methods. Journal of the Royal Statistical Society Series B: Statistical Methodology, 72(3), 269–342. https://doi.org/10.1111/j.1467-9868.2009.00736.x
Variational inference
\[ p(y_{1:T} \mid \textcolor{#2A9DF4}{\theta}) = \prod_{k=1}^{T} \int \textcolor{#00897B}{p_\theta(y_k \mid x_k)}\, p_\theta(x_k \mid y_{1:k-1})\, \mathrm{d}x_k \]
with Filter(ContinuousTimeEKFConfig()):
guide = AutoNormal(model)
svi = SVI(model, guide, optax.adam(1e-2),
loss=Trace_ELBO())
result = svi.run(key, 2_000, obs_times, obs_values)

Tran, M.-N., Nott, D. J., & Kohn, R. (2017). Variational Bayes with intractable likelihood. Journal of Computational and Graphical Statistics, 26(4), 873–882. https://doi.org/10.1080/10618600.2017.1330205
\(\phi\sim p(\phi),\qquad \textcolor{#2A9DF4}{\theta^{(n)}}\sim p\big(\theta^{(n)}\mid\phi\big),\qquad n=1,\dots,N\)
\(x^{(n)}_0\sim p_{\textcolor{#2A9DF4}{\theta^{(n)}},\phi}(x_0),\qquad x^{(n)}_t\sim p_{\textcolor{#2A9DF4}{\theta^{(n)}},\phi}\big(x_t\mid x^{(n)}_{t-1}\big),\qquad y^{(n)}_t\sim p_{\textcolor{#2A9DF4}{\theta^{(n)}},\phi}\big(y_t\mid x^{(n)}_t\big)\)
\(\displaystyle \log p\big(y^{(1:N)}_{1:T}\mid\textcolor{#2A9DF4}{\theta^{(1:N)}},\phi\big)=\sum_{n=1}^{N}\underbrace{\log p\big(y^{(n)}_{1:T}\mid\textcolor{#2A9DF4}{\theta^{(n)}},\phi\big)}_{\text{one filter per individual}}\)
Example: the sine SDE from before, with \(\textcolor{#2A9DF4}{\theta^{(n)}}=\big(\alpha^{(n)},\mu_0^{(n)}\big)\) and \(\phi=\big(\mu_{\mathrm g},\sigma,\mu_{0,\mathrm g},\sigma_0\big)\)
mu_g = numpyro.sample('mu_global', dist.Normal(0., .5))
sigma = numpyro.sample('sigma', dist.HalfNormal(.5))
with dsx.plate('individuals', N):
alpha = jnp.exp(numpyro.sample('log_alpha', dist.Normal(mu_g, sigma)))
mu0 = numpyro.sample('mu0', dist.Normal(mu0_g, sigma0))
sine = make_sine(alpha, initial_mean=mu0, initial_cov=s0**2)
return dsx.sample('x', sine, **data)


An example with discretization
Continuous-time EKF
Euler–Maruyama
Local linearization
Ensemble Kalman filter
Variational inference
\(\textcolor{#2A9DF4}{\alpha} \sim \mathrm{HalfNormal}(0.5)\)
\(x_0 \sim \mathcal{N}(0, 1)\)
\(\mathrm{d}x_t = \textcolor{#2A9DF4}{\alpha} \sin(x_t)\,\mathrm{d}t + \mathrm{d}W_t\)
\(y_t \sim \mathcal{N}(x_t, 0.1^2)\)
\(x_{k+1} \mid x_k \sim \mathcal{N}\big(x_k + \textcolor{#2A9DF4}{\alpha} \sin(x_k)\,\Delta t,\; \Delta t\big)\)
\(J_k = \textcolor{#2A9DF4}{\alpha} \cos(x_k)\)
\(x_{k+1} \mid x_k \sim \mathcal{N}\Big(x_k + \tfrac{e^{J_k \Delta t} - 1}{J_k}\, \textcolor{#2A9DF4}{\alpha} \sin(x_k),\; \tfrac{e^{2 J_k \Delta t} - 1}{2 J_k}\Big)\)
with Filter(ContinuousTimeEKFConfig()):
mcmc = MCMC(NUTS(model), num_warmup=500,
num_samples=1_000)
mcmc.run(key, obs_times, obs_values)
with Filter(EKFConfig()):
with Discretizer(EulerMaruyamaConfig()):
mcmc = MCMC(NUTS(model), num_warmup=500,
num_samples=1_000)
mcmc.run(key, obs_times, obs_values)
with Filter(EKFConfig()):
with Discretizer(LocalLinearizationConfig()):
mcmc = MCMC(NUTS(model), num_warmup=500,
num_samples=1_000)
mcmc.run(key, obs_times, obs_values)
with Filter(ContinuousTimeEnKFConfig()):
mcmc = MCMC(NUTS(model), num_warmup=500,
num_samples=1_000)
mcmc.run(key, obs_times, obs_values)
with Filter(ContinuousTimeEnKFConfig()):
guide = AutoNormal(model)
svi = SVI(model, guide, optax.adam(1e-2),
loss=Trace_ELBO())
result = svi.run(key, 300,
obs_times, obs_values)





Multiple models for a running example
\(\displaystyle \frac{\mathrm{d}x_i}{\mathrm{d}t}=r_i\,x_i\Big(1-\sum_{j=1}^{4}a_{ij}\,x_j\Big),\qquad i=1,\dots,4\)
Lotka, A. J. (1925). Elements of physical biology. Williams & Wilkins.
Volterra, V. (1926). Fluctuations in the abundance of a species considered mathematically. Nature, 118(2972), 558–560. https://doi.org/10.1038/118558a0
Vano, J. A., Wildenberg, J. C., Anderson, M. B., Noel, J. K., & Sprott, J. C. (2006). Chaos in low-dimensional Lotka–Volterra models of competition. Nonlinearity, 19(10), 2391–2404. https://doi.org/10.1088/0951-7715/19/10/006
\(y_t \mid x_t \sim \mathcal{N}\!\left(x_t,\,0.05^2 I_4\right)\)
\(x_t\): log-abundances of four competing species (Vano et al., 2006)
layers = sample_layers() # Gaussian priors
dynamics = dsx.ContinuousTimeStateEvolution(
drift=lambda x, u, t: mlp(layers, x),
diffusion=dsx.ScalarDiffusion(0.01, bm_dim=4),
)
Vano, J. A., Wildenberg, J. C., Anderson, M. B., Noel, J. K., & Sprott, J. C. (2006). Chaos in low-dimensional Lotka–Volterra models of competition. Nonlinearity, 19(10), 2391–2404. https://doi.org/10.1088/0951-7715/19/10/006
A Bayesian version of SINDy (Brunton et al., 2016; Hirsh et al., 2022).
The library is nearly collinear here: good filtering, mechanism not identified
theta = numpyro.sample("theta",
dist.Laplace(0, .5).expand((4, 15)).to_event(2))
dynamics = dsx.ContinuousTimeStateEvolution(
drift=lambda x, u, t: theta @ library(x),
diffusion=dsx.ScalarDiffusion(.005, bm_dim=4))
guide = AutoLowRankMultivariateNormal(
filtered_model, **guide_init)
Brunton, S. L., Proctor, J. L., & Kutz, J. N. (2016). Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proceedings of the National Academy of Sciences, 113(15), 3932–3937. https://doi.org/10.1073/pnas.1517384113
Hirsh, S. M., Barajas-Solano, D. A., & Kutz, J. N. (2022). Sparsifying priors for Bayesian uncertainty quantification in model discovery. Royal Society Open Science, 9(2), Article 211823. https://doi.org/10.1098/rsos.211823
True system (Vano et al., 2006)
\(\displaystyle \mathrm{d}\log x_i=r_i\Big(1-\sum_{j=1}^{4}a_{ij}\,x_j\Big)\,\mathrm{d}t+\sigma\,\mathrm{d}W_i\)
\(i=1,\dots,4,\quad a_{ii}=1,\quad \sigma=0.01\)
Hybrid model
\(\displaystyle \mathrm{d}\log x_i=\textcolor{#00897B}{r_i}\Big(1-\underbrace{x_i}_{\text{known self-limitation}}-\underbrace{\textcolor{#00897B}{c_{\theta,i}(\mathbf x_{-i})}}_{\text{learned competition}}\Big)\,\mathrm{d}t+\sigma\,\mathrm{d}W_i\)
\(\log\mathbf y_k\mid\mathbf x(t_k)\sim\mathcal N\!\left(\log\mathbf x(t_k),\sigma_y^2 I\right)\)
Vano, J. A., Wildenberg, J. C., Anderson, M. B., Noel, J. K., & Sprott, J. C. (2006). Chaos in low-dimensional Lotka–Volterra models of competition. Nonlinearity, 19(10), 2391–2404. https://doi.org/10.1088/0951-7715/19/10/006
Solin, A., & Särkkä, S. (2020). Hilbert space methods for reduced-rank Gaussian process regression. Statistics and Computing, 30(2), 419–446. https://doi.org/10.1007/s11222-019-09886-w
r = numpyro.sample("r", dist.LogNormal(0., .5).expand((4,)).to_event(1))
c = sample_hsgp() # GP prior for the competition
dynamics = dsx.ContinuousTimeStateEvolution(
drift=lambda logx, u, t: r * (1 - jnp.exp(logx) - c(jnp.exp(logx))),
diffusion=dsx.ScalarDiffusion(0.01, bm_dim=4))
guide = AutoMultivariateNormal(filtered_model, **guide_init)
Other features
\(\partial_t\omega+\mathbf u\cdot\nabla\omega=\nu\,\Delta\omega+\lambda\,\omega+f,\qquad\mathbf u=\nabla^\perp\Delta^{-1}\omega\)
\(\mathbf y_k=G\,\omega(t_k)+\boldsymbol\varepsilon_k\)
\(x_{t+1}=A\,x_t+B\,u_t+w_t,\qquad y_t=C\,x_t+v_t\)
\((A,B,C)\;\mapsto\;(TAT^{-1},\,TB,\,CT^{-1})\) gives the same likelihood
NUTS on \((A,B,C)\): 26 min, \(\hat R = 2.39\)
\(A_c=\begin{bmatrix}0&1\\-\alpha_0&-\alpha_1\end{bmatrix},\quad B_c=\begin{bmatrix}0\\1\end{bmatrix},\quad C_c\ \text{free}\)
Bryutkin, A., Levine, M. E., Urteaga, I., & Marzouk, Y. (2025). Canonical Bayesian linear system identification (arXiv:2507.11535). arXiv. https://doi.org/10.48550/arXiv.2507.11535
alpha = numpyro.sample("alpha", pole_prior(d))
C = numpyro.sample("C",
dist.Normal(.5, 1).expand((1, d)).to_event(2))
dynamics = dsx.LTI_discrete(
A=companion(alpha), B=e_d, H=C, Q=Q, R=R)
with dsx.Filter(KFConfig()):
mcmc = MCMC(NUTS(model), num_warmup=500,
num_samples=1000)
Full: 26 min, \(\hat R = 2.39\)
Canonical: 0.9 min, \(\hat R = 1.00\)
~20× ESS/s on eigenvalues
policy = SwarmController(layouts, target) # PI + attraction-repulsion
result = dsx.simulate(dynamics, predict_times=times, control_policy=policy,
filter_config=PFConfig(filter_source="cuthbert"))
True cube
Filter belief

Drovandi, C., Everitt, R. G., Golightly, A., & Prangle, D. (2022). Ensemble MCMC: Accelerating pseudo-marginal MCMC for state space models using the ensemble Kalman filter. Bayesian Analysis, 17(1). https://doi.org/10.1214/20-BA1251
Chen, Y., Sanz-Alonso, D., & Willett, R. (2022). Autodifferentiable ensemble Kalman filters. SIAM Journal on Mathematics of Data Science, 4(2), 801–833. https://doi.org/10.1137/21M1434477
| Sampler | Time | ESS / s | max \(\hat{R}\) | E-BFMI |
|---|---|---|---|---|
| particle MCMC | 260 s | 0.016 | 6.03 | – |
| ensemble MCMC | 120 s | 0.038 | 2.93 | – |
| ensemble NUTS | 1703 s | 0.22 | 1.02 | 0.88 |
Adrian, M., Sanz-Alonso, D., & Willett, R. (2026). Auto-differentiable data assimilation: Co-learning of states, dynamics, and filtering algorithms (arXiv:2603.20891). arXiv. https://doi.org/10.48550/arXiv.2603.20891
dynestyx gives an API for proper scoring rules, and is
compatible with learning of filters (related to Bach et al., 2026)!Bach, E., Baptista, R., Bröcker, J., Chen, B., & Stuart, A. (2026). Learning probabilistic filters with strictly proper scoring rules (arXiv:2606.26497). arXiv. https://doi.org/10.48550/arXiv.2606.26497
dynestyx provides the state-of-the-art in inference for practitioners to use, helping to close a gap between theory and applicationdynestyx creates implies new algorithms, and an avenue for applying new methodsdanwaxman.github.io
dwaxman@mit.edu
dynestyx

Paper

GitHub