unuran.cont.new {Runuran} | R Documentation |
Create a UNU.RAN continuous univariate distribution object
Description
Create a new UNU.RAN object for a continuous univariate distribution. The interface might be changed in future releases. Do not use unnamed arguments!
[Advanced] – Continuous Distribution.
Usage
unuran.cont.new( cdf=NULL, pdf=NULL, dpdf=NULL, islog=FALSE,
lb=NA, ub=NA, mode=NA, center=NA, area=NA, name=NA)
Arguments
cdf |
cumulative distribution function. (R function) |
pdf |
probability density function. (R function) |
dpdf |
derivative of the |
islog |
whether the given |
lb |
lower bound of domain;
use |
ub |
upper bound of domain;
use |
mode |
mode of distribution. (numeric) |
center |
typical point (“center”) of distribution. If
not given the |
area |
area below |
name |
name of distribution. (string) |
Details
Creates an instance of class unuran.cont
.
The user is responsible that the given informations are consistent. It depends on the chosen method which information must be given / are used.
Note
unuran.cont.new(...)
is an alias for
new("unuran.cont", ...)
.
Author(s)
Josef Leydold and Wolfgang H\"ormann unuran@statmath.wu.ac.at.
References
W. H\"ormann, J. Leydold, and G. Derflinger (2004): Automatic Nonuniform Random Variate Generation. Springer-Verlag, Berlin Heidelberg.
See Also
unuran.cont
, unuran.new
,
unuran
.
Examples
## Get a distribution object with given pdf, domain and mode
mypdf <- function (x) { exp(-x) }
distr <- unuran.cont.new(pdf=mypdf, islog=FALSE, lb=0, ub=Inf, mode=0)
## This object can now be used to create an generator object.
## 1. select a method using a Runuran function:
gen <- pinvd.new(distr, uresolution=1e-12)
## 2. directly use the UNU.RAN string API
gen <- unuran.new(distr, method="pinv; u_resolution=1e-12")