2.2.2. sdepy.piecewise

sdepy.piecewise(t=0.0, *, x=None, v=None, dtype=None, mode='mid')[source]

Return a process that interpolates to a piecewise constant function.

Parameters:
t : array-like

Reference timeline (see below).

x : array-like, optional

Values of the process along the timeline and across paths. One and only one of x, v, must be provided, as a keyword argument.

v : array-like, optional

Values of a deterministic (one path) process along the timeline.

dtype : data-type, optional

Data-type of the values of the process.

mode : string, optional

Specifies how the piecewise constant segments relate to the reference timeline: ‘mid’, ‘forward’, ‘backward’ set t[i] to be the midpoint, start or end point respectively, of the constant segment with value x[i] or v[i].

See also

process

Notes

Parameters t, x, v, dtype conform to the process instantiation interface and shape requirements.

The returned process p behaves as advertised upon interpolation with default interpolation kind (set to 'nearest' via the interp_kind attribute), and may be used as a time dependent piecewise constant parameter in SDE integration. However, its timeline p.t and values p.x are not guaranteed to coincide with the given t or x, and should not be relied upon.