Learn R Programming

Runuran (version 0.21.0)

unuran.discr-class: Class "unuran.discr" for Discrete Distribution

Description

Class unuran.discr provides an interface to UNU.RAN objects for discrete distributions. The interface might be changed in future releases. Do not use unnamed arguments! [Advanced] -- Discrete Distribution Object.

Arguments

Details

Create a new instance of a unuran.discr object using

new ("unuran.discr", cdf=NULL, pv=NULL, pmf=NULL, lb=NA, ub=NA, mode=NA, sum=NA, name=NA).

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

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

References

J. Leydold and W. H"ormann (2000-2007): UNU.RAN User Manual, see http://statmath.wu.ac.at/unuran/.

See Also

unuran.discr.new, unuran.new, unuran.

Examples

Run this code
## Create discrete distribution with given probability vector
## (the PV need not be normalized)
pv <- c(1.,2.,1.5,0.,3.,1.2)     
dpv <- new("unuran.discr", pv=pv, lb=1)

## Create discrete distribution with given PMF
pmf <- function(x) dbinom(x,100,0.3)
dpmf <- new("unuran.discr",pmf=pmf,lb=0,ub=100)

Run the code above in your browser using DataLab