sde_expeuler_step

sde_expeuler_step#

class braintools.quad.sde_expeuler_step(df, dg, y, t, *args, **kwargs)#

One Exponential Euler step for SDEs with linearized drift.

The drift f is locally linearized and integrated exactly over one step via the exponential relative function, while the diffusion term from g is added in Euler form with Gaussian noise scaled by sqrt(dt).

As in ode_expeuler_step(), the linearization uses the column sums of the Jacobian of f, which equal its diagonal only for elementwise dynamics. Because the noise is not propagated through the exponential, the stationary variance of a linear (Ornstein–Uhlenbeck) equation is overestimated for large dt: g^2 dt / (1 - exp(-2 θ dt)) instead of g^2 / (2 θ).

Parameters:
  • df (Callable[..., PyTree]) – Drift function f(y, t, *args). Its value and vector–Jacobian product are used internally for the exponential update.

  • dg (Callable[..., PyTree]) – Diffusion function g(y, t, *args).

  • y (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Current state. Must have a floating dtype.

  • t (float | Quantity) – Current time.

  • *args – Extra arguments forwarded to df and dg.

Returns:

The updated state y_{n+1} with the same structure as y. The Brownian increment is sampled with the shape of y.

Return type:

PyTree

See also

sde_euler_step

Euler–Maruyama scheme.

sde_milstein_step

Milstein scheme (strong order 1.0).

Notes

  • Uses dt = brainstate.environ.get('dt') for the step size.

  • Requires floating dtypes for y (float16/32/64 or bfloat16).

  • Unit consistency is validated using brainunit; a mismatch between the drift update and diffusion units raises a ValueError.