GENERATING NON-UNIFORM RANDOM DEVIATES 1/1/2019 VMASC MSIM 710/810
INTRO X is a random variable with non-uniform distribution F(x) = Prob[X <= x] Inter-arrival time (exponential) Heights of basketball players (triangular) Target location error (2-D Normal) Failure time (Weibull) Coin flips before H-H-H (Geometric) Dice Rolls (Binomial) Drawing an “Out” (Bernoulli) 1/1/2019 VMASC MSIM 710/810
BASICS Generate one or more independent U[0, 1] Create sample of X using these as input Use few Uniforms Be Fast Be Simple Be EXACT (we’ll relax this later) 1/1/2019 VMASC MSIM 710/810
INVERSE TRANSFORM METHOD Generate U~U[0, 1] Find x such that F(x) = U, return x F(x) = P[X <= x] Since F is a monotonically increasing function in x, we can reliably use F-1 F-1(U) = x 1/1/2019 VMASC MSIM 710/810
INVERSE TRANSFORM METHOD PROOF! 1/1/2019 VMASC MSIM 710/810
PROOF BY PICTURE 1/1/2019 VMASC MSIM 710/810
EXAMPLE Weibull (a = 1.5, b = 6) example 1/1/2019 VMASC MSIM 710/810
WEIBULL 1/1/2019 VMASC MSIM 710/810
WEIBULL Trickeration: 1-U and U are identically distributed 1/1/2019 VMASC MSIM 710/810
SPECIAL CASE: EXPONENTIALS Exponential = Weibull with… b = 1/l a = 1 X = -1/l * ln(1 – U) 1/1/2019 VMASC MSIM 710/810
DISCRETE DISTRIBUTIONS P[X=xi]=pi 1/1/2019 VMASC MSIM 710/810
NORMALS F, the CDF of the Normal Distribution, cannot be written down in closed form What to Do? exploit the Central Limit Theorem use conditional probability for a new method 1/1/2019 VMASC MSIM 710/810
EXPLOITING THE CLT Result: sum of n i.i.d. random variables (m, s2) N(nm, ns2) Method (Composite) Generate U1, U2, ..., U30 ~U[0, 1] SUM ~ N(30 * ½, 30 * 1/6) (SUM – 15)/sqrt(5) ~ N(0, 1) CLT approximation is more exact with data having symetric distributions “30” comes from very old folklore (Galton) 1/1/2019 VMASC MSIM 710/810
ACCEPTANCE-REJECTION METHOD To generate variate X from inaccessible CDF FX... Generate x uniformly in the Range of X Generate U~U[0, max(f(x))] if U <= fX(x), return x otherwise, try again 1/1/2019 VMASC MSIM 710/810
Proof: Consider this slice 1/1/2019 VMASC MSIM 710/810
EXACT COMPOSITION METHODS n Summed exponentials make a Gamma(n, l) Two summed Uniforms make a Triangular Summed Bernouli’s make a Binomial See ... Handy T&R Facts.pdf 1/1/2019 VMASC MSIM 710/810
SUMMARY Inverse transform method is exact and simple Composite methods are easy You need to know a little about the probability you are modeling Excel has inverse functions built in! 1/1/2019 VMASC MSIM 710/810