ebook img

How do we generate random variables? PDF

36 Pages·2013·0.57 MB·English
by  
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview How do we generate random variables?

2WB05 Simulation Lecture 8: Generating random variables Marko Boon http://www.win.tue.nl/courses/2WB05 January7,2013 Outline 2/36 1. How do we generate random variables? 2. Fitting distributions DepartmentofMathematicsandComputerScience Generating random variables 3/36 How do we generate random variables? • Sampling from continuous distributions • Sampling from discrete distributions DepartmentofMathematicsandComputerScience Continuous distributions 4/36 Inverse Transform Method Let the random variable X have a continuous and increasing distribution function F. Denote the inverse of F by F−1. Then X can be generated as follows: • Generate U from U(0,1); • Return X = F−1(U). If F is not continuous or increasing, then we have to use the generalized inverse function F−1(u) = min{x : F(x) ≥ u}. DepartmentofMathematicsandComputerScience Continuous distributions 5/36 Examples • X = a + (b − a)U is uniform on (a,b); • X = −ln(U)/λ is exponential with parameter λ; • X = (−ln(U))1/a/λ is Weibull, parameters a and λ. Unfortunately, for many distribution functions we do not have an easy-to-use (closed-form) expression for the inverse of F. DepartmentofMathematicsandComputerScience Continuous distributions 6/36 Composition method This method applies when the distribution function F can be expressed as a mixture of other distribution func- , ,... tions F F , 1 2 ∞ (cid:88) F(x) = p F (x), i i i=1 ∞ where (cid:88) p ≥ 0, p = 1 i i i=1 The method is useful if it is easier to sample from the F ’s than from F. i • First generate an index I such that P(I = i) = p , i = 1,2,... i • Generate a random variable X with distribution function F . I DepartmentofMathematicsandComputerScience Continuous distributions 7/36 Examples • Hyper-exponential distribution: F(x) = p F (x) + p F (x) + ··· + p F (x), x ≥ 0, 1 1 2 2 k k where F (x) is the exponential distribution with parameter µ , i = 1,...,k. i i • Double-exponential (or Laplace) distribution:  1ex, x < 0;  2 f (x) =  1e−x, x ≥ 0, 2 where f denotes the density of F. DepartmentofMathematicsandComputerScience Continuous distributions 8/36 Convolution method ,..., In some case X can be expressed as a sum of independent random variables Y Y , so 1 n X = Y + Y + ··· + Y . 1 2 n where the Y ’s can be generated more easily than X. i Algorithm: • Generate independent Y ,...,Y , each with distribution function G; 1 n • Return X = Y + ··· + Y . 1 n DepartmentofMathematicsandComputerScience Continuous distributions 9/36 Example µ If X is Erlang distributed with parameters n and , then X can be expressed as a sum of n independent /µ exponentials Y , each with mean 1 . i Algorithm: • Generate n exponentials Y ,...,Y , each with 1 n µ mean ; • Set X = Y + ··· + Y . 1 n More efficient algorithm: • Generate n uniform (0,1) random variables ,..., U U ; 1 n • Set X = −ln(U U ···U )/µ. 1 2 n DepartmentofMathematicsandComputerScience Continuous distributions 10/36 Acceptance-Rejection method Denote the density of X by f . This method requires a function g that majorizes f , g(x) ≥ f (x) for all x. Now g will not be a density, since (cid:90) ∞ c = g(x)dx ≥ 1. −∞ Assume that c < ∞. Then h(x) = g(x)/c is a density. Algorithm: 1. Generate Y having density h; ( , ) 2. Generate U from U 0 1 , independent of Y; 3. If U ≤ f (Y)/g(Y), then set X = Y; else go back to step 1. The random variable X generated by this algorithm has density f . DepartmentofMathematicsandComputerScience

Description:
Jan 7, 2013 Let the random variable X have a continuous and increasing where Fi(x) is the exponential distribution with parameter µi, i = 1,,k.
See more

The list of books you might like

book image

As Good as Dead

Holly Jackson
·2021
·6.41 MB

book image

Credence

Penelope Douglas
·487 Pages
·2020
·0.86 MB

book image

Better Than the Movies

Lynn Painter
·2021
·1.51 MB

book image

The Subtle Art of Not Giving a F*ck

Mark Manson
·224 Pages
·2016
·1.26 MB

book image

By Kristin E. Anderson

215 Pages
·2012
·11.06 MB

book image

Dünkirchen 1940: The German View of Dunkirk

Robert Kershaw
·2022
·4.572 MB

book image

El cerebro de Buda

Rick Hanson & Richard Mendius
·2011
·0.6291 MB

book image

Pablo Escobar em flagrante

Juan Pablo Escobar
·241 Pages
·2017
·2.57 MB

book image

Commencement

University of Maryland at College Park
·2006
·3.5 MB

book image

Commencement Exercises December 2006

Broward Community College
·2006
·1.8 MB

book image

Avertissements Agricoles - Grandes cultures - Ile de France - 2006 - 13

Service Régional de Protection des Végétaux, Groupements de Défense contre les Organismes Nuisibles
·2006
·0.68 MB

book image

Tesla Anlaşılamamıs Dahi

Margaret Cheney
·213 Pages
·2016
·1.11 MB

book image

Greek Government Gazette: Part 2, 2006 no. 551

The Government of the Hellenic Republic
·2006
·0.26 MB

book image

Greek Government Gazette: Part 9, 2009 no. 52

The Government of the Hellenic Republic
·2009
·0.11 MB

book image

The Benko gambit

Jan Pinski; John Shaw
·125 Pages
·2005
·7.507 MB