2.3.8. sdepy.true_source

class sdepy.true_source(*, paths=1, vshape=(), dtype=None, rtol='max', t0=0.0, z0=0.0)[source]

Base class for stochasticity sources with memory.

Parameters:
paths, vshape, dtype

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 to max, the resolution of the float 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 time t of the source process, such that dz(t0) = z0, with shape (t + dt).shape + vshape + (paths,), as specified by subclasses. dz(t, dt) returns dz(t + dt) - dz(t). New values of dz(t) should follow a probability distribution conditional on values realized in previous calls. Defaults to an array of numpy.nan.

See also

source
Attributes:
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.