2.4.5. sdepy.integrate

sdepy.integrate(sde=None, *, q=None, sources=None, log=False, addaxis=False)[source]

Decorator for Ito Stochastic Differential Equation (SDE) integration.

Decorates a function representing the SDE or SDEs into the corresponding integrator (a subclass of SDE or SDEs and of integrator).

Parameters:
sde : function

Function to be wrapped. Its signature and values should be as expected for the sde method of the SDE or SDEs classes.

q : int

Number of equations. If None, attempts a test evaluation of sde to find out.

sources : set

Stochasticity sources used in the equation. If None, attempts a test evaluation of sde to find out.

log : bool

Sets the log attribute for the wrapping class.

addaxis : bool

Sets the addaxis attribute for the wrapping class.

Examples

>>> from sdepy import integrate
>>> @integrate
... def my_process(t, x, theta=1., k=1., sigma=1.):
...     return {'dt': k*(theta - x), 'dw': sigma}
>>> P = my_process(x0=1, sigma=0.5, paths=100*1000, steps=100)
>>> x = P(timeline=(0., 0.5, 1.))
>>> x.shape
(3, 100000)