patrick-kidger / diffrax

Numerical differential equation solvers in JAX. Autodifferentiable and GPU-capable. https://docs.kidger.site/diffrax/
Apache License 2.0
1.36k stars 124 forks source link

Simulate SDE with white noise? #334

Open jakeyeung opened 9 months ago

jakeyeung commented 9 months ago

Hi,

I was wondering if it's possible to simulate SDEs using white noise, rather than the brownian motion (e.g. brownian_motion = VirtualBrownianTree(t0, t1, tol=1e-3, shape=(), key=jrandom.PRNGKey(0))) shown in the docs?

I searched around the github but did not see any functions related to white noise.

Kindest regards,

Jake

patrick-kidger commented 9 months ago

Hey there! What does "simulate an SDE using white noise" mean to you? What precise numerical opertion are you looking to describe?

(For context, I usually think of white noise as being "the derivative of Brownian motion". So formally, it is the X given by (X, φ) = - integral w(t) φ'(t) dt, using integration by parts to move the derivative on to the actually-differentiable test function.)

jakeyeung commented 9 months ago

Hi,

Yes I am thinking of white noise as the derivative of Brownian motion.

Practically, I would like to compare SDEs simulated with Brownian motion (where 95% quantiles increase proportionally to square root of time) versus with white noise (95% quantiles are constant over time). I was wondering how to do that with diffrax.

patrick-kidger commented 9 months ago

Do you have a reference for the mathematical operation you're trying to perform?