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
fis locally linearized and integrated exactly over one step via the exponential relative function, while the diffusion term fromgis added in Euler form with Gaussian noise scaled bysqrt(dt).- Parameters:
df (
Callable[[PyTree,float|Quantity,...],PyTree]) – Drift functionf(y, t, *args). Its value and vector–Jacobian product are used internally for the exponential update.dg (
Callable[[PyTree,float|Quantity,...],PyTree]) – Diffusion functiong(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
dfanddg. The first extra argument is used solely to determine the shape forrandom.randn_likewhen sampling the diffusion noise.
- Returns:
The updated state
y_{n+1}with the same structure asy.- Return type:
PyTree
See also
sde_euler_stepEuler–Maruyama scheme.
sde_milstein_stepMilstein 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 aValueError.