unuran.discr-class | R Documentation |
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.
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)
.
cumulative distribution function. (R function)
probability vector. (numeric vector)
probability mass function. (R function)
lower bound of domain;
use -Inf
if unbounded from left. (numeric, integer)
upper bound of domain;
use Inf
if unbounded from right;
when pmf
is not given, the default ub=Inf
is
used. (numeric, integer)
mode of distribution. (numeric, integer)
sum over pv
/ pmf
; used for computing
normalization constants if required. (numeric)
name of distribution. (string)
The user is responsible that the given informations are consistent. It depends on the chosen method which information must be given / are used.
Josef Leydold and Wolfgang H\"ormann unuran@statmath.wu.ac.at.
J. Leydold and W. H\"ormann (2000-2007): UNU.RAN User Manual, see https://statmath.wu.ac.at/unuran/.
unuran.discr.new
, unuran.new
,
unuran
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.