This function creates a unuran object based on ‘SROU’
(Simple Ratio-Of-Uniforms Method). 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).
It must be \(T_c\)-concave for
\(c = -r/(r+1)\); this includes all log-concave
distributions.
The (exact) location of the mode and the area below
the pdf are essential.
Alternatively, one can use function sroud.new where the object
distr of class "unuran.cont" must contain all required
information about the distribution.
The acceptance probability decreases with increasing parameter
r. Thus it should be as small as possible. On the other hand it
must be sufficiently large for heavy tailed distributions.
If possible, use the default r=1.
Compared to tdr.new it has much slower marginal
generation times but has a faster setup and is numerically more
robust. Moreover, It also works for unimodal distributions with tails
that are heavier than those of the Cauchy distribution.