systems.base.numerical_integration.stochastic.create_custom_or_random_brownian

systems.base.numerical_integration.stochastic.create_custom_or_random_brownian(
    key,
    t0,
    t1,
    shape,
    dW=None,
)

Create either custom or random Brownian motion for Diffrax.

Parameters

Name Type Description Default
key jax.random.PRNGKey Random key (used if dW is None) required
t0 ScalarLike Start time required
t1 ScalarLike End time required
shape tuple Noise shape (nw,) required
dW Optional[ArrayLike] Custom Brownian increment. If None, generates random. None

Returns

Name Type Description
Brownian motion object for Diffrax

Examples

>>> # Random noise
>>> key = jax.random.PRNGKey(42)
>>> brownian = create_custom_or_random_brownian(key, 0, 0.01, (1,))
>>>
>>> # Custom noise (deterministic)
>>> dW = jnp.array([0.5])
>>> brownian = create_custom_or_random_brownian(key, 0, 0.01, (1,), dW=dW)