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).

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

  • dg (Callable[[PyTree, float | Quantity, ...], 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. The first extra argument is used solely to determine the shape for random.randn_like when sampling the diffusion noise.

Returns:

The updated state y_{n+1} with the same structure as 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.