Download presentation
Presentation is loading. Please wait.
Published byOswald Lewis Modified over 8 years ago
1
Module 9.4 Random Numbers from Various Distributions -MC requires the use of unbiased random numbers
2
Distribution of numbers Description of portion of times each possible outcome or each possible range of outcomes occurs on the average over many trials
3
Uniform distribution Generator is just as likely to return value in any interval In list of many random numbers, on the average each interval contains same number of generated values Methods for generating random numbers in other distributions depend on an ability to produce random numbers with a UD.
4
Discrete distribution Distribution with discrete values Probability function (or density function or probability density function) Returns probability of occurrence of particular argument value
5
Discrete Distribution To Generate Random Numbers in Discrete Distribution with Equal Probabilities for Each of n Events Generate uniform random integer from a sequence of n integers, where each integer corresponds to an event
6
Discrete Distribution To generate random numbers in discrete distribution with probabilities p 1, p 2, …, p n for events e 1, e 2, …, e n, respectively, where p 1 + p 2 + … + p n = 1 Generate rand, uniform random floating point number in [0, 1) If rand < p 1, then return e 1 else if rand < p 1 + p 2, then return e 2 … else if rand < p 1 + p 2 + … + p n - 1, then return e n - 1 else return e n
7
Continuous distribution Distribution with continuous values Probability function (or density function or probability density function) Indicates probability that given outcome falls inside specific range of values
8
Normal or Gaussian distribution Probability density function, where µ is mean and is standard deviation:
9
Box-Muller-Gauss Method a = uniform random number in [0, 2π) rand = uniform random number in [0, 1) b = Compute b sin(a) + µ and b cos(a) + µ, are normally distributed with mean µ and sdev. sigma
10
Exponential Distributions Probability density functions: f(t) = |r|e rt with r 0 or f(t) = |r|e rt with r > 0 and t < 0 Graph of f(t) = 2e -2t
11
Exponential Method For probability density function |r|e rt with r 0 or f(t) = |r|e rt with r > 0 and t < 0 Compute ln(rand)/r, where rand = a uniform random number in [0.0, 1.0)
12
Rejection Method - When other methods do not apply For random numbers in interval [a, b) for distribution f(x) If f(randinterval) > randupperbound, then return randinterval, where randInterval - uniform random number in interval [a, b) randUpperBound - uniform random number in [0, upper bound for f) else repeat the process
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.