birdepy.gpu_functions.discrete()

birdepy.gpu_functions.discrete(param, model, z0, t, k=1, survival=False, seed=None)

Simulation of continuous-time birth-and-death processes at time ‘t’ using CUDA.

Parameters:
  • param (array_like) – The parameters governing the evolution of the birth-and-death process to be simulated. Array of real elements of size (m,), where ‘m’ is the number of parameters. These must be in the order given here).

  • model (string) –

    Model specifying birth and death rates of process (see here). Should be one of:

    • ’Verhulst’ (default)

    • ’Ricker’

    • ’Hassell’

    • ’MS-S’

    • ’Moran’

    • ’pure-birth’

    • ’pure-death’

    • ’Poisson’

    • ’linear’

    • ’linear-migration’

    • ’M/M/1’

    • ’M/M/inf’

    • ’loss-system’

    Custom models are not available for this function. See birdepy.simulate.discrete() for custom models.

  • z0 (int or callable) – The initial population size for each sample path.

  • t (scalar) – The time at which the simulated birth-and-death is observed.

  • k (int, optional) – The number of sample paths to be simulated.

  • survival (bool, optional) – If set to True, then the simulated sample paths are conditioned to have a positive population size at the final observation time. Since This can greatly increase computation time.

  • seed (int, optional) – Seed for simulation.

Returns:

out – A list containing sampled population size observations at time t, generated according to model.

Return type:

array_like

Examples

Simulating 10 ** 8 sample paths of an M/M/inf queue with service rates 0.4 and arrival rate 0.2, with 10 items initially in the queue, observed at time 1.0:

from birdepy import gpu_functions as bdg
bdg.discrete([0.2, 0.4], 'M/M/inf', 10, 1.0, k=10**8)
             array([8, 6, 3, ..., 8, 7, 9], dtype=int64)

Notes

This function requires a compatible Nvidia graphics processing unit and drivers to be installed.

The packages Numba and cudatoolkit also need to be installed.

If you use this function for published work, then please cite [1].

Sample paths are generated using a discrete-event simulation algorithm. See, for example, Algorithm 5.8 in [2].

For a text book treatment on the theory of birth-and-death processes see [3].

References

[View birdepy.gpu_functions.discrete() source code]