Runuran.distributions function

UNU.RAN distribution objects

UNU.RAN distribution objects

Create objects for particular distributions suitable for using with generation methods from the UNU.RAN library.

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.

Creating an object for a particular distribution can be a bit tedious especially if the target distribution has a more complex density function. Thus we have compiled a set of functions that provides ready-to-use distribution objects. Moreover, using these object often results in faster setup time than objects created with pure code.

These functions share a similar syntax and naming scheme (only ud is prefixed) with analogous built-in functions that provide density, distribution function and quantile:

ud...(distribution parameters, lb , ub)

Currently generators for the following distributions are implemented.

Continuous Univariate Distributions (26):

FunctionDistribution
udbetaBeta
udcauchyCauchy
udchiChi
udchisqChi-squared
udexpExponential
udfF
udfrechetFrechet (Extreme value type II)
udgammaGamma
udghypGeneralized Hyperbolic
udgigGeneralized Inverse Gaussian
udgumbelGumbel (Extreme value type I)
udhyperbolicHyperbolic
udigInverse Gaussian (Wald)
udlaplaceLaplace (double exponential)
udlnormLog Normal
udlogisLogistic
udlomaxLomax (Pareto of second kind)
udmeixnerMeixner
udnormNormal (Gaussian)
udparetoPareto (of first kind)
udpowerexpPowerexponential (Subbotin)
udrayleighRayleigh
udslashSlash
udtt (Student)
udvgVariance Gamma
udweibullWeibull (Extreme value type III)

Discrete Distributions (6):

FunctionDistribution
udbinomBinomial
udgeomGeometric
udhyperHypergeometric
udlogarithmicLogarithmic
udnbinomNegative Binomial
udpoisPoisson

Author(s)

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

See Also

Runuran-package.

Examples

## Create an object for a gamma distribution with shape parameter 5. distr <- udgamma(shape=5) ## Create the UNU.RAN generator object. use method PINV (inversion). gen <- pinvd.new(distr) ## Draw a sample of size 100 x <- ur(gen, 100) ## Compute some quantiles for Monte Carlo methods x <- uq(gen, (1:9)/10) ## Analogous for half normal distribution distr <- udnorm(lb=0, ub=Inf) gen <- pinvd.new(distr) x <- ur(gen, 100) x <- uq(gen, (1:9)/10) ## Analogous for a generalized hyperbolic distribution distr <- udghyp(lambda=-1.0024, alpha=39.6, beta=4.14, delta=0.0118, mu=-0.000158) gen <- pinvd.new(distr) x <- ur(gen, 100) x <- uq(gen, (1:9)/10) ## It is also possible to compute density or distribution functions. ## However, this might not work for all generator objects. ## Density x <- ud(gen, 1.2) ## Cumulative distribution function x <- up(gen, 1.2)
  • Maintainer: Josef Leydold
  • License: GPL (>= 2)
  • Last published: 2025-04-07