Runuran.special.generators function

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.

Continuous Univariate Distributions (24):

FunctionDistribution
urbetaBeta
urburrBurr
urcauchyCauchy
urchiChi
urchisqChi-squared
urexpExponential
urextremeIGumbel (extreme value type I)
urextremeIIFrechet (extreme value type II)
urfF
urgammaGamma
urgigGIG (generalized inverse Gaussian)
urhyperbolicHyperbolic
urlaplaceLaplace
urlnormLog-Normal
urlogisLogistic
urlomaxLomax
urnormNormal (Gaussian)
urparetoPareto (of first kind)
urplanckPlanck
urpowerexpPowerexponential (Subbotin)
urrayleighRayleigh
urtt (Student)
urtriangTriangular
urweibullWeibull

Discrete Distributions (6):

FunctionDistribution
urbinomBinomial
urgeomGeometric
urhyperHypergeometric
urlogarithmicLogarithmic
urnbinomNegative Binomial
urpoisPoisson

Author(s)

Josef Leydold and Wolfgang H"ormann unuran@statmath.wu.ac.at .

See Also

Runuran-package, Runuran.distributions.

Examples

## draw a sample of size 100 from a ## gamma distribution with shape parameter 5 x <- urgamma(n=100, shape=5) ## draw a sample of size 100 from a ## half normal distribution x <- urnorm(n=100, lb=0, ub=Inf)
  • Maintainer: Josef Leydold
  • License: GPL (>= 2)
  • Last published: 2025-04-07