0% found this document useful (0 votes)
79 views8 pages

Devroye Random Variate Generation One Line of Code

This document discusses generating random variates from common distributions in a single line of code. It reviews methods for distributions like normal, gamma, Cauchy, Student's t, stable, extreme value, and others. The key approach discussed is the inversion method, which inverts the cumulative distribution function to solve for the random variate given a uniform random input. Examples are given of how to generate random variates from several common distributions in a single line using this method.

Uploaded by

Racool Rafool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views8 pages

Devroye Random Variate Generation One Line of Code

This document discusses generating random variates from common distributions in a single line of code. It reviews methods for distributions like normal, gamma, Cauchy, Student's t, stable, extreme value, and others. The key approach discussed is the inversion method, which inverts the cumulative distribution function to solve for the random variate given a uniform random input. Examples are given of how to generate random variates from several common distributions in a single line using this method.

Uploaded by

Racool Rafool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Proceedings of the 1996 Winter Simulation Conference

ed. J. M. Charnes, D. J. Morrice, D. T. Brunner, and J. J. Snrain

RANDOM VARIATE GENERATION IN ONE LINE OF CODE

Luc Devroye
School of Computer Science
McGill University
Montreal, Canada H3A 2A7
[email protected]

ABSTRACT Alternatively,

A random variate with a given non-uniform distribu- max(a, b) = a ; b + a I ~ bI .


tion can often by generated in one assignment state-
Some may include more complicated functions such
ment if a uniform source and some simple functions
as r or (, but these will not be required for the dis-
are available. We review such one-line methods for
cussion below.
most of the key distributions.
One may think of a one-liner as an expression
tree in which the leaves are uniform [0,1] random
1 A MODEL OF COMPUTATION variables or constants, and the internal nodes are the
operators or functions in the accepted class of oper-
Random variate generators that are conceptually sim- ators, which we shall call F. In a simple one-liner,
ple and quick to program become invariably popular, each leaf has a different uniform random variate as-
even if they are not as efficient as some more compli- sociated with it. In an extended one-liner, repeti-
cated methods. We explore and survey the simplest tions may occur. We may put this differently. Each
end of the spectrum-the generators that can be im- expression may be represented as a directed acyclic
plemented in one line of code. We assume through- graph (or "dag"), in which the leaf nodes contain con-
out that an unlimited source of i.i.d. uniform [0, 1J stants or Ui's, but each Ui occurs only once. If multi-
random variates U1 , U2 , ... is available. When dis- ple Ui nodes are disallowed, Extended one-liners are
cussing one-liners, we must distinguish between two implementable by dags, while simple one-liners are
situations: in the ordinary case, each request of a implementable by trees. We should point out here
uniform variate is fulfilled by another number from that. some smart compilers may transform expressions
this sequence. In the extended case, we may index with repetitions into dags before machine translation.
our requests by U1 , U2, and so forth, so that repeti- The well-known Box-Muller formula for normal
tions of the same uniform variate within the code are random variates,
possible. This will be called an extended one-liner. X == J -2 log U1 cOS( 21rU2) ,
The standard operators +, -, *, / are available,
is thus a simple one-liner. However, the equivalent
as are mod, round, l. J, sign, r·1, 1.1, sin, cos, exp,
log, tan, atan. Many functions may be derived from form
these using only a constant number of combinations. X == exp( (1/2) log( -2 log U1 )) (cos2 ( 1rU2 ) - sin 2 ( 1rU2))
For example, the indicator function Ix>o is simply
is an extended one-liner. The figure below depicts
Ix>a == 2 sign(x - a) -1, and Ia>x>b == (sign(x - a) -
the expression trees for both forms of the Box-Muller
sign(x - b))/2. FUrthermore, max is included as
max(a, b) == a + (b - a)Ib>a .

265
266

formula. (with density e- lxl /2), C is Cauchy (with density


1/{7r{1 + x 2 ))), T a is Student t(a) (with density

1/{B(a/2, 1/2)01(1 + x 2 /a)~) ,


where a > 0).
Some densities are best defined in terms of their
characteristic functions <po A partial list follows below
(note that K(o:) == 0: - 210 >1): So,O is symmetric
stable with <p(t) == e- 1tIQ , 0 < 0: ~ 2, So.,/3 is stable
(0:, (3) with <p(t) == e-ltIQe-i(7r , 0 < 0: < 2
Q #- 1, (3 E [-1,1], SI,{3 is stable (1,,8) with c.p(~ ~
e- 1tl (7r/2+i{3si g n(t)logltl), -1 ~,8 ~ 1, So,l is positive
extreme stable with <p(t) == e-ltIQe-i(7r , 0 <

Q < 1, G a is gamma (a) with <p(t) == 1/(l-it)a, a > 0,


When we have a family of distributions with pa-
rameter(s) 0, then it is of interest to have expression L is Laplace with <p(t) == 1/{1 + t 2 ), M a is Mittag-
trees that have a fixed structure, independent of O. Leffler with cp(t) == 1/(1 + (-it)a), a E (0,1]. Pa,b is
The value 0 appears at best in one or more leaves. Pillai with cp(t) == 1/{1 + {_it)a)b, a E (0,1], b > O.
For example, if a gamma (k) random variable is gen- La is Linnik with <p(t) == 1/{1 + Itl a ), a E (0,2].
erated in one line by summing k independent expo-
nential random variates, then the structure itself of 3 THE INVERSION METHOD
the expression tree changes with k, and indeed, its
size grows proportionally with k. For a family of dis-
tributions, we define a fixed one-liner as one whose The inversion method is based upon the property that
piny (U) has distribution function F if U is uniformly
expression tree has a given structure, whose internal
nodes have fixed operators, and whose leaves have distributed on [0,1]. It leads to one-liners only if F
constants, the value 8, or uniform random variates. is explicitly invertible in terms of functions that are
The operator "take the i-th component of a vector in F. In the table below, a, band c are positive
(such as 0)" is in the set of accepted operators. constants that serve as parameters.
With the previous set-up, if the family of oper- In this manner, we note that E £ - log U as
ators and functions has k members (which is fixed of P(x) == 1 - e- x , B l,a £ Ul/a, as F9x) == xa (0 <
course), and if each member is unary or binary say, X < 1), Ba,l £:. 1 - Ul/a, A £ cos(rrU), as F(x) =
then the number of possible trees on n internal nodes
does not exceed 1 - arccos(x)/7r, and C £ tan(7rU) as F(x) = 1/2 +

n ~1 C:) xn
k
~n k
= e (n k 3 2 n
- / 4 ) .
arctan( x ) /7r.
Other notable examples include the logistic
(F{x) == 1/(1 + e- X )) which can be obtained as
This limits the numbers of families we may construct ~ 10g(U/(1 - U)). (U-1/a - l)l/c yields a Burr XII
using the basic operations. Still, by making n even random variate (F(x) == -l/(xC + l)a (x > 0)), and
moderately large, the possibilities are virtually un- (U-l/a - 1)-l/c yields a Burr III random variate
limited. We will take a little tour of the popular dis- (F(x) == l/{x- C + l)a (x > 0)). A Frechet or Weibull
tributions and exhibit a number of (mostly known) random variate with F(x) == 1 - e- xG (x > 0) may
one-liners. Notable exceptions are the gamma and be obtained as logl/a(l/U). For the Gumbel distribu-
z
Poisson distributions. tion (F(x) == e- ae - ), we suggest -log((log(l/U)/a)).
A Pareto or Pearson XI (F(x) == a/x a + 1 (x ~ 1)) may
2 NOTATION be obtained by u-l/a. A tail of the Rayleigh distribu-
2 2
tion has distribution function F(x) = 1- e~ (x ~
We give different symbols for different random vari- a > 0), so that random variates may be obtained
ables. For example, U is uniform [0,1], N is stan- J
as a 2 - 2 log U. The hyperbolic secant distribution
dard normal (with density e- /2 / ~), A is arc-
x2 function is F(x) == 1- (2/1r) arctan(e- 1rx / 2 ). Random
sine (with density 1/(7rV1 - x 2 ) on [-1,1]), B a,b is variates may be obtained as (2/1r) log tan ('rrU /2).
beta (a, b) (with density x a - l (l - x)b-l / B(a, b) on
[0,1] where a, b > 0), Ga is gamma (a) (with den-
sity xa-le- x /r(a) on [0,00), where a > 0), E is ex-
ponential (with density e- x , x > 0), L is Laplace
Random Variate Generation in One Line of Code 267

4 COMBINATIONS OF TWO OR MORE which is the Rayleigh density (so that R == J -210g(U)
RANDOM VARIABLES has density f when U is uniform [0,1]), then the den-
sity of RA is
Mixtures of the form X == Y with probability p and
X == Z with probability 1 - p are easily taken care of e-x2 /2 e - y 2 /2 1
1
(X) 2

in one-liners by setting - - - - - dy == --e- x /2 .


o 1r ~
x== Y Iu<p + ZIu?p == Y + (Z - Y)Iu?p We thus rediscover the Box-Muller method given in
where U is uniform [0, 1] and independent of (Y, Z). the introduction:
However, countably infinite mixtures are not easy to N £ J- 2 log U 1 cos(21rU2 ) .
transform into one-liners.
Special distributional properties often lead to el-
EXAMPLE 2: THE SYMMETRIC BETA DISTRIBUTION.
egant one-liners. The triangular density provides a
textbook example: In the above context, define
f(r) == 2cr(1 - r 2 )C-l , a< r < 1,
THE TRIANGULAR DENSITY. Assume that we wish
to obtain a one-liner for the triangular density with where c > 0 is a parameter. The distribution function
support on [a, b] and mode at m. This could be is F(r) == 1 - (1 - r 2 )C, so that, by the inversion
achieved in a number of ways, but two possibilities method, R is distributed as VI - UI/c when U is
are uniform [0, 1]. The density of RA is supported on
x == m + (a + UI(b - a) - m)Jf]; , [-1,1] and is given by
2
and v'1-x 2c(1 - x 2 _ y2)c-I

x == m + (a + U1(b - a) - m) max(U2 , U3 ) .
h(x) ==
l o
2c(1 - X
2
)C-l/2
7f

1 1
dy

Here all the Ui's are i.i.d. uniform [0, 1] random vari- == x (1 - U 2 )C-l du
ables. 1r 0
2c(1- X 2 )C-l/2 r
22C - 1 2 (c)
== x ----
5 THE POLAR METHOD 1r r(2c)
2
r(2c+ 1)(1_x )C-l/2
In the standard polar method, one generates a ran-
22c r 2 (c + 1/2)
dom pair (X, Y) as (Rcos8,Rsin8), where Rand in which we recognize a shifted version of the sym-
8 are (random) polar coordinates. Typically, 8 is metric beta density. In the last step, we used a prop-
uniformly distributed on [0, 21r], and R has a given erty due to Binet (property 23 on page 261 of Whit-
distribution that is easy to sample from. Often, R taker and Watson, 1927). The last density is that of
is independent of 8. In the context of one-liners, we 2Bc + I / 2 ,c+I/2 - 1. Thus, our one-liner for symmetric
thus have betas with parameter a > 1/2 is based on
X == R cos(21rU)
where U is uniform [0, 1]. Another way of writing this Ba,a ==
£. 1+ VI - U~ cOS(21rU2)
2 .
is X == RA, where A is a random variable on [-1,1]
with the arcsine density (note: our arcsine density is This is Ulrich's formula (Ulrich, 1984). For a == 1/2,
in fact a linear transformation of the standard arc- note B I / 2 ,1/2 £: (1 + cOS(21rU2))/2 == cOS2(rrU2). Just
sine density 2/(1rJz(1 - z)), 0 < z < 1). A simple as for the normal distribution, equivalent respresen-
exercise in analysis shows that if R and A are inde- tations are easy to construct. We note here that
pendent, and R has density f on [0,00), then X == RA the density h plays a central role in nonparametric
has density estimation theory. The case c == 3/2 leads to the
Epanechnikov or Bartlett density. The case c == 5/2
is usually referred to as the quartic kernel. Note that
Ulrich's formula is not valid for a < 1/2. A fixed one-
liner for the entire symmetric beta family is given in
EXAMPLE 1: THE NORMAL DENSITY. If the next section.
2
f( r ) == re - r /2 , r > 0 ,
268 Devro.ye

EXAMPLE 3: THE HALF-BETA DISTRIBUTION. The This method for t-variates was pointed out by Bai-
half-beta density is the density of B 1 / 2 ,a. If X has ley (1994). This could also have been obtained by
density h from the previous section, then on [0,1], the method of the previous section, but the method
Y == X 2 has density above requires less integration work. We do not make
claims that this is the fastest method for generating
r(2c + 1)(1 - y)C-l/2 r(c + 1)(1 - y)C-l/2 t variates. There is another interesting observation
22c r 2 (c + 1/2)VY == r(I/2)r(c + 1/2)VY ' here: the t density is a mixture of bimodal densities
which is the density of B I / 2 ,c+l/2. Thus, for a 2: 1/2, wi th infinite peaks (arcsine densities)!

B 1 / 2 ,a I= (1 - 2
U 12 0 - 1
) cos 2 (21l"U2 ) .
ANOTHER ONE-LINER FOR SYMMETRIC BETAS.
(1978) has proved that
Best

EXAMPLE 4: THE T DISTRIBUTION. If B is beta Ba a £:. ~2 (1 + J2a+Tia


T
2a
).
(a, a), then I

To £ .;2a(B - 1/2) Thus, if S denotes a random sign (3 == IV~1/2 for


2a - J
2 B (1 - B) . V uniform [0,1]), the following distributional identity
yields a one-liner for all symmetric beta distributions:
This method yields an extended fixed one-liner for the
LIS
t distribution. Another fixed one-liner is developed in Ba I a 2 + ----;::::::==========================
==
the next section. 2 1+ (U;1/0_ 1{ COS 2 (21l"U 2 1

6 THE POLAR METHOD AND NORMAL This (new) method is applicable for all values of a-
SCALE MIXTURES Ulrich's formula required a > 1/2.

ANOTHER ONE-LINER FOR HALFBETAS. As (2B a ,a-


Assume that X is a normal scale mixture random
variable, i.e., X can be written as Y N, where N is 1) £:. B 1 /2,a, the previous paragraph suggests yet
2

standard normal, and Y is an arbitrary positive ran- another one-liner for halfbetas:
dom variable, independent of N. If N I , N 2 are two B £ Tia 1
independent normals independent of Y, then 1/2,a - 2a + Tia - 1 + 2a/Tia .
(X I ,X2) ~f (YN1 , YN2) £:. (ZI,Z2) x (YJ2E) , Thus, if S denotes a random sign (3 == IV~1/2 for V
uniform [0,1]), the following distributional identity
where E is exponential, and (Zl, Z2) is uniform on
yields a one-liner for all halfbeta distributions:
the unit circle and independent of E and Y. This
says that (X1 ,X2 ) has a radially symmetric distribu-
tion with random radius distributed as Y V2E. Gen-
erating Xl based upon this formula might be called
a polar method for X. In some cases, the distribu- This (new) method is applicable for all values of a.
tion of Y V2E is very simple. For example, if Y £:.
Ja/2G a / 2 , then simultaneously 7 DISTRIBUTIONS DEFINED AS
ONE-LINERS
yJ2E = VGaE a/2
; YN f=. T a .

Systems of distributions such as Pearson's usually


The last relationship in fact describes the genesis of have simple analytic formats. Yet, random variate
the t-distribution. The quantity under the square generation may cause problems. The Pearson IV fam-
root in the first equation has a beta II (or F) distri- ily, for example, requires quite a bit of work (see De-
bution. Routine calculations show that vroye, 1986, p. 480). In modeling, it may be useful
yJ2E f=. Ja(U-2/a - 1) . to define a distribution by specifying first a one-liner
(so that generation is easy), and then worrying about
One could thus generate T a in one line using two in- the choice of the parameters and the fine-tuning of
dependent uniform [0,1] random variates U 1 and U2
since
Random Variate Generation in One Line of Code 269

the model. There are literally hundreds of such at- with parameter a E [1,2]:

C2a ) 1 ue-XUg(u)du,x >


tempts. Thkey (1960) defined a symmetric family by
= ~Sin
00

U>.. - (1 - U)>" f(x) = f(-x) 0,


X == A '
where
where A E IR is a parameter and U is uniform [O,lJ.
This was later generalized by Ramberg and Schmeiser
1
g(u) == -sin -
(Jra) u
a
-
1
,u> 0
Jr 2 1 + 2 cos( 7r2a )u a + u 2a .
(1974) by using different A's for the exponents.
Omitting location and scale parameters, the Thus, a Linnik random variate can be generated as
Schmeiser-Deutch faIllily (Schmeiser and Deutch, S E /W where S is a random sign, E is exponentially
1977) is the family of distributions of the random vari- distributed, and W has density g. Using the trans-
ables formation, v == u a , it is easy to establish that W is
x == { -(A - U)Il-, if U :::; A distributed as
(U - A)1l- , if U > A ,
1ra -cos-
1ra) l/a
where A and J-L are shape parameters. (Csin-
22'
In hydrology, one uses the Wakeby distribution
where C is a Cauchy random variable restricted to
(Johnson and Kotz, 1988, vo1.9, p.513) because it is a C 2: 1/ tan 1r2a. Equivalently, C is distributed as
versatile five-parameter distribution, gives occasion-
tan(~(l - aU)), where U is uniformly distributed on
ally outliers, and is easy to simulate. A random vari- [O,IJ. In summary, we have
ate is obtained as
~
X = a+ ~ (1 - (1 - U)C) - ~ (1 - (1 - U)C') ,
La BE
(sin 1r2a tan(~(l- aU)) _ cos 1r;) /a
1 .

where U is uniform [0,1], b' 2: 0, b+b' 2: 0, and either Not in partcular that if E is exponential, S is a ran-
°
c + c' > or c + b' == c' == O.
Burr (1942) (see Tadikamalla, 1980), Johnson
dom sign, L is Laplace, C is Cauchy, and N 1 , N 2 are
i.i.d. normal random variates, then
(1949) and many others since then have invented their
own families of distributions based on this convenient L 1 £. EN
N
1 .
'
L
1
£. EC ., L 1 ==L C;
E L 2 ==
£. SE C L
==.
2
principle. Tadikamalla (1980) reviews many systems.
For example, in the Tadikamalla-Johnson system
Tadikamalla and Johnson (1990), we begin with a THE STABLE LAWS. Ibragimov and Chernin (1952)
logistic random variate and Zolotarev (1966, 1986) derived various useful rep-
resentations for the stable laws. As an example, de-
U
Z == l o g - - fine K(a) == a - 2Ia >1, and let Ga,b be the distribu-
I- U '
tion function for Sa,b. Set () == bK(a)/a. Note that
and define three random variables: for x > 0, b > 0,
YL == ~ + Ae(Z---y)/fJ
1 - -21 fl-(J e -x ~ U (z (J) dZ
,
Q I (a > 1)
YB = ~ + AI (1 + e-(Z-I')/6) ,
Ga,b == -1-6 + -1 fl e -x~U (z6)d Z Q, (a < 1) .
2 2-6
Yu == ~ + Asinh((Z - ,)/b) . ! JI e-e-:l:/bU 1 (z,b)
2 -1
dz (a == 1)
Just as with the Johnson family, the family covers the The values for x < 0 are obtained by noting that
entire skewness-kurtosis plane. And the one-liners are Ga,b(X) + Ga,-b( -x) == 1. The values for b < 0 are
fixed as well for the family.
obtained by noting that Ba,b £. -Sa,-b. The func-
tions U are defined as follows:
8 REPRESENTATION THEOREMS
U ( b) == 7r(I + bz) e~(z+l/b) tan( T) .
1 Z, 2 cos (1rZ)
2 ,
Somethnes densities, distribution functions or charac-
teristic functions can be written as integrals, which,
. (1ra(Z+6)))
Sin 2
~ cos (7r«a-l)z+a(J))
2

upon closer inspection, reveal some method for gen- Ua ( Z , (J) = ( COS ( "2z ) COS (,,2")
erating random variates. Two examples follow that
lead to useful one-liners.

A NEW ONE-LINER FOR LINNIK'S DISTRIBUTION.


Kawata (1972, pp. 396-397) derives the following rep-
resentation for the density f of the Linnik distribution
270 Devro,ve

All Sa,b'S are supported on the real line except Sa,l variables for which one-liners are already known. The
for a < 1 (which is supported on the positive halfline) following are prime candidates: Y == U a , Y is normal,
and Sa,-l for a < 1 (which is supported on the neg- Y is exponential, and Y is Cauchy. At this junction,
ative halfline). Another representation is that the it is impossible to be exhaustive. We will rather limit
distribution of S::l(a-l) for a < 1 is given by ourselves to a few nice examples.

~ ('If e-xA(z)dz , KHINCHINE MIXTURES. The density of X == U1U2


1r Jo (with U 1 ,U2 i.i.d. uniform [0,1]) is -log(x) on [0,1].
where
1 NORMAL SCALE MIXTURES. Let N be standard nor-
A(z) = sin((l - a)z) (si~(az)) ~ mal, and let X be a positive random variable with
sin( az) sIn z two-sided La-place transform £(8) == Ee- sx . Then
In the integrals, we recognize exponential power mLx- Y == N JX/2 has characteristic function L(t 2 ). This
tures, which lead to a variety of one-liners. Kanter is easily see by noting that
(1975) used the last representation to suggest t.hat
Ee itY == Ee itN VXJ2
I-a
== Ee- t2X
Sa,l £: (A(7ru))-a
E .
== L(t 2 ) .
(condition on X)

For a < 1, this would suffice for all values of b E Three main examples come to mind:
[-1,1] as A. If X is exponential (thus, L(s) == 1/(1 + s)),
L
Sa,b ==
(1 + b)
-2-
l/a
Sa,l +
(1 - b)
-2-
1/a
Sa,-1
then N JX/2 is Laplace, as it has characteristic
function 1/{1 + t 2 ).
B. Assume that 0 < Q < 1 and set X == So:,l. From
(Zolotarev, 1986, p. 61). Defining () as above and Zo-lo-ta-rev (1986, p. 112), we know that for the
sOl
positive stable distribution, £( s) == e- if s 2:
sin (~) (cos ('If((a-~)z+a/l»)) ~ J
O. Therefore, N 80:,1/ 2 has characteristic func-
Ba(z) == ( 1r«a-l)z+aB) ) cos (1rz) tion e-ltI2a. That is,
cos 2 2
J
N So:, 1 /2 ~ S20:,0. Symmetric stables can be
Chambers, Mallows and Stuck (1976) (see also Zolota- built up from positive stables and normals. For
rev, 1986) suggest the extended one-liner the latter distributions, one-liners were exhib-
ited aerlier in the paper.
Sa,b ~ Ba(U - 1/2)E 1 - 1
/
a
C. If we take in the previous example a == 1, then
valid for all a =1= 1 and b E [-1, 1]. For a == 1, they we note that N JSl,I/2 has characteristic func-
obtain tion
L 2b
8 1 ,b == B l (U -1/2) - -logE,
7r where we used the fact that the two-sided La-
place transform of SI,l is e- s log S for s > 0 (Zo-
where
lo-ta-rev, 1986, p. 112).
2b
B I (z) == -log
7r
(1
cos
+(bz) ) + (1 + bz) tan ( -7r Z )
'1r
2
Z 2
.
CAUCHY SCALE MIXTURES. Let C be standard Cauchy
and let X be a positive random variable with two-
sided La-place transform L(8). Then Y == ex has
9 SCALE MIXTURES characteristic function L(ltl). This is easily see by
noting that
We say that X is a scale mixture if X == Y Z can Ee itY == Ee itXN
be decomposed as the product of two independent = Ee- 1t1X (condition on X)
random variables Y and Z. Such mixtures are con-
== L(ltl) .
venient ways of trying to discover one-liners. Famous
scale mixtures occur when Y is uniform [0,1]. In that Three examples follow:
case, the distribution of X is unimodal with a peak A. Since G a has two-sided La-place transform £(s) =
at the origin, and the mixture is called a Khinchine 1/{1 + s)a, valid for ~(s) 2: 0, eGa has charac-
mixture. One should try replacing Y with all random teristic function 1/(1 + It\)a.
Random Variate Generation in One Line of Code 271

°
B. Assume that < Q < 1. Arguing as in the pre- yields a random variable X with characteristic func-
vious subsection, we note that So., 1 C £. So.,o,

C (~it)a r'
tion
Thus, symmetric stables can also be obtained
from Cauchy variables and positive extreme sta- cp(t) = + a E (0,1], b > 0 .
bles.
C. Finally, S 1,1 C has characteristic function This distribution was studied by Pillai (1990). A re-
e-Itllog Itl. lated distribution was studied by Klebanov, 11aniya
and Melamed (1984). For b =: 1, we obtain the
SYMMETRIC STABLE MIXTURES. Scale mixtures with Mittag-Leffler distribution with parameter a. Note
stable distributions are best studied via characteristic that the stable (a, 1) random variate mentioned here
functions. In particular, if X has density j, then the _ has characteristic function
characteristic function of XC Sa,O is (t > 0)
cp(t) = EeitXCSo,o = Ee-ltXClo = J !(x)e-IWlxlco dx .
(t < 0) .
Using Kanter's one-liner for Sa,l, we see that if E, E*
This is particularly helpful if j(x) has a factor e- lx1b . are i.i.d. exponential random variables and U is uni-
formly distributed on [0,1], then
For example, if f(x) == e- If(l + lib) , x > 0, then,
xb

with c == bfa, M £:. (ESin(a7rU))l/a ( E*sin(a7rU) )(a-l)/a


roo e- xb (I+l t I
4
) 1 a sin( 7TU) sin( (1 - a )7TU)
cp(t) = fa r(1 + lib) dx = (1 + Itl a )1/b'
This is a generalized form of Linnik's distribution REFERENCES
(Linnik (1962), Laha (1961), Lukacs (1970), pp. 96-
97), which is obtained for b == 1 (and thus c == 1I a). R. W. Bailey, "Polar generation of random vari-
The one-liner suggested by ates with the t distribution," Ivfathematics of Com-
£, ~ putation, vol. 62, pp. 779-781,1994.
La == Sa,OE4
D. J. Best, "A simple algorithm for the computer
is due to Devroye (1990). If La,b denotes a generalized generation of random samples from a Student's
Linnik random variable, other consequences of the t or symmetric beta distribution," in: COMP-
relationship given above include: STAT 1978: Proceedings in Computational Statis-
I a tics, ed. L. C. A. Corsten and J. Hermans, pp. 341-
L a,b ==£, S a,O G b / ; 347, Physica Verlag, Wien, Austria, 1978.
£,
L 1,1 == CE ; 1. W. Burr, "Cumulative frequency functions," An-
nals of Mathematical Statistics, vol. 13, pp. 215-
£2,1£. N JE/2 £. L ; 232, 1942.
L a ,1/2 £. Sa,o(INI/J2)2/a ; J. M. Chambers, C. L. Mallows, and B. W. Stuck,
£,
"A method for simulating stable random vari-
L == N 1N 2 + N3N4 . ables," Journal of the American Statistical Asso-
The last statement involves four independent stan- ciation, vol. 71, pp. 340-344, 1976.
dard normals, and follows from the previous state- L. Devroye, Non-Uniform Random Variate Genera-
ment. tion, Springer-Verlag, New York, 1986.
It is equally simple to verify that if {Qj} is a L. Devroye, "A note on Linnik's distribution," Statis-
sequence of numbers from (0,2], Ij ~ 0, and So.;I O is tics and Probability Letters, vol. 9, pp. 305-306,
a sequence of independent symmetric stable random 1990.
variables with the given parameters, then I. A. Ibragimov and K. E. Chernin, "On the uni-
~;=1 Sa; (,j E) 1/0.; has characteristic function modality of stable laws," Theory of Probability and
its Applications, vol. 4, pp. 417-419, 1959.
1 M. E. Johnson, "Computer generation of the ex-
ponential power distribution," Journal of Statisti-
cal Computation and Simulation, vol. 9, pp. 239-
240, 1979.
POSITIVE EXTREME STABLE MIXTURES: THE MITTAG-
LEFFLER DISTRIBUTION. The one-liner
X == Sa,lG~/a
272

N. L. Johnson, "Systems of frequency curves gen- P. R. Tadikamalla, "A look at the Burr and re-
erated by methods of translation," Biometrika, lated distributions," International Statistical Re-
vol. 36, pp. 149-176, 1949. vie ,v, vol. 48, pp. 337-344, 1980.
N. L. Johnson, "Systems of frequency curves de- P. R. Tadikamalla , "Random sampling from the ex-
rived from the first law of Laplace," Trabajos de Es- ponential power distribution," Journal of the Amer-
tadistica, vol. 5, pp. 283-291, 1954. ican Statistical Association, vol. 75, pp. 683-686,
N. L. Johnson and S. Kotz, "Encyclopedia of the Sta- 1980.
tistical Sciences," vols. 1-4 (1983), vols. 5-6 (1985), P. R. Tadikamalla, "On simulating non-normal dis-
vol. 7 (1986), vols. 8-9 (1988), supplement (1989), tributions," Psychometrika, vol. 45, pp. 273-279,
John Wiley, New York, 1980.
N. L. Johnson and S. Katz, "Extended and multi- P. R. Tadikamalla and N. L. Johnson, "Tables to fa-
variate Thkey lambda distributions," Biometrika, cilitate fitting Tadikamalla and Johnson's L B dis-
vol. 60, pp. 655-661, 1973. tributions," Communications in Statistics, Series
M. Kanter, "Stable densities under change of scale Simulation, vol. 19, pp. 1201-1229,1990.
and total variation inequalities," Annals of Proba- J. W. Tukey, "The practical relationship between the
bility, vol. 3, pp. 697-707, 1975. common transformations of percentages of counts
T. Kawata, Fourier Analysis in Probability The- and of amounts," Technical Report 36, Statisti-
ory, Acadenlic Press, New York, N.Y., 1972. cal Techniques Research Group, Princeton Univer-
L. B. Klebanov, G. V. Maniya, and I. A. Melamed, sity, 1960.
"A problem of Zolotarev and analogs of infinitely G. Ulrich, "Computer generation of distributions on
divisible and stable distributions in a scheme for the m-sphere," Applied Statistics, vol. 33, pp. 158-
summing a random number of random variables," 163, 1984.
Theory of Probability and its Applications, vol. 29, E. T. Whittaker and G. N. Watson, A Course
pp. 791-794, 1984. of Modern Analysis, Cambridge University Press,
R. G. Laha, "On a class of unimodal distribu- Cambridge, 1927 (1980).
tions," Proceedings of the American Mathemati- V. M. Zolotarev, "On the representation of stable
cal Society, vol. 12, pp. 181-184,1961. laws by integrals," Selected Translations in Math-
R. G. Laha and E. Lukacs, "On a problem connected ematical Statistics and Probability, vol. 6, pp. 84-
with quadratic regression," Biometrika, vol. 47, 88, 1966.
pp. 335-343, 1960. V. M. Zolotarev, One-Dimensional Stable Distri-
Yu. V. Linnik, "Linear forms and statistical cri- butions, American Mathematical Society, Provi-
teria: I, II," Selected Translations in Matbemati- dence, R.I., 1986.
cal Statistics and Probability, vol. 3, pp. 1-40, 41-
90, 1962.
AUTHOR BIOGRAPHY
E. Lukacs, Characteristic Functions, Griffin, Lon-
don, 1970.
R. N. Pillai, "Semi-a Laplace distributions,n Com- LUC DEVROYE is professor in the School of
munications in Statistics - Theory and Meth- Computer Science at McGill University in Mon-
ods, vol. 14, pp. 991-1000, 1985. treal, Canada. His research interests include simu-
I. Popescu, "Algorithms for generating the logistic lation, random number generation, and the proba-
variable," Economic Computation and &onomic bilistic analysis of algorithms. His 1986 book Non-
Cybernetics Studies and Research, vol. 10(1), pp. 55- Uniform Random Variate Generation (now out of
61, 1976. print) may be consulted as background for the present
J. S. Ramberg and B. W. Schmeiser, "An approx- article. Although he has tried hard, he still does
imate method for generating asymmetric random not know how to generate a gamma random vari-
variables," Communications of the ACM, vol. 17, ate in one line of code.
pp. 78-82, 1974.
B. W. Schmeiser and S. J. Deutch, "A versa-
tile four parameter family of probability distri-
butions suitable for simulation," AIEE Transac-
tions, vol. 9, pp. 176-182,1977.

You might also like