Learn R Programming

Runuran (version 0.5)

unuran-class: Class "unuran" -- Universal Non-Uniform RANdom variate generators

Description

The class "unuran" provides am interface to the UNU.RAN library for universal non-uniform random number generators. It uses the Rbuilt-in uniform random number generator.

Arguments

Objects from the Class

Objects can be created by calls of the form new("unuran", distribution, method).

  • distribution:
{A character string that describes the target distribution (see UNU.RAN User Manual) or one of the S4 classes "unuran.discr", "unuran.cont" or "unuran.cmv" that holds information about the distribution.} method:{A character string that describes the chosen generation method, see UNU.RAN User Manual. If omitted method "auto" (automatic) is used.}

Warning

"unuran" objects cannot be saved and restored in later Rsessions. They must be newly created!

References

J. Leydold and W. H"ormann (2000-2007): UNU.RAN User Manual, see http://statmath.wu-wien.ac.at/unuran/. W. H"ormann, J. Leydold, and G. Derflinger (2004): Automatic Nonuniform Random Variate Generation. Springer-Verlag, Berlin Heidelberg

G. Tirler and J. Leydold (2003): Automatic Nonuniform Random Variate Generation in R. In: K.~Hornik and F.~Leisch, Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC~2003), March 20--22, Vienna, Austria.

See Also

unuran.new and unuran.sample for faster creation and sampling routines, unuran.cont and unuran.discr for classes that contain information about continuous univariate and discrete distributions, resp.

Examples

Run this code
## create a new unuran object
unr <- new("unuran","normal","auto")

## alternatively one can use
unr <- unuran.new("normal","auto")

## get random number
unuran.sample(unr)

## get a random sample of size 10
unuran.sample(unr,10)

## use command r
r(unr)

Run the code above in your browser using DataLab