8/14/2019 Vorlesung02 Statistical Models in Simulation
1/42
Das Bild kann zurzeitnicht angezeigtwerden.
UNIVERSITT
D U I S B U R GE S S E N
Prof. Dr.-Ing. Bernd Noche
Rechnergesttzte Netzanalysenehem.:Simulation in Logist ics II
Probability and Statistics in
Simulation
Lecturer: Prof. Dr.-Ing. Bernd Noche
tul06.11.2013 1Rechnergesttzte Netzanalysen
8/14/2019 Vorlesung02 Statistical Models in Simulation
2/42
Perform statistic
analyses of the
simulation output data
Design the
simulation
experiments
Probabilityand
statistics
Model aprobabilistic
s stem
Generate randomsamples from the
in ut distribution
Validate the
simulation
Choose the
input probabilistic
mode s r u on
Rechnergesttzte Netzanalysen 206.11.2013
8/14/2019 Vorlesung02 Statistical Models in Simulation
3/42
. ueue ng ys em: n erarr va mes an e serv ce mes.
Exponential distribution, Weibull distribution, and gamma distribution,
normal distribution.
2. Inventory System: the number of units demanded per order or per time period,
the time between placing an order, and the lead time.
Geometric, Poisson, and negative binomial distribution provide a range of
distribution shapes that satisfy a variety of demand patterns. The lead time distribution can often be fitted fairly well by a gamma
distribution.
3. Reliability and Maintainability: time to failure, time to repair.
Time to failure has been modeled with exponential, gamma and Weibull
.
4. Limited Data: in many instances simulations begin before data collection has
been completed.
06.11.2013 Rechnergesttzte Netzanalysen 3
, , .
8/14/2019 Vorlesung02 Statistical Models in Simulation
4/42
Random Variables and Probabilit Distributions
Random Variable (RV)A real number assigned to each outcome of an
experiment in the sample spaceCan only take a finite or a countable infinite set of
values
e.g., hit or miss {0 or 1}, Flip a coin of shooting abasketball, outcome of throwing a dart {1, 2, ,
,Simulate Monte Carlo: throw a dice {1, 2, 3, 4, 5,
6}, a pair of dices {2, 3, 4, , 10, 11, 12} Continuous Random Variable
Can take on a continuum of values (infinite)
06.11.2013 Rechnergesttzte Netzanalysen 4e.g., customer interarrival time
8/14/2019 Vorlesung02 Statistical Models in Simulation
5/42
Discrete Random Variables
Rechnergesttzte Netzanalysen 506.11.2013
8/14/2019 Vorlesung02 Statistical Models in Simulation
6/42
Discrete Random Variables
Restrictions/Conditions
0 p(xi) 1 for all i x = 1 certain outcome
Alternative representation for the probability distribution is the
cumulativedistribution function (CDF) (Verteilungsfunktion),
F(x) Definition: F(x) = P(X x) relative to probability mass function: F(x) =(xi x)p(xi) Properties of F(x):
(1) 0 F(x) 1(2) F( ) = 0(3) F( ) = 1
06.11.2013 Rechnergesttzte Netzanalysen 6
8/14/2019 Vorlesung02 Statistical Models in Simulation
7/42
Discrete Random Variables
Ex: S = {0, 1, 2, 3} four possible outcomes
p(0) = 1/8 p(1) = 3/8 p(2) = 3/8 p(3) = 1/8
(i = 0 to 3)p(xi) = 1/8 + 3/8 + 3/8 + 1/8 = 1
p(Xi) F(Xi)
1 13
1.000
0.875
1/2 1/2
2
0.500
1/4
10 2 3 Xi 10 2 3
1/4
Xi
0.1250
06.11.2013 Rechnergesttzte Netzanalysen 7
8/14/2019 Vorlesung02 Statistical Models in Simulation
8/42
Continuous Random Variables
Probability density function (pdf)(Dichtefunktion), f(x)
e n on: a = (from a to b) x x
Conditions: f(x) f x(1) f(x) 0 and
=rom o
xa b
P(a X b)
Cumulative distribution function (cdf), F(x)Definition: F(x) = (from to x)f(y) dy = P(X x)
variable X assuming a value less than or equal to x06.11.2013 8Rechnergesttzte Netzanalysen
8/14/2019 Vorlesung02 Statistical Models in Simulation
9/42
values between 0 and 1 and equal probability
f (X) F (X)
= =0.75
UNFRM (0,1)
. .0.5
.
X X0 0.25 10.5 0.75 1
pdf cdf
06.11.2013 Rechnergesttzte Netzanalysen 9
8/14/2019 Vorlesung02 Statistical Models in Simulation
10/42
Discrete and Continuous Random
Variables
Mixed Distribution
-
probability Value 2 - 1/3 p(2) = 1/3
=Between 1 and 2 - 1/3 probability = 1
F (X)f (X)
1 1/3 1/3 1 1.00 X
2
1/3 1/3 0.33
.
(1,2)
1
X X0 1 2 0 1 2
06.11.2013 Rechnergesttzte Netzanalysen 10
+ x-
8/14/2019 Vorlesung02 Statistical Models in Simulation
11/42
Ex ectation and Moments
Used to characterize robabilit distribution functions
The Expectation (expected value) of a random variable
, (all i) i iE[x] =(all x)x f(x)dx when x is continuous
n genera , can e a unc on o xE[xn] =(all i)xin p(xi) when x is discreteE xn = (all x)xn x x w en x is continuous
The expectation of xn
is defined as the nth
moment of aran om var a e
Expected value is a special case when n = 1, it is thus called
06.11.2013 Rechnergesttzte Netzanalysen 11
8/14/2019 Vorlesung02 Statistical Models in Simulation
12/42
A variant of the nth moment is the nth moment of a
random variable about the meanE[(xE[x])n]
Important: the second moment
about the mean E[(xE[x])2
] =2
=Var[x]
where
the variance (Varianz) of x Var[x] = measures of the spreadof probability distribution
= standard deviation (Standardabweichung) of the
06.11.2013 Rechnergesttzte Netzanalysen 12
ran om var a e
8/14/2019 Vorlesung02 Statistical Models in Simulation
13/42
Expectation and Moments
Other higher order of moments - measures of probability of
distributions
Skewness (Schiefe) - measures if the distribution is symmetric
Mode
Mean
Skewed Positively Skewed Negatively
Kurtosis (Wlbung) - measures flatness or peakedness
Peaked long thin tailsFlat (with short broad tails)
06.11.2013 Rechnergesttzte Netzanalysen 13
8/14/2019 Vorlesung02 Statistical Models in Simulation
14/42
For two random variables x and y:
Cov[x, y] = E[(xE[x]) (yE[y])]
Causal relationship
, =
Formally, p(y|x) = p(y) for discrete
y x = y or con nuous
Measure of dependencecorrelation coefficient,
[-1,1]
Var[x] Var[y]= Cov[x,y]
06.11.2013 Rechnergesttzte Netzanalysen 14
8/14/2019 Vorlesung02 Statistical Models in Simulation
15/42
Functions of Random Variables and
e r roper es
E[x + y] = E[x] + E[y] x + y is a RV
E[x + k] = E[x] + k x + k is a RV
w ere s an ar rary cons an
Properties for Variances Var[x + y] = Var[x] + Var[y] + 2Cov[x, y]
If x, y are independent, Var[x + y] = Var[x] + Var[y] Var[kx] = k2 Var[x]
Var[x + k] = Var[x]
06.11.2013 Rechnergesttzte Netzanalysen 15 Var[kx + ny] = k2
Var[x] + n2
Var[y] + 2kn Cov[x, y]
8/14/2019 Vorlesung02 Statistical Models in Simulation
16/42
06.11.2013 Rechnergesttzte Netzanalysen 16
8/14/2019 Vorlesung02 Statistical Models in Simulation
17/42
Example :Constant100 3s
Constant
No uncertaintyegenera e case No variation (sd = 0)
r a s
06.11.2013 Rechnergesttzte Netzanalysen 17
8/14/2019 Vorlesung02 Statistical Models in Simulation
18/42
Consider an experiment consisting of n trials, eachcan e a success or a a ure.
Xj= 1 if the jth experiment is a success
Xj= 0 if the jth experiment is a failure
Jacob Bernoulli (16541705)The Bernoulli distribution (one trial):
p,
xj =1,j=1,2,...,n
pj xj =p xj = 1 p = q,
0,xj = 0,j=1,2,...,notherwise whereE(Xj) = p and V(Xj) = p (1p) = p q
06.11.2013 Rechnergesttzte Netzanalysen 18
8/14/2019 Vorlesung02 Statistical Models in Simulation
19/42
Let N = # trials, p = probability of each success trial
Example: N=7, p=0.5 X = # of success
X=5
X=4
X=4
...e c.
The mean,E(x) = p + p + + p = np
The variance,V(X) = pq + pq + + pq = npq
06.11.2013 Rechnergesttzte Netzanalysen 201
9
8/14/2019 Vorlesung02 Statistical Models in Simulation
20/42
pro uc on process manu ac ures mac nes on e average a
nonconforming. Every day a random sample of size 50 is taken from the process. If
the sample contains more than 2 nonconforming machines , the process will be.
Question: what is the probability that the process is stopped by the sampling
scheme?
Solution: P(X > 2) = 1 P( X2)
the probability P(X2) is calculated from:
P( X2) = 0.92
Thus, the probability that the production process is stopped on any day, based on
, . . .
the mean number of nonconforming and variance machines in a random sample
of size 50 is:
06.11.2013 Rechnergesttzte Netzanalysen 20
= np = . = , = npq = . . = .
8/14/2019 Vorlesung02 Statistical Models in Simulation
21/42
e geome r c s r u on s re a e o a sequence o ernou r a s; e ran om
variable of interest , X, is defined to be the number of trials to achieve the first
success. The distribution of X is given by
p(x) = qx1p, x = 1, 2,
the event {X = 0} occurs when there are x 1 failures followed by a success. Eachof the failures has an associated probability of q = 1 p, and each success has a
robabilit . Thus
P(FFFFS) = qx1p
the mean and variance are given by
= p
and
V(X) = q/P
06.11.2013 Rechnergesttzte Netzanalysen 21
8/14/2019 Vorlesung02 Statistical Models in Simulation
22/42
Forty percent o t e assem e mac ines are rejecte at t e
inspection station.
ues on: n e pro a y a e rs accep a e
machines is the third one inspected.
consider each inspection as a Bernoulli trial with q = 0.4 and p
= . ,
P(3) = 0.4(0.6) = 0.096
,machines the third one from any arbitrary starting point.
06.11.2013 Rechnergesttzte Netzanalysen 22
8/14/2019 Vorlesung02 Statistical Models in Simulation
23/42
Gives (probability of) the number of events that occur in
a given period
Formula looks quite complicated (and NOT discrete), but
it is discrete and using it is not that difficult
X {0,1,...,t}
otherwise0x!
e p(x)=
- x
Poisson
(Simon Denis, Fr. 17811840 ) Whereis the mean arrival rate. Note thatmust bepositive E(X) = V(X) =Das Bild kann zurzeitnicht angezeigtwerden.
Applications of Poisson Distribution
Discrete distribution, used to model the number of
independent events occuring per unit time,Eg. Batc s zes o customers an tems
If the time betweeen successive events is exponential,
en e num er o even s n a xe me n erva s
poisson.06.11.2013 Rechnergesttzte Netzanalysen 23
8/14/2019 Vorlesung02 Statistical Models in Simulation
24/42
r ng mac ne repa rman s ca e eac me ere s a ca or serv ce. e
number of calls per hour is known to occur in accordance with a Poisson
distribution with a mean of 2 per hour. Question: T e pro a i ity o t ree ca s in t e next our?
Solution: p(3) = e22/3! = (0.135)(8)/6 = 0.18
Question: determine the probability of two or more calls in
one hour eriod. P 2 or more = ?
06.11.2013 Rechnergesttzte Netzanalysen 24
8/14/2019 Vorlesung02 Statistical Models in Simulation
25/42
Normal
BinomialBernoulli
Poisson
06.11.2013 Rechnergesttzte Netzanalysen 25
8/14/2019 Vorlesung02 Statistical Models in Simulation
26/42
06.11.2013 Rechnergesttzte Netzanalysen 26
8/14/2019 Vorlesung02 Statistical Models in Simulation
27/42
the interval (a,b),U(a,b), if its pdf and cdf are:
0,
f(x)= ba
, axb
otherwise
0,x F x =
x a
ax b
The uniform distribution plays a vital role
a1,b a
xb
in simulation. Random numbers, uniformly
distributed between 0 and 1, provide the
means to generate random events.
E(X) = (a+b)/2
V(X) = (ba)2/12
06.11.2013 Rechnergesttzte Netzanalysen 27
8/14/2019 Vorlesung02 Statistical Models in Simulation
28/42
terminal MArea beginning at 6:50 P.M. until
7:50 P.M. A certain passenger does not know
(uniformly distributed) between 7:00 P.M.
and 7:30 P.M. every Wednesday evening.
than 5 minutes for a bus?
X is uniform random variable on (0,30).
The desired probability is given by
F(15)F(5) + F(30)F(20) = 15/305/30 + 120/30 = 2/3
06.11.2013 Rechnergesttzte Netzanalysen 302
8
8/14/2019 Vorlesung02 Statistical Models in Simulation
29/42
exponential
x x
CDF F(x) = f(y)dy = e
y
dy=1 ex
E[X]=1 ;
Var(X)= 1 ..
2
0 0
Applications of Exponential Distribution:Used to model time between independent
, .
model service times that are highly variable.
Inappropriate for modeling process delay
Exponential
Memoryless property: P{X > s + t|X > t}= P{X > s} t,s 0.
.
06.11.2013 Rechnergesttzte Netzanalysen 29
8/14/2019 Vorlesung02 Statistical Models in Simulation
30/42
Example of the use of the memoryless property
of Exponential Distribution
A queueing system has two servers. The
service times are assumed to be exponentiallydistributed (with the same parameter). Upon
occupied () but there are no other waiting.
06.11.2013 Rechnergesttzte Netzanalysen 30
8/14/2019 Vorlesung02 Statistical Models in Simulation
31/42
e e o a g u s g ven y , w c s sa o ave an exponen a
distribution with mean 2 years. Its pdf is shown below:
Question: whats the probability that the life of the light bulb is between 2 and 3
years? Solution:
Question:What is the probability that it lasts for another year if it has already.
06.11.2013 Rechnergesttzte Netzanalysen 31
8/14/2019 Vorlesung02 Statistical Models in Simulation
32/42
Agner Krarup Erlang
The Erlang distribution is the distribution of the sum of k independent identically
distributed random variables each having an exponential distribution. Events
which occur independently with some average rate are modeled with a Poisson
process. The waiting times between k occurrences of the event are Erlang
distributed.
PDF:
the shapek, which is a nonnegative integer, and the rate, which is anon
negative real number.
06.11.2013 Rechnergesttzte Netzanalysen 32
8/14/2019 Vorlesung02 Statistical Models in Simulation
33/42
we ng mac ne as wo we ng ea s. e we ng ea s w sw c e
current to the second welding head if the first fails. The life expectancy of the
welding heads is exponentially distributed with average life 1000 hours. Question: W at is t e pro a i ity t at t e mac ine sti wor s a ter 90 days.
The probability that the system will still operate at least x hours is called the
reliability function R(x), where
R(x) = 1 F(x)
Solution: the total system lifetime is given k = 2 welding head, and = 1/1000.
F 2160 = 0.636
therefore, the chances are about 36% that the machine still works after 90 days.
06.11.2013 Rechnergesttzte Netzanalysen 33
8/14/2019 Vorlesung02 Statistical Models in Simulation
34/42
normal
E[X]=, Var(X)=2.Johann Carl Friedrich Gauss
Normal
anon ca : mean = , = . f( -x)=f(+x); the pdf is symmetric about . The maximum value of the pdfoccurs at x = .
.
Shape determined by its standard deviation .06.11.2013 Rechnergesttzte Netzanalysen 34
8/14/2019 Vorlesung02 Statistical Models in Simulation
35/42
rans orma on o var a es: e = ,
06.11.2013 Rechnergesttzte Netzanalysen 35
8/14/2019 Vorlesung02 Statistical Models in Simulation
36/42
e t me requ re to oa an oceango ng vesse , , s str ute as
N(12,4).
Question: What is the robabilit that the vessel is loaded in less than 10hours?
Solution:
06.11.2013 Rechnergesttzte Netzanalysen 36
8/14/2019 Vorlesung02 Statistical Models in Simulation
37/42
The random variable X withprobability density function
xex x = x
1 Waloddi Weibull
18 June 188712 October 1979
for x > 0
s a e u ran om var a e w
scale parameter > 0 and shapeparameter > 0.By inspecting the probabilitydensity function, it is seen thatw en = , e e udistribution is identical to theexponential distribution.
The effect of the Weibull shape parameter on thepdf.
06.11.2013 39 Rechnergesttzte Netzanalysen3
7
Rechnergesttzte Netzanalysen
8/14/2019 Vorlesung02 Statistical Models in Simulation
38/42
Weibul distribution is often used to modelthetime until failureof many different physicalsystems.
Distribution parameters provide a great deal offlexibility to model systems in which the numberof failures:
Increases wit time e.g., earing wear .
Decreases with time (some semiconductors). Remains constant (failures caused by external
s oc s to t e system .
with < 1exhibit a failure rate that decreases withtime,with = 1have a constant failure rate(consistent with the exponential distribution) andpopulations with > 1have a failure rate that
The effect of on the Weibull failure rate function..
06.11.2013 49 Rechnergesttzte Netzanalysen3
8
Rechnergesttzte Netzanalysen
8/14/2019 Vorlesung02 Statistical Models in Simulation
39/42
06.11.2013 41 Rechnergesttzte Netzanalysen3
9
Rechnergesttzte Netzanalysen
8/14/2019 Vorlesung02 Statistical Models in Simulation
40/42
T e time to ai ure or a e ectronic evice is nown ave a
Weibull distribution with= 1/3, and = 200 hours (time.
What is the probability that it fails before 2000 hours?
Solution:
= = = F(2000) = 1 exp[(2000/200) ] = 0.884
06.11.2013 Rechnergesttzte Netzanalysen 40
8/14/2019 Vorlesung02 Statistical Models in Simulation
41/42
A distribution whose parameters are the
observed values in a sample of data.May be used when it is impossible or unnecessary
particular parametric distribution
values in the sample.
sa van age: samp e m g no cover e en rerange of possible values.
06.11.2013 Rechnergesttzte Netzanalysen 41
8/14/2019 Vorlesung02 Statistical Models in Simulation
42/42
The world that the simulation analyst sees is
probabilistic, not deterministic. Reviewed several important probability
probability distributions in a simulation
context.
Difference between discrete continuous andempirical distributions.
06.11.2013 Rechnergesttzte Netzanalysen 42