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 valuex[i]orv[i].
See also
Notes
Parameters
t,x,v,dtypeconform to theprocessinstantiation interface and shape requirements.The returned process
pbehaves as advertised upon interpolation with default interpolation kind (set to'nearest'via theinterp_kindattribute), and may be used as a time dependent piecewise constant parameter in SDE integration. However, its timelinep.tand valuesp.xare not guaranteed to coincide with the giventorx, and should not be relied upon.