3.3.8. sdepy.true_source¶
-
class
sdepy.
true_source
(*, paths=1, vshape=(), dtype=None, rng=None, rtol='max', t0=0.0, z0=0.0)[source]¶ Base class for stochasticity sources with memory.
Parameters: - paths, vshape, dtype, rng
See
source
class documentation.- rtol : float, or ‘max’
relative tolerance used in assessing the coincidence of
t
with the time of a previously stored realization of the source. If set tomax
, the resolution of thefloat
type is used.- t0, z0 : array-like
z0 is the initial value of the source at time t0.
Returns: - array
Once instantiated as
dz
,dz(t)
returns the realized value at timet
of the source process, such thatdz(t0) = z0
, with shape(t + dt).shape + vshape + (paths,)
, as specified by subclasses.dz(t, dt)
returnsdz(t + dt) - dz(t)
. New values ofdz(t)
should follow a probability distribution conditional on values realized in previous calls. Defaults to an array ofnumpy.nan
.
See also
Attributes: rng
Read-only access to the random number generator used by the stochasticity source.
size
Returns the number of stored scalar values from previous evaluations, or 0 for sources without memory.
t
Returns a copy of the time points at which source values have been stored from previous evaluations, as an array, or an empty array for sources without memory.
Methods
__getitem__
(index)Reference to a sub-array or element of the source values sharing the same memory of past realizations. new_inside
(z1, z2, t1, t2, s)Generate a new process increment, at a time s between those of formerly realized values. new_outside
(z, t, s)Generate a new process increment, at a time s above or below those of formerly realized values.