unuran-class {Runuran}R Documentation

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 R built-in uniform random number generator.

Objects from the Class

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

See unuran.new for short introduction and examples for this interface.

Methods

The class "unuran" provides the following methods for handling objects:

unuran.sample
signature(object = "unuran"): Get a random sample from the stream object.
r
signature(object = "unuran"): Same as unuran.sample.
initialize
signature(.Object = "unuran"): Initialize unuran object. (For Internal usage only).
print
signature(x = "unuran"): Print info about unuran object.
show
signature(x = "unuran"): Same as print.

Warning

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

Note

The interface has been changed compared to the DSC 2003 paper.

Author(s)

Josef Leydold and Wolfgang H"ormann unuran@statmath.wu-wien.ac.at.

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.

Examples

## 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)


[Package Runuran version 0.4 Index]