















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this file are Cumulative Distribution, Percentile Functions, Random Numbers, Special Functions, Incomplete Gamma Function, Continuous Distributions, Random Number
Typology: Study notes
1 / 23
This page cannot be seen from the preview
Don't miss anything!
















1
The functions described in this appendix are used in more than one procedure. They are grouped into the following categories:
The following notation is used throughout this appendix unless otherwise stated: f (x) Density function of continuous random variable X F(x) Cumulative distribution function of X x (^) p 100p th percentile such that F x 3 8 (^) p = p , for 0 ≤ p ≤ 1 Prob (X = x) Probability density (or mass) function of discrete random variable X Prob 0 X ≤ x 5 Cumulative probability density function of X
∞ (^) −
1 0 0
Properties
Note. Since Γ( a ) can be very large even for a moderate value of a , the (natural) logarithm of Γ( a ) is computed instead. References. The ln(Γ( a )) function: CACM 291 (1966) and AS 245 (1989).
0
1
Properties
Properties
we have
References. AS 63 (1973); Inverse: AS 64 (1973), AS 109 (1977).
x e du x x p x p
x u
p
− −∞ −
(^2 )
1
π
/
For Φ −^1 , the Abramowitz and Stegun method is used. References. AS 66 (1973); Inverse: AS 111 (1977) and AS 241 (1988). See Patel and Read (1982) for related distributions.
Beta 0 x a b ; , 5. 0 ≤ x ≤ 1 , a > 0 and b > 0
f x (^) a b x x F x x a b x p a b p
a b
p
0 5 0 5 0 5 0 5 0 5 0 5
− −
−
1 1
1
Note. Uniform(0,1) is a special case of beta for a = 1 and b = 1.
Random Number
Special case
Exponential 0 x a ; 5. x ≥ 0 , a > 0
f x ae F x e x (^) a p p
ax ax
p
0 5 0 5 0 5
− 1 − (^1) ln 1 0 1
Note. This is the Gamma( x ; 1, a ) distribution.
Random Number
Inverse CDF algorithm Generate U from Uniform(0,1); X = − ln 01 − U 5 / a.
F 0 x a b ; , 5. x ≥ 0 and b > 0
f x (^) a b ab x ab x
F x (^) b axax a^ b
a (^) a a b 0 5 (^0 )
0 5
= ^0 5 0
+
= (^) +
2 2 1 2 B IB
/ (^) / /
x ba p a^ b p a b p = p
≤^ ≤
1 1
1 6 1 6
Random Number Using the chi-square distribution
Gamma 0 x a b ; , 5. x ≥ 0 , a > 0 , and b > 0
f x ba x e F x bx a x (^) b p a p
a (^) a bx
p
0 5 (^) 0 5 0 5 (^1 ) 1 6
− −
−
1
Note. The Erlang distribution is a gamma distribution with integers a and b = 1.
Random Number
Special case If a = 1 and b > 0, generate X from an exponential distribution with parameter b. Algorithm GS due to Ahrens and Dieter (1974) for 0 < a < 1 and b = 1
Lognormal 0 x a b ; , 5. x ≥ 0 , a >0 and b > 0,
f x (^) xb e
F x (^) b xa
x ae p
x a b
p b^ p
0 5
0 5
1 0 5 6 4 9
0 5
=
= ≤ ≤
−
−
(^2 )
1
2 π
ln / /
Φ ln Φ
Random Number Inverse CDF algorithm
Normal 0 x a b ; , 5. − ∞ < x < ∞ − ∞ <, a < ∞, and b > 0
f x (^) b e
F x x^ ba x a b p p
x a b
p
0 5
0 5 0 5
=^0 5 4^9
= − = + ≤ ≤
− −
−
2 22
1
π
/
For Φ and Φ −^1 , see “Standard Normal Function” on p. 5.
Random Number Kinderman and Ramage (1976) method
Pareto 0 x a b ; , 5. x ≥ a > 0 and b > 0
f x ba ax
F x ax x a p p
b
b
p b
0 5
0 5 0 5
=
= − = − ≤ ≤
−
1
1/
Random Number Inverse CDF
Student’s t 0 x a ; 5. − ∞ < x < ∞ and a > 0
f x a
x a
F x
a a x
a a a x
a (^) x
a 0 5 (^0 )
0 5
0 5 = + ^
^
^ ≤ ^
^ >
% &
KK
'
K K
2 1 2
2 2
B a / 2,1 / 2 IB
x 0 1-^12 IB (^) +
/
x
a p a^ p
a p p
p a
− − ^
^
% &
KK
'
K K
−
−
(^1 )
1 2 12 12
4 4 IB^3 0
When a = 1, this is the Cauchy distribution (Cauchy( x ; 0, 1)).
Random Number
Inverse CDF algorithm
Bernoulli 0 x a ; 5. x = 0 1 and 0, ≤ a ≤ 1
Prob Prob
X x a a X x a^ xx
= = x^ − x ≤ = %&−^ == '
0 5 0 5 − 0 5
1
Random Number
Special case If a = 0 , X = 0. If a = 1 , X = 1. Direct algorithm for 0 < a < 1
Binomial 0 x a b ; , 5. x = 0 1, ,..., a a ; = 1 2, ,..., and 0 ≤ b ≤ 1
Prob
Prob IB
X x ax b b
X x b x^ a^ x^ xx^ a a
= = x^ a^ x
^ − ≤ = %&−^ +^ −^ ==^ − '
0 5 0 5 −
0 5 0 5
Random Number
Special case If b = 0, X = 0. If b = 1, X = a. Algorithm BB due to Ahrens and Dieter (1974) for 0 < b < 1
Geometric 0 x a ; 5. x = 1 2, ,... and 0 < a ≤ 1
Prob Prob
X x a a X x a
x x
0 5 0 5 − 0 5 0 5
1
Note. Geometric is a special case of the negative binomial ( x ; 1, a ).
Random Number
Special case If a = 1 , X = 1. Direct algorithm for 0 < a < 1
Negative Binomial 0 x a b ; , 5. x = a a , + 1 , K; a = 1 2, , K and 0 < b ≤ 1
Prob Prob IB
X x xa b b X x b a x a
= = − a^ x^ a −
^
^ − ≤ = − +
0 5 0 5 − 0 5 0 5
Random Number
Special case If b = 1 , X = a. Direct algorithm
Poisson 0 x a ; 5. x = 0 1 2, , , K and a > 0
Prob Prob IG ; +
X x ax e X x a x
x (^) a = = ≤ = −
0 5 − 0 5 0 5
Random Number
Algorithm PG due to Ahrens and Dieter (1974)
Notes. [y] means the integer part of y. Steps 3 to 5 of Algorithm PG are in fact the direct algorithm. References. RV: Ahrens and Dieter (1974).
Noncentral Beta 0 x a b c ; , , 5. 0 ≤ x ≤ 1 , a > 0 , b > 0 ,and c ≥ 0
f x (^) j c^ e x^ a j bx
F x (^) j c^ e x a j b
j (^) c a j b j j j
c
0 5 (^0 0 )
0 5 0 5
= (^) +−
= =
∞
=
∞ −
∑
∑
2 1 1 0
0
2
/
/
Note. c is the noncentrality parameter. If c = 0 , F ( x ) is the (central) beta distribution function. References. CDF: Abramowitz and Stegun (1965, Chapter 26), AS 226 (1987), and AS R84 (1990).
Noncentral Chi-Square 0 x a c ; , (^) 5. x ≥ 0 , a > 0 , and c ≥ 0
f x (^) j c^ e x^ e a j
F x (^) j c^ e x^ a^ j
j (^) c a j x a j j j j
c
0 5 0 5
0 5
=
= +
∞
=
∞ −
∑
∑
2 22 1 2 0
0
2
/ (^) //^ /
/
The noncentral chi-square random variable is generated as the sum of squares of a independent normal random variates each with mean μ i and variance 1. Then c = (^) ∑μ (^) i^2_._ Note. c is the noncentrality parameter. If c = 0 , F ( x ) is the (central) chi-square distribution function. References. CDF: Abramowitz and Stegun (1965, Chapter 26), AS 170 (1981), AS 231 (1987). Density: AS 275 (1992).
Note. c is the noncentrality parameter. If c = 0 , F ( x ) is the (central) Student’s t distribution function. References. CDF: Abramowitz and Stegun (1965, Chapter 26), AS 5 (1968), AS 76 (1974), and AS 243 (1989).
AS 3: Cooper (1968a) AS 5: Cooper (1968b) AS 27: Taylor (1970) AS 32: Bhattacharjee (1970) AS 63: Majumder and Bhattacharjee (1973a) AS 64: Majumder and Bhattacharjee (1973b) AS 66: Hill (1973) AS 76: Young and Minder (1974) AS 91: Best and Roberts (1975) AS 109: Cran, Martin, and Thomas (1977) AS 111: Beasley and Springer (1977) AS 134: Atkinson and Whittaker (1979) AS 147: Lau (1980) AS 152: Lund (1980) AS 170: Narula and Desu (1981) AS 226: Lenth (1987) AS 231: Farebrother (1987) AS 239: Shea (1988) AS 241: Wichura (1988) AS 243: Lenth (1989) AS 245: Macleod (1989) AS 275: Ding (1992) AS R85: Shea (1991) CACM 291: Pike and Hill (1966)
CACM 299: Hill and Pike (1967) CACM 332: Dorrer (1968) CACM 395: Hill (1970a) CACM 396: Hill (1970b) CACM 451: Goldstein (1973) CACM 488: Brent (1974)
Abramowitz, M., and Stegun, I. A. eds. 1970. Handbook of mathematical functions. New York: Dover Publications. Ahrens, J. H., and Dieter, U. 1974. Computer methods for sampling from gamma, beta, Poisson and binomial distributions. Computing , 12: 223–246. Atkinson, A. C., and Whittaker, J. 1979. Algorithm AS 134: The generation of beta random variables with one parameter greater than and one parameter less than