This function creates a unuran
object based on “ITDR”
(Inverse Transformed Density Rejection). It can be used to draw samples of a
continuous random variate with given probability density function
using ur
.
The density pdf
must be positive but need not be normalized
(i.e., it can be any multiple of a density function).
The algorithm is especially designed for distributions with unbounded
densities. Thus the algorithm needs the position of the pole
.
Moreover, the given function must be monotone on its domain.
The derivative dpdf
is essential. (Numerical derivation does
not work as it results in serious round-off errors.)
Alternatively, one can use function itdrd.new
where the object
distr
of class "unuran.cont"
must contain all required
information about the distribution.
The setup time of this method depends on the given PDF, whereas its
marginal generation times are almost independent of the target
distribution.