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 Rbuilt-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):
urbeta
... Beta
urburr
... Burr
urcauchy
... Cauchy
urchi
... Chi
urchisq
... Chi-squared
urexp
... Exponential
urextremeI
... Gumbel (extreme value type I)
urextremeII
... Frechet (extreme value type II)
urf
... F
urgamma
... Gamma
urgig
... GIG (generalized inverse Gaussian)
urhyperbolic
... Hyperbolic
urlaplace
... Laplace
urlnorm
... Log-Normal
urlogis
... Logistic
urlomax
... Lomax
urnorm
... Normal (Gaussian)
urpareto
... Pareto (of first kind)
urplanck
... Planck
urpowerexp
... Powerexponential (Subbotin)
urrayleigh
... Rayleigh
urt
... t (Student)
urtriang
... Triangular
urweibull
... Weibull
}
Discrete Distributions (6):
urbinom
... Binomial
urgeom
... Geometric
urhyper
... Hypergeometric
urlogarithmic
... Logarithmic
urnbinom
... Negative Binomial
urpois
... Poisson
}
Runuran-package
, Runuran.distributions
.## 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)
Run the code above in your browser using DataLab