3.3.3. sdepy.poisson_source¶
-
class
sdepy.poisson_source(*, paths=1, vshape=(), dtype=<class 'int'>, rng=None, lam=1.0)[source]¶ dn, a source of Poisson process increments.
Parameters: - paths : int
Number of paths (last dimension) of the source realizations.
- vshape : tuple of int
Shape of source values.
- dtype : data-type
Data type of source values. Defaults to
int.- rng : numpy.random.Generator, or numpy.random.RandomState, or None
Random numbers generator used. If
None, defaults tosdepy.infrastructure.default_rng, a global variabile initialized on import tonumpy.random.default_rng().- lam : array-like, or callable
Intensity of the Poisson process, possibly time-dependent. Should be an array of non-negative values, broadcastable to shape
vshape + (paths,), or a callable withlam(t)evaluating to such array.
Returns: - array
Once instantiated as
dn,dn(t, dt)returns a random realization of Poisson process increments from timetto timet + dt, with shape(t + dt).shape + vshape + (paths,). The increments are independent Poisson variates with meanlam*dt, orlam(t + dt/2)*dt(the latter approximates the integral oflam(t)fromttot + dt).
See also
Attributes: rngRead-only access to the random number generator used by the stochasticity source.
sizeReturns the number of stored scalar values from previous evaluations, or 0 for sources without memory.
tReturns 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
__call__(t, dt)See poisson_source class documentation.