UNU.RAN - Universal Non-Uniform RANdom number generators
Other Software

UNU.RAN (Universal Non-Uniform RAndom Number generator) is a collection of algorithms for generating non-uniform pseudorandom variates as a library of C functions designed and implemented by the ARVAG (Automatic Random VAriate Generation) project group in Vienna, and released under the GNU Public License (GPL). It is especially designed for such situations where

Of course it is also well suited for standard distributions. However due to its more sophisticated programming interface it might not be as easy to use if you only look for a generator for the standard normal distribution. (Although UNU.RAN provides generators that are superior in many aspects to those found in quite a number of other libraries.)

UNU.RAN implements several methods for generating random numbers. The choice depends primary on the information about the distribution can be provided and - if the user is familar with the different methods - on the preferences of the user.

The design goals of UNU.RAN are to provide reliable, portable and robust (as far as this is possible) functions with a consisent and easy to use interface. It is suitable for all situation where experiments with different distributions including non-standard distributions. For example it is no problem to replace the normal distribution by an empirical distribution in a model.

Originally designed as a library for so called black-box or universal algorithms its interface is different from other libraries. (Nevertheless it also contains special generators for standard distributions.) It does not provide subroutines for random variate generation for particular distributions. Instead it uses an object-oriented interface. Distributions and generators are treated as independent objects. This approach allows one not only to have different methods for generating non-uniform random variates. Thus it is possible to choose the one which is optimal in for the situation (e.g. speed, quality of random numbers, using for variance reduction techniques, etc.). It also allows to sample from non-standard distribution or even from distributions that arise in a model and can only be computed in a complicated subroutine.

Sampling from a particular distribution requires the following steps:

  1. Create a distribution object. (Objects for standard distributions are available in the library)
  2. Choose a method.
  3. Initialize the generator, i.e., create the generator object. If the choosen method is not suitable for the given distribution (or if the distribution object contains too little information about the distribution) the initialization routine fails and produces an error message. Thus the generator object does (probably) not produce false results (random variates of a different distribution).
  4. Use this generator object to sample from the distribution.

For details see the online documentation.

There are four types of objects that can be manipulated independently:

The UNU.RAN Library is included in several software packages:

For remarks, problems, questions, suggestions please contact Josef Leydold.

The current version of this package can be found at the home page of the ARVAG (Automatic Random VAriate Generation) project group in Vienna.

This article is translated to Serbo-Croatian language by Jovana Milutinovich from Web Geeks Resources.

[ARVAG]     Josef Leydold   (November 17, 2009) Research supported by FWF