UNU.RAN random variate generator for the Pareto distribution (of first
kind) with shape parameters k
and a
.
It also allows sampling from the truncated distribution.
[Special Generator] -- Sampling Function: Pareto (of first kind).
urpareto(n, k, a, lb=k, ub=Inf)
size of required sample.
(strictly positive) shape and location parameter.
(strictly positive) shape parameter.
lower bound of (truncated) distribution.
upper bound of (truncated) distribution.
Josef Leydold and Wolfgang H\"ormann unuran@statmath.wu.ac.at.
The Pareto distribution with parameters k
and a
has density
The generation algorithm uses fast numerical inversion. The parameters
lb
and ub
can be used to generate variates from
the Pareto distribution truncated to the interval (lb
,ub
).
W. H\"ormann, J. Leydold, and G. Derflinger (2004): Automatic Nonuniform Random Variate Generation. Springer-Verlag, Berlin Heidelberg
N.L. Johnson, S. Kotz, and N. Balakrishnan (1994): Continuous Univariate Distributions, Volume 1. 2nd edition, John Wiley & Sons, Inc., New York. Chap.20, p.574.
runif
and .Random.seed
about random number
generation and unuran
for the UNU.RAN class.
## Create a sample of size 1000
x <- urpareto(n=1000,k=2,a=3)
Run the code above in your browser using DataLab