Professional Documents
Culture Documents
Simulation
Discrete-Event System Simulation
Dr. Mesut Gne
Chapter 4
Statistical Models in Simulation
In this chapter:
Review several important probability distributions Present some typical application of these models
Review of Terminology and Concepts In this section, we will review the following concepts:
Discrete random variables Continuous random variables Cumulative distribution function Expectation
Discrete Random Variables X is a discrete random variable if the number of possible values of X is finite, or countable infinite. Example: Consider jobs arriving at a job shop.
- Let X be the number of jobs arriving each week at a job shop. Rx = possible values of X (range space of X) = {0,1,2,} p(xi) = probability the random variable X is xi , p(xi) = P(X = xi)
1. p( xi ) 0, for all i 2.
i =1
p( xi ) = 1
The collection of pairs [xi, p(xi)], i = 1,2,, is called the probability distribution of X, and p(xi) is called the probability mass function (pmf) of X.
P(a X b) = f ( x)dx
a
1. f ( x) 0 , for all x in R X 2.
RX
f ( x)dx = 1
3. f ( x) = 0, if x is not in RX
Properties
1. P ( X = x0 ) = 0, because f ( x)dx = 0
x0
x0
Continuous Random Variables Example: Life of an inspection device is given by X, a continuous random variable with pdf:
1 x / 2 e , x0 f ( x) = 2 0, otherwise
Lifetime in Year
X has an exponential distribution with mean 2 years Probability that the devices life is between 2 and 3 years is:
1 3 x / 2 P(2 x 3) = e dx = 0.14 2 2
Chapter 4. Statistical Models in Simulation 7 Dr. Mesut Gne
F ( x) = p ( xi )
xi x
If X is continuous, then
F ( x) = f (t )dt
3. lim F ( x) = 0
x
1 x t / 2 F ( x) = e dt = 1 e x / 2 2 0
The probability that the device lasts for less than 2 years:
Expectation
The expected value of X is denoted by E(X)
If X is discrete If X is continuous
E ( x) = xi p ( xi )
E ( x) = x f ( x)dx
all i
a.k.a the mean, m, , or the 1st moment of X A measure of the central tendency
Expectations
Example: The mean of life of the previous inspection device is:
1 x / 2 x / 2 E ( X ) = xe dx = xe + e x / 2 dx = 2 0 2 0 0
1 2 x / 2 2 e x / 2 + e x / 2 dx = 8 E ( X ) = x e dx = x 0 2 0 0
2
Hence, the variance and standard deviation of the devices life are: 2
V (X ) = 8 2 = 4
= V (X ) = 2
Chapter 4. Statistical Models in Simulation 11 Dr. Mesut Gne
Expectations
1 x / 2 x / 2 E ( X ) = xe dx = xe + e x / 2 dx = 2 0 2 0 0
1 x / 2 + e x / 2 dx = 2 E ( X ) = xe x / 2 dx = xe 0 2 0 0 Partial Integration
Useful Statistical Models In this section, statistical models appropriate to some application areas are presented. The areas include:
Queueing systems Inventory and supply-chain systems Reliability and maintainability Limited data
13
14
15
16
Useful models Other areas For cases with limited data, some useful distributions are:
Uniform Triangular Beta
Other distribution:
Bernoulli Binomial Hyperexponential
17
Discrete Distributions Discrete random variables are used to describe random phenomena in which only integer values can occur. In this section, we will learn about:
Bernoulli trials and Bernoulli distribution Binomial distribution Geometric and negative binomial distribution Poisson distribution
18
xj =1 p, p j ( x j ) = p( x j ) = , q := 1 p, x j = 0
where E(Xj) = p and V(Xj) = p(1-p) = pq
j = 1,2,..., n
Bernoulli process:
The n Bernoulli trials where trails are independent: p(x1,x2,, xn) = p1(x1)p2(x2) pn(xn)
Chapter 4. Statistical Models in Simulation 19 Dr. Mesut Gne
Binomial Distribution
The number of successes in n Bernoulli trials, X, has a binomial distribution.
n x n x p q , x = 0,1,2,..., n p( x) = x 0, otherwise
The number of outcomes having the required number of successes and failures Probability that there are x successes and (n-x) failures
20
Geometric Distribution
Geometric distribution
The number of Bernoulli trials, X, to achieve the 1st success:
q x 1 p, x = 0,1,2,..., n p ( x) = otherwise 0,
E(x) = 1/p, and V(X) = q/p2
21
y 1 y k k k 1 q p , y = k , k + 1, k + 2,... p ( x) = 0, otherwise
y 1 y k k 1 p ( x) = p k 1 q p { 44 44 k th success 1 2 3
(k-1 ) successes
22
Poisson Distribution
Poisson distribution describes many random processes quite well and is mathematically quite simple.
where > 0, pdf and cdf are:
x p( x) = x! e , x = 0,1,... 0, otherwise
E(X) = = V(X)
F ( x) =
i =0
i e
i!
23
Poisson Distribution Example: A computer repair person is beeped each time there is a call for service. The number of beeps per hour ~ Poisson( = 2 per hour).
The probability of three beeps in the next hour: p(3) = 23/3! e-2 = 0.18 also, p(3) = F(3) F(2) = 0.857-0.677=0.18 The probability of two or more beeps in a 1-hour period: p(2 or more) = 1 ( p(0) + p(1) ) = 1 F(1) = 0.594
24
Continuous Distributions Continuous random variables can be used to describe random phenomena in which the variable can take on any value in some interval. In this section, the distributions studied are:
Uniform Exponential Weibull Normal Lognormal
25
Uniform Distribution
A random variable X is uniformly distributed on the interval (a, b), U(a, b), if its pdf and cdf are:
1 , a xb f ( x) = b a 0, otherwise
Properties
x<a 0, x a F ( x) = , a x<b b a xb 1,
P(x1 < X < x2) is proportional to the length of the interval [F(x2) F(x1) = (x2-x1)/(b-a)] E(X) = (a+b)/2 V(X) = (b-a)2/12
U(0,1) provides the means to generate random numbers, from which random variates can be generated.
Chapter 4. Statistical Models in Simulation 26 Dr. Mesut Gne
Exponential Distribution
A random variable X is exponentially distributed with parameter > 0 if its pdf and cdf are:
e x , x 0 f ( x) = elsewhere 0,
E(X) = 1/ V(X) = 1/2
x<0 0, x F ( x) = t x 0 e dt = 1 e , x 0
27
Exponential Distribution
Used to model interarrival times when arrivals are completely random, and to model service times that are highly variable For several different exponential pdfs (see figure), the value of intercept on the vertical axis is , and all pdfs eventually intersect.
28
Exponential Distribution
Memoryless property For all s and t greater or equal to 0: P(X > s+t | X > s) = P(X > t) Example: A lamp ~ exp( = 1/3 per hour), hence, on average, 1 failure per 3 hours.
- The probability that the lamp lasts longer than its mean life is:
P(X > 3) = 1-(1-e-3/3) = e-1 = 0.368
- The probability that it lasts for another hour given it is operating for 2.5 hours:
P(X > 3.5 | X > 2.5) = P(X > 1) = e-1/3 = 0.717
29
Exponential Distribution
Memoryless property
30
Weibull Distribution
A random variable X has a Weibull distribution if its pdf has the form:
x 1 x exp , x f ( x) = 0, otherwise
3 parameters:
( < < )
Example: = 0 and = 1:
31
Weibull Distribution
Weibull Distribution
x 1 x exp , x f ( x) = 0, otherwise
For = 1, =0
1 x 1 f ( x) = exp , x 0, otherwise
32
Normal Distribution
A random variable X is normally distributed if it has the pdf:
1 x 2 1 f ( x) = exp , < x < 2 2
Mean: < < 2 Variance: > 0 Denoted as X ~ N(,2)
Special properties:
xlim f ( x) = 0, and lim f ( x) = 0 x f(-x)=f(+x); the pdf is symmetric about . The maximum value of the pdf occurs at x = ; the mean and mode are equal.
33
Normal Distribution
Evaluating the distribution:
Use numerical methods (no closed form) Independent of and , using the standard normal distribution: Z ~ N(0,1) Transformation of variables: let Z = (X - ) / ,
x F ( x ) = P ( X x ) = P Z ( x ) / 1 z2 / 2 = e dz 2 =
( x ) / ( z )dz = ( x )
, where ( z ) =
1 t 2 / 2 e dt 2
34
Normal Distribution
Example: The time required to load an oceangoing vessel, X, is distributed as N(12,4), =12, =2
The probability that the vessel is loaded in less than 10 hours:
35
Lognormal Distribution
A random variable X has a lognormal distribution if its pdf has the form:
1 (ln x ) 2 exp , x > 0 f ( x) = 2 x 2 2 0, otherwise
2=0.5,1,2. =1,
36
Poisson Distribution
Definition: N(t) is a counting function that represents the number of events occurred in [0,t]. A counting process {N(t), t>=0} is a Poisson process with mean rate if:
Arrivals occur one at a time {N(t), t>=0} has stationary increments {N(t), t>=0} has independent increments
Properties
( t ) n t P[ N (t ) = n] = e , n!
Equal mean and variance: E[N(t)] = V[N(t)] = t Stationary increment: The number of arrivals in time s to t is also Poisson-distributed with mean (t-s)
37
The 1st arrival occurs after time t iff there are no arrivals in the interval [0,t], hence: P(A1 > t) = P(N(t) = 0) = e-t P(A1 <= t) = 1 e-t [cdf of exp()]
Interarrival times, A1, A2, , are exponentially distributed and independent with mean 1/ Arrival counts ~ Poisson()
Stationary & Independent
38
Pooling:
Suppose two Poisson processes are pooled together N1(t) + N2(t) = N(t), where N(t) is a Poisson processes with rates 1 + 2
N1(t) ~ Poisson[1] N2(t) ~ Poisson[2]
Chapter 4. Statistical Models in Simulation
1 2
1 + 2
N(t) ~ Poisson(1 + 2)
39
40
Summary
The world that the simulation analyst sees is probabilistic, not deterministic. In this chapter:
Reviewed several important probability distributions. Showed applications of the probability distributions in a simulation context.
Important task in simulation modeling is the collection and analysis of input data, e.g., hypothesize a distributional form for the input data. Student should know:
Difference between discrete, continuous, and empirical distributions. Poisson process and its properties.
41