Programs in Physics & Physical Chemistry
|[Licence| Download | New Version Template] aaxt_v1_0.gz(8 Kbytes)|
|Manuscript Title: Algorithms for random sampling from single-variate distributions.|
|Authors: F. Salvat|
|Program title: SUBROUTINE PACKAGE SAMPLE|
|Catalogue identifier: AAXT_v1_0|
Distribution format: gz
|Journal reference: Comput. Phys. Commun. 46(1987)427|
|Programming language: Fortran.|
|Computer: IBM 3083 XE.|
|Operating system: VM/SP CMS.|
|RAM: 117K words|
|Word size: 8|
|Keywords: General purpose, Statistical methods, Random sampling, Generation of random deviates, Monte Carlo method, Acceptance-rejection method, Simulation.|
Nature of problem:
This subroutine package allows generation of random deviates from discrete, step-wise and continuous single-variate distributions.
Random sampling from discrete distributions is performed using a modification of Walker's procedure which also provides the basis for a fast generation from step-wise distributions. Step-wise functions are adopted to set up a series of acceptance-rejection procedures, as well as approximate sampling methods, for continuous distributions.
The distributions must have finite domain, otherwise the domain has to be truncated for computational purposes.
Generation of a random value takes 17 msec for a discrete distribution and 22 msec for a step-wise distribution. These times are practically independent of the distribution. The time consumed to sample a random deviate from a continuous distribution depends to a great extent on the characteristics of the distribution (about 55 msec for an expotential distribution).
|Disclaimer | ScienceDirect | CPC Journal | CPC | QUB|