Generators for distributions based on methods from the UNU.RAN library
Generators for distributions based on methods from the UNU.RAN library
Generators for particular distributions. Their syntax is similar to the corresponding built-in functions.
Details
Runuran provides an interface to the UNU.RAN library for universal non-uniform random number generators. This is a very flexible and powerful collection of sampling routines, where the user first has to specify the target distribution and then has to choose an appropriate sampling method. However, we found that this approach is a little bit confusing for the beginner.
Thus we have prepared easy-to-use sampling functions for standard distributions to facilitate the use of the package. All these functions share a similar syntax and naming scheme (only u is prefixed) with their analogous
built-in generating functions (if these exist) but have optional domain arguments lb and ub, i.e., these calls also allow to draw samples from truncated distributions:
ur...(n, distribution parameters, lb , ub)
These functions also show the interested user how we used the more powerful functions. We recommend to directly use these more flexible functions. Then one has faster marginal generation times and one may choose the best generation method for one's application.
Currently generators for the following distributions are implemented.
## draw a sample of size 100 from a## gamma distribution with shape parameter 5x <- urgamma(n=100, shape=5)## draw a sample of size 100 from a## half normal distributionx <- urnorm(n=100, lb=0, ub=Inf)