Day 6 Prob Dists in Simulation Pg 245-255
-
Upload
vatsal-goel -
Category
Documents
-
view
214 -
download
0
Transcript of Day 6 Prob Dists in Simulation Pg 245-255
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
1/11
Probability Distributions in Simulations
Probability Distributions in Simulations ..................................................................................................... 1Finitely Bounded Distributions .................................................................................................................. 2
Uniform Distributions ............................................................................................................................ 2Non-Uniform Distributions .................................................................................................................... 3
Triangular Distributions ..................................................................................................................... 3
Beta Distributions ............................................................................................................................. 4Unbounded Distributions.......................................................................................................................... 5
Normal Distributions ............................................................................................................................. 6General Unbounded Distributions ......................................................................................................... 6
Semi-infinitely Bounded (One-sided) Distributions .................................................................................... 6Exponential Distributions ...................................................................................................................... 7Gamma/Erlang Distributions ................................................................................................................. 8Poisson Distributions .......................................................................................................................... 10
A frequent reason to use simulation is to study the potential behavior of a process or product that has notyet been put in place or constructed. In these circumstances there might be stochastic variable whose
distributions are relatively unknown and for which it is not possible to collect data. To proceed with thesimulation distributions for these variables must be postulated.
One way to postulate unknown distributions is to use empirical distributions of similar processes orproducts. This is a well understood procedure and will not be further considered here. Another way is toselect an appropriate, known mathematical distribution; for this it is useful to understand the generalcharacteristics of these distributions. There are many distributions that can be used in simulation; hereonly the most frequently used are considered. There are various ways to classify then. The followingmay be useful.
Page No. 245
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
2/11
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
3/11
Probability Distributions in Simulations
In Excel the formula
=a+(b-a)*rand()
will produce a random number in the interval (a, b) and
=trunc(rand()*(M+1-K) + K,0)
will produce a random integer from the discrete Uniform distribution between K and M.
1.2 Non-Uniform Distributions
There are indeed real-world processes which produce values that are adequately represented withUniform distributions, but most real-world distribution have a favorite value, the mode, near which mostother values fall. Values removed from the mode are less frequent (have lower probability) than thosenear the mode, leading to a non-uniform distribution with one or more peaks or mounds at their localmodes in their graph.
If a distribution appears to have more than one peak or mound (multimodal distributions) it is often the
results from the superposition of several unimodal distributions. In those circumstances it is best tosimulate the process with separate, unimodal distributions and then combine the stream of numbers fromeach of the unimodal distributions to simulate the actual, multimodal process.
In the following only unimodal distributions will be considered. These distribution have only a single peakor mound unless the mode appears at one end of the interval in which the values with non-zeroprobability fall.
1.2.1 Triangular Distributions
The triangular distribution is usually specified by three numbers: the lower bound, a, of the interval ofvalues with non-zero probability, the mode, b, of the distribution, and the upper bound, c, of the interval ofvalues with non-zero probability.
Example: Triangular Distribution for (0, 2, 10) from BCNN 4thFig 5.21
The triangular distribution is often used when subject matter experts (SMEs) are asked to specify anunknown distribution for, say, the completion time of some process or other situations that have anumeric descriptor. In this case, the minimum, a, may be specified as the response to a question like:
When everything goes right what is the shortest time in which the process can be completed?.
Similarly, the mode, b, may be specified by the response to a question like:
Page No. 247
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
4/11
Probability Distributions in Simulations
Considering all that might happen, what is the most likely time in which the process can be completed?
and finally, the maximum, c, may be specified by the response to a question like:
Considering many events that might conspire to delay the completion of the process, what is the longesttime in which the process can reasonably be completed?
Obviously the longest time could be several centuries or never (which is a very long time indeed), sosome discussion may be needed to determine a reasonable longest time.
In different contexts, these question may need to be rephrased appropriately.
Few processes actually follow a triangular distribution but the distribution may be accurate enough formany purposes. Its advantage is that data for its specification can often be rather accurately gathered byquestions like those above. Best is when multiple SMEs can closely agree on the values of a, b, and c.
The Triangular distribution is described in Banks et al starting on page 182. Various sources use differentlabels for these parameters as follows:
Name BCNN Excel GPSS World GPSS/H
Minimum a min Min minMode b mode Mode mode
Maximum c max Max max
Random variates from the Triangular distribution are generated by the following formulas:
Excel =if(p
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
5/11
Probability Distributions in Simulations
Example: Beta Distribution from BCNN 4thFig. 5.23, p186
The Beta distribution is described in BCNN beginning on page 185. Again, the four parameters aredesignated by various symbols:
Name BCNN Excel GPSS World GPSS/HShape 1 parameter 1 alpha 1 alpha1
Shape 2 parameter 2 beta 2 alpha2
Minimum value a min 1Maximum value b max 2
The Beta distribution degenerates to the Uniform distribution if the two Shape parameters are both = 1.
The values from the Beta distributed may be generated by the following formulas:
Excel =betainv(p, alpha, beta, min, max)
In Excel, values of alpha and beta of the best Beta distribution to fit empirical data can be determined bya procedure using Solver. An example may be found the workbook file BetaDistFit.xlson the sheetnamed FitToData, while visual effects of various values of the shape parameters may be examined on thesheet named ShapeGraph. In general, equal values of the shape parameters will generate a symmetricdistribution whose mean/median/mode will be equal to .5. Values of beta less than alpha will generate aleft skewed distribution while values of beta greater than alpha will generate a right skewed distribution,but the effect of changes in beta relative to alpha are not symmetric.
Question to SMEs such as those included under the Triangular distribution may also be used to generateappropriate Beta distributions.
1.3 Unbounded Distributions
Included among the unbounded distributions are those whose values with non-zero probability extentfrom minus infinity to plus infinity, i.e., all intervals around any real value have non-zero probability,including intervals around negative values.
Of necessity, probabilities of single values from continuous distribution are not defined.
Page No. 249
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
6/11
Probability Distributions in Simulations
1.3.1 Normal Distributions
The only unbounded distribution in frequent use in simulation is the Normal distribution. This is thefamiliar unimodal, symmetric distribution whose values with non-zero probability extend to infinity in both
directions. A particular Normal distribution is determined by two parameters, the mean and the
standard deviation . A common symbol for such a distribution is N(, ). The specification that a
random variable has a Normal distribution is often written as X ~ N(, ). Special symbols for theStandard Normal distribution N(0, 1) are (z) for the pdf and (z) for the cdf.
Example: Standard Normal Distribution from BCNN 4thFig 5.12
The values from the Normal distribution may be generated by the following formulas:
Excel =norminv(p, mu, sigma)
1.3.2 General Unbounded Distributions
These are unbounded distributions that are either skewed and/or flatter (platykurtic) or more peaked(leptokurtic) than the Normal distribution.
A reference for more information on these distributions is Abramowitz and Stegun (1972)3with the web
sites of Mathworld as useful direct sources; see skewnessand kurtosis.
When a distribution is suspected to be very flat (platykurtic) it may begin to resemble a continuousuniform distribution (the ultimate flat distribution) and might be better model that way. Similarly, when adistribution is very peaked (leptokurtic) it might begin to resemble a peaked triangular distribution.Consideration should be given to such substitutions.
1.4 Semi-infinitely Bounded (One-sided) Distributions
These are distributions whose values with non-zero probability are bounded on one end but extendinfinitely on the other. Most of these distribution used in simulation are all members of the same family of
distributions called the Gamma of which one, the Exponential, the simplest special case. The other mostfrequently used family of one-sided distribution is the Weibull of which, again, the Exponential thesimplest special case.
3Abramowitz, M. and Stegun, I. A. (Eds.). Handbook of Mathematical Functions with Formulas, Graphs,
and Mathematical Tables, 9th printing.New York: Dover, p. 928, 1972.
Page No. 250
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
7/11
Probability Distributions in Simulations
As commonly used the Exponential distribution has only one parameter while the others have can haveup to three. This allows the more general Gamma and Weibull distributions to have many differentshapes at the cost of complexity.
1.4.1 Exponential Distributions
This distribution is defined on the interval [0, ) with the mode at x = 0 and probability steadily decreasingas x -> . This means that values near zero have relatively high probability with large values having everdecreasing probabilities as they get larger. This is often the case with inter-arrival times or service timesin that arrivals often occur in bunches, within which inter-arrival times are short, or a server being able tosatisfy many transactions quickly with only occasional ones taking longer. For instance, at an ATM mostpeople take out cash, for which current ATM designs have shortcuts so that the transaction can becompleted quickly, while the occasional check on balances, deposits, and multiple transaction are far lessfrequent. This situation often makes the application of the Exponential distribution appropriate.
In such circumstances the Exponential distribution should usually be considered before trying the morecomplicated Gamma and Weibull distributions.
As can be seen from the following figures, the one parameter is usually called . It is related to the mean
by = 1/and the variance by 2
= 1/2
. Applied to inter-arrival times, the mean inter-arrival time caneasily be observed by counting all arrivals within some time period and dividing by that time interval.Thus if there are 240 arrivals in two hours the mean inter-arrival time has to be
240 arrivals/2 hours = 240 arrivals/120 minutes = 2 arrivals/minute
yielding a value of = .5 and a variance of 2= 4if the distribution is assumed to be the Exponential.
From the graphs it may be observed that is the probability of near zero inter-arrival times.
.
Page No. 251
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
8/11
Probability Distributions in Simulations
Example: Exponential Distribution from BCNN 4thFigures 5.9 and 5.10 on page 168.
The Exponential distribution (also often called the negative exponential) is described in BCNN starting onpage 167. In general, it has two parameters.
Name BCNN Excel GPSS World GPSS/H
Locate parameter n/a n/a n/aScale parameter lambda mean
Of the sources mentioned, only GPSS World supports the Locate parameter. The other sources, ineffect, set the Locate parameter to 0 (zero).
In GPSS World notation the mean is + and the variance is 2.
The values from the exponential distribution are generated by the following formulas:
Excel =-ln(1-p)/lambda
1.4.2 Gamma/Erlang Distributions
Gamma/Erlang distributions are unimodal, asymmetric, and define for x 0. One of their parameters, the
shape parameter called , determines the location of the mode. = 1 defines the Exponential distribution
as a special case with its mode at x = 0. As increases the mode moves to the right in such a way thatthe probability rises steeply with increasing x from 0 but falls much more slowly after the mode. Typicalgraphs are shown in the example.
Example: Gamma distributions from BCNN 4thFigure 5.10a on page 171
Page No. 252
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
9/11
Probability Distributions in Simulations
The other parameter besides is the scale parameter often called . It determines the location of the
mean = 1/and with determines the variance 2= 1/(
2).
Example: Effect of the scale parameter for Gamma distributions with scale parameter = 1.
Gamma Distribution for Scale Parameter = 1
and Various Shape Parameters
0
0.1
0.2
0.3
0.4
0.5
0.60.7
0.8
0.9
1
0 0.5 1 1.5 2 2.5 3
x
Probability
2
3
4
5
Shape parameter =
NB: in Excel is in BCNN
and in Excel is 1/() in BCNN
The shapes of Gamma distributions for various values of and may be examined using thespreadsheet called GammaDistributions.xls.
The Gamma distribution is described in BCNN starting on page 170. It has three parameters:
Name BCNN Excel GPSS World GPSS/HLocate parameter n/a n/a n/a
Page No. 253
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
10/11
Probability Distributions in Simulations
Shape parameter
Scale parameter
Of the sources mentioned, only GPSS World supports the Locate parameter. The other sources, ineffect, set the Locate parameter to 0 (zero).
The mean of the Gamma Distribution (in BCNN notation) is = 1/and the variance is 2= 1/(2). Noticethat in Excel notation is in BCNN notation and in Excel notation is 1/() in BCNN notation.
The values from the Gamma distribution are generated by the following formulas:
Excel =gammainv(p, alpha, beta)
When in BCNN notation is an integer k then the Gamma distribution is also called the Erlang distributionof order k. This distribution (see BCNN p171-2) can be used for the service time of an entity goingthrough k stations each of which has an Exponential distribution.
1.4.3 Poisson Distributions
The Poisson distribution is a semi-infinite discrete distribution defined on the non-negative integers. Itsenvelope is shaped similarly to a Gamma distribution in that it has one or two (adjacent) most likelyvalues (unimodal in spite of the possibility of two adjacent values having the same highest probability)and falls off sharply to the left of the mode but more slowly to the right.
Example: Poisson Distribution from BCNN 4thFigure 5.7 on p164
The Poisson distribution may often be used when some whole number of events are expect to occurwithin given period of time, such as transaction arrivals or demand for goods but the actual number will
vary according to the probabilities given by the Poisson distribution.
The Poisson distribution has one parameter designated as in BCNN. However, it may just a well be
designated as the mean since = 2= . Similarly to the Exponential distribution, the mean of the
Poisson may be estimated by the taking the total number of events in some number of time intervals anddividing the total number by the number of intervals. For example, if a total of 600 goods were bought in30 days then the mean has to be 20 goods per day no matter how many were actually bought each day.
The Poisson distribution is described in BCNN starting on page 163. It has one parameter variouslydesignated as follows::
Page No. 254
-
8/10/2019 Day 6 Prob Dists in Simulation Pg 245-255
11/11
Probability Distributions in Simulations
Name BCNN Excel GPSS World GPSS/HLocate parameter mean mean mean
The values from the Poisson distribution are generated by the following formulas:
Excel =poisinv(p, mean)
Page No. 255