unuran.cont-class {Runuran}R Documentation

Experimental class "unuran.cont"

Description

The class "unuran.cont" provides am interface to UNU.RAN objects for continuous distributions. The interface might be changed in future releases. Do not use unnamed arguments!

Details

Create a new instance of an "unuran.cont" object using

new ("unuran.cont", cdf=NULL, pdf=NULL, dpdf=NULL, islog=TRUE, lb=-Inf, ub=Inf).

cdf
cumulative distribution function. (R function)
pdf
probability density function. (R function)
dpdf
derivative of the pdf. (R function)
islog
whether the given cdf and pdf are given by their logarithms (the dpdf is then the derivative of the logarithm). (boolean)
lb, ub
lower and upper bound of domain. (numeric)

The user is responsible that the given informations are consistent. It depends on the chosen method which information must be given / are used.

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/.

See Also

unuran, unuran.new.

Examples

## Create discrete distribution with given probability density function
pdf <- function (x) { -0.5*x^2 }
dpdf <- function (x) { -x }
distpdf <- new("unuran.cont", pdf=pdf, dpdf=dpdf)
## Make generator (using method TDR)
unr <- unuran.new(distpdf, "tdr")
## Draw sample of size 100
x <- unuran.sample(unr, 100)


[Package Runuran version 0.7 Index]