Simulatio Modelig ad Performace Aalysis with Discrete-Evet Simulatio
Chapter 5 Statistical Models i Simulatio
Cotets Basic Probability Theory Cocepts Useful Statistical Models Discrete Distributios Cotiuous Distributios Poisso Process Empirical Distributios Chapter 5. Statistical Models i Simulatio 3
Purpose & Overview The world the model-builder sees is probabilistic rather tha determiistic. Some statistical model might well describe the variatios. A appropriate model ca be developed by samplig the pheomeo of iterest: Select a kow distributio through educated guesses Make estimate of the parameters Test for goodess of fit I this chapter: Review several importat probability distributios Preset some typical applicatio of these models Chapter 5. Statistical Models i Simulatio 4
Basic Probability Theory Cocepts Chapter 5. Statistical Models i Simulatio 5
Review of Termiology ad Cocepts I this sectio, we will review the followig cocepts: Discrete radom variables Cotiuous radom variables Cumulative distributio fuctio Epectatio Chapter 5. Statistical Models i Simulatio 6
Discrete Radom Variables X is a discrete radom variable if the umber of possible values of X is fiite, or coutable ifiite. Eample: Cosider obs arrivig at a ob shop. - Let X be the umber of obs arrivig each week at a ob shop. R X possible values of X rage space of X {0,1,, } p i probability the radom variable X is i, p i PX i p i, i 1,, must satisfy: 1. p i 0, for alli. i 1 p i 1 The collectio of pairs i, p i, i 1 1,,, is called the probability distributio of X, ad p i is called the probability mass fuctio pmf of X. Chapter 5. Statistical Models i Simulatio 7
Cotiuous Radom Variables X is a cotiuous radom variable ab if its rage space R X is sa iterval or a collectio of itervals. The probability that X lies i the iterval [a, b] is give by: P a X b f d f is called the probability desity fuctio pdf of X, ad satisfies: 1.. f 0, R Properties X f d 1 3. f 0, 1. P X for all i if R is ot i X R 0 0 0, because f d X 0 b a 0. P a X b P a < X b P a X < b P a < X < b Chapter 5. Statistical Models i Simulatio 8
Cotiuous Radom Variables Eample: Life of a ispectio device is give by X, a cotiuous radom variable with pdf: f 1 e 0, /, 0 otherwise Lifetime i Year X has epoetial distributio with mea years Probability that the device s life is betwee ad 3 years is: 1 3 / P 3 e d 0.14 Chapter 5. Statistical Models i Simulatio 9
Cumulative Distributio Fuctio Cumulative Distributio Fuctio cdf is deoted by F, where F PX If X is discrete, the F p i i If X is cotiuous, the F f t dt Properties 1. F is odecreasig fuctio. If a b, the F a. 3. lim F 1 lim F 0 F b All probability questio about X ca be aswered i terms of the cdf: P a X b F b F a, for all a b Chapter 5. Statistical Models i Simulatio 10
Cumulative Distributio Fuctio Eample: The ispectio device has cdf: 1 F e 0 t / dt 1 e / The probability that the device lasts for less tha years: P 0 X F F 0 F 1 e 1 0. 63 The probability that it lasts betwee ad 3 years: 3/ 1 P X 3 F 3 F 1 e 1 e 0. 145 Chapter 5. Statistical Models i Simulatio 11
Epectatio The epected value of X is deoted by EX If X is discrete E X If X is cotiuous all i p i i E X f d a.k.a the mea, m, µ, or the 1 st momet of X A measure of the cetral tedecy The variace of X is deoted by VX or varx or σ Defiitio: VXEX E[X] Also, VX EX EX A measure of the spread or variatio of the possible values of X aroud the mea The stadard deviatio of X is deoted by σ Defiitio: σ V The stadard d deviatio is epressed i the same uits as the mea Chapter 5. Statistical Models i Simulatio 1
Epectatios Eample: The mea of life of the previous ispectio device is: E X / / e d e 0 0 1 + 0 e / d To compute the variace of X, we first compute EX : E X 1 / / + e d e 0 0 0 e / d 8 Hece, the variace ad stadard deviatio of the device s life are: V X 8 4 σ V X X Chapter 5. Statistical Models i Simulatio 13
Epectatios Epectatios / 1 / / d d X E e + Itegratio Partial 0 / 0 0 / d e d e X E e + Set ' ' d v u v u d v u ' Set / e v u 1 ' u e v 1 1 / / / / e v Chapter 5. Statistical Models i Simulatio 14 1 1 1 / 0 0 / 0 / d e e d e X E
Useful Statistical Models Chapter 5. Statistical Models i Simulatio 15
Useful Statistical Models I this sectio, statistical models appropriate to some applicatio areas are preseted. The areas iclude: Queueig systems Ivetory ad supply-chai systems Reliability ad maitaiability Limited data Chapter 5. Statistical Models i Simulatio 16
Useful models Queueig Systems I a queueig system, iterarrival ad service-time patters ca be probabilistic. Sample statistical models for iterarrival or service time distributio: Epoetial distributio: ib ti if service times are completely l radom Normal distributio: fairly costat but with some radom variability either positive or egative Trucated ormal distributio: similar to ormal distributio but with restricted values. Gamma ad Weibull distributios: more geeral tha epoetial ivolvig locatio of the modes of pdf s ad the shapes of tails. Callig populatio Waitig lie Server Chapter 5. Statistical Models i Simulatio 17
Useful models Ivetory ad supply chai I realistic ivetory ad supplychai systems, there are at least three radom variables: The umber of uits demaded per order or per time period The time betwee demads The lead time Time betwee placig a order ad the receipt of that order Sample statistical models for lead time distributio: Gamma Sample statistical models for demad distributio: Poisso: simple ad etesively tabulated. Negative biomial distributio: loger tail tha Poisso more large demads. Geometric: special case of egative biomial give at least oe demad has occurred. Chapter 5. Statistical Models i Simulatio 18
Useful models Reliability ad maitaiability Time to failure TTF Epoetial: failures are radom Gamma: for stadby redudacy where each compoet has a epoetial TTF Weibull: failure is due to the most serious of a large umber of defects i a system of compoets Normal: failures are due to wear Chapter 5. Statistical Models i Simulatio 19
Useful models Other areas For cases with limited data, some useful distributios are: Uiform Triagular Beta Other distributio: Beroulli Biomial Hyperepoetial Chapter 5. Statistical Models i Simulatio 0
Discrete Distributios Chapter 5. Statistical Models i Simulatio 1
Discrete Distributios Discrete radom variables are used to describe radom pheomea i which oly iteger values ca occur. I this sectio, we will lear about: Beroulli trials ad Beroulli distributio Biomial distributio Geometric ad egative biomial i distributio ib ti Poisso distributio Chapter 5. Statistical Models i Simulatio
Beroulli Trials ad Beroulli Distributio Beroulli Trials: Cosider a eperimet cosistig of trials, each ca be a success or a failure. - X 1 if the -th eperimet is a success - X 0 if the -th eperimet is a failure failure success The Beroulli distributio oe trial: p, 1 p p, 1,,..., q : 1 p, 0 where EX p ad VX p1-p p pq Chapter 5. Statistical Models i Simulatio 3
Beroulli Trials ad Beroulli Distributio Beroulli process: Beroulli trials where trials are idepedet: p 1,,, p 1 1 p p Chapter 5. Statistical Models i Simulatio 4
Biomial Distributio The umber of successes i Beroulli trials, X, has a biomial distributio. p 0, p q, 0,1,,..., otherwise The umber of outcomes havig the required umber of successes ad failures Probability that there are successes ad - failures The mea, E p + p + + p *p The variace, VX pq + pq + + pq *pq Chapter 5. Statistical Models i Simulatio 5
Geometric Distributio Geometric distributio The umber of Beroulli trials, X, to achieve the 1 st success: p 1 q p, 0,1,,..., 0, otherwise E 1/p, ad VX q/p Chapter 5. Statistical Models i Simulatio 6
Negative Biomial Distributio Negative biomial distributio The umber of Beroulli trials, X, util the k-th success If Y is a egative biomial distributio with parameters p ad k, the: y 1 y q p k 1 0, y 1 yk k 1 p q p k 1 144 44 3 k-1 successes k p { p k k th success EY k/p, ad VX kq/p, y k, k + 1, k otherwise +,... Chapter 5. Statistical Models i Simulatio 7
Poisso Distributio Poisso distributio describes may radom processes quite well ad is mathematically quite simple. where α > 0, pdf ad cdf are: α p e! 0, EXα VX α, 0,1,... otherwise F i α α e i 0 i! Chapter 5. Statistical Models i Simulatio 8
Poisso Distributio Eample: A computer repair perso is beeped each time there is a call for service. The umber of beeps per hour ~ Poissoα per hour. The probability of three beeps i the et hour: p3 3 /3! e - 0.18 also, p3 F3 F 0.857-0.6770.18 0 The probability of two or more beeps i a 1-hour period: p or more 1 p0 + p1 1 F1 0.594 Chapter 5. Statistical Models i Simulatio 9
Cotiuous Distributios Chapter 5. Statistical Models i Simulatio 30
Cotiuous Distributios Cotiuous radom variables ca be used to describe radom pheomea i which the variable ca take o ay value i some iterval. I this sectio, the distributios studied are: Uiform Epoetial Weibull Normal Logormal Chapter 5. Statistical Models i Simulatio 31
Uiform Distributio A radom variable X is uiformly distributed o the iterval a, b, Ua, b, if its pdf ad cdf are: 0, < a 1, a b a f b a F, a < 0, otherwise b a 1, b Properties P 1 < X < is proportioal to the legth of the iterval [F F 1-1 /b-a] EX a+b/ VX b-a /1 b U0,1 provides the meas to geerate radom umbers, from which radom variates a ca be geerated. Chapter 5. Statistical Models i Simulatio 3
Epoetial Distributio A radom variable X is epoetially distributed with parameter λ >0 if its pdf ad cdf are: f λe λ, 0 0, < 0 F 0, elsewhere λt e dt 1 e λ λ, 0 0 EX 1/λ VX 1/λ Chapter 5. Statistical Models i Simulatio 33
Epoetial Distributio Used to model iterarrival times whe arrivals are completely radom, ad to model service times that are highly variable For several differet epoetial pdf s see figure, the value of itercept o the vertical ais is λ, ad dall pdf s evetually itersect. Chapter 5. Statistical Models i Simulatio 34
Epoetial Distributio Memoryless property For all s ad t greater or equal to 0: PX > s+t X > s PX > t Eample: A lamp ~ epλ 1/3 per hour, hece, o average, 1 failure per 3 hours. - The probability that the lamp lasts loger tha its mea life is: PX > 3 1 1 e -3/3 e -1 0.368 - The probability bilit that t the lamp lasts betwee to 3 hours is: P < X < 3 F3 F 0.145 - The probability that it lasts for aother hour give it is operatig for.5 hours: PX > 3.5 X >.5 PX > 1 e -1/3 0.717 Chapter 5. Statistical Models i Simulatio 35
Epoetial Distributio Epoetial Distributio Memoryless property y p p y t s X P s X t s X P + > > + > e s X P s X t s X P t s > > + > + λ e e t s λ λ t X P e > Chapter 5. Statistical Models i Simulatio 36
Weibull Distributio A radom variable abe X has a Weibull distributio if its pdf has the form: 3 parameters: β ν f α α 0, Locatio parameter: υ, Scale parameter: β, β > 0 Shape parameter. α, > 0 β 1 ν ep α < ν < β, ν otherwise Eample: υ 0 ad α 1: Chapter 5. Statistical Models i Simulatio 37
Weibull Distributio Weibull Distributio β ν f α α 0, For β 1, υ0 β 1 ep ν α β, ν otherwise f 1 ep α 0, 1 α, ν otherwise Whe β 1, X ~ epλ 1/α / Chapter 5. Statistical Models i Simulatio 38
Normal Distributio A radom variable X is ormally distributed if it has the pdf: 1 1 μ f ep, < < σ π σ Mea: < μ < Variace: σ > 0 Deoted as X ~ Nμ,σ Special properties: lim f 0, ad lim f 0 fμ-fμ+; the pdf is symmetric about μ. The maimum value of the pdf occurs at μ; the mea ad mode are equal. Chapter 5. Statistical Models i Simulatio 39
Normal Distributio Evaluatig the distributio: Use umerical methods o closed form Idepedet of μ ad σ, usig the stadard ormal distributio: Z ~ N0,1 Trasformatio of variables: let Z X - μ / σ, F P X μ / σ μ / σ P Z 1 z e π φ z dz / μ σ dz Φ μ σ, where Φ z z 1 e π t / dt Chapter 5. Statistical Models i Simulatio 40
Normal Distributio Eample: The time required to load a oceagoig vessel, X, is distributed as N1,4, µ1, σ The probability that the vessel is loaded i less tha 10 hours: 10 1 F 10 Φ Φ 1 0.1587 - Usig the symmetry property, Φ1 is the complemet of Φ -1 Chapter 5. Statistical Models i Simulatio 41
Logormal Distributio A radom variable X has a logormal distributio if its pdf has the form: l μ 1 ep, > 0 f πσ σ 0, otherwise Mea EX e μ+σ μ / Variace VX e μ+σ / e σ -1 μ1, 1 σ 0.5,1,. Relatioship with ormal distributio Whe Y ~ Nμ, σ, the Xe Y ~ logormalμ, σ Parameters μ ad σ are ot the mea ad variace of the logormal radom variable X Chapter 5. Statistical Models i Simulatio 4
Poisso Process Chapter 5. Statistical Models i Simulatio 43
Poisso Process Defiitio: Nt is a coutig fuctio that represets the umber of evets occurred i [0,t]. A coutig process {Nt, t>0} is a Poisso process with mea rate λ if: Arrivals occur oe at a time {Nt, t>0} has statioary icremets - Number of arrivals i [t, t+s] depeds oly o s, ot o startig poit t - Arrivals are completely radom {Nt, t>0} has idepedet icremets - Number of arrivals durig ooverlappig time itervals are idepedet - Future arrivals occur completely radom Chapter 5. Statistical Models i Simulatio 44
Poisso Process Properties P λt! λt N t e, for t 0 ad 0,1,,... Equal mea ad variace: E[Nt] V[Nt] λ t Statioary ti icremet: - The umber of arrivals i time s to t, with s<t, is also Poissodistributed with mea λt-s Chapter 5. Statistical Models i Simulatio 45
Poisso Process Iterarrival Times Cosider the iterarrival times of a Possio process A 1 1,, A,,, where A i is the elapsed time betwee arrival i ad arrival i+1 The 1 st arrival occurs after time t iff there are o arrivals i the iterval [0, t], hece: PA 1 > t PNt 0 e -λt PA 1 < t 1 e -λt [cdf of epλ] Iterarrival times, A 1, A,, are epoetially distributed ad idepedet with mea 1/λ Arrival couts ~ Poissoλ Statioary & Idepedet Iterarrival time ~ Ep1/λ Memoryless Chapter 5. Statistical Models i Simulatio 46
Poisso Process Splittig ad Poolig Splittig: Suppose each evet of a Poisso process ca be classified as Type I, with probability p ad Type II, with probability 1-p. NtN1t + Nt, where N1t ad Nt are both Poisso processes with rates λp ad λ1-p Nt ~ Poissoλ λ λp N1t ~ Poisso[λp] λ1-p Nt ~ Poisso[λ1-p] Chapter 5. Statistical Models i Simulatio 47
Poisso Process Splittig ad Poolig Poisso Process Splittig ad Poolig Poolig: N P N P N N P 1 1 + Poolig: Suppose two Poisso processes are pooled together N1t + Nt Nt where Nt t t e t e t!! 0 1 0 1 λ λ λ λ N1t + Nt Nt, where Nt is a Poisso processes with rates λ 1 + λ t t t t e e!!!! 0 1 0 1 λ λ λ λ t t e!! 0 1 0 1 λ λ λ λ + N1t ~ Poisso[λ 1 ] Nt ~ Poisso[λ ] t t e!!!! 0 1 1 λ λ λ λ + λ λ λ 1 λ t t e! 0 1 1 λ λ λ λ + Nt ~ Poissoλ 1 + λ λ 1 + λ Chapter 5. Statistical Models i Simulatio 48 t t e! 1 1 λ λ λ λ + +
Empirical Distributios Chapter 5. Statistical Models i Simulatio 49
Empirical Distributios A distributio whose parameters are the observed values i a sample of data. May be used whe it is impossible or uecessary to establish that a radom variable has ay particular parametric distributio. Advatage: o assumptio beyod the observed values i the sample. Disadvatage: sample might ot cover the etire rage of possible values. Chapter 5. Statistical Models i Simulatio 50
Empirical Distributios - Eample Customers arrive i groups from 1 to 8 persos Observatio of the last 300 groups has bee reported Summary i the table below Group Frequecy Relative Cumulative Relative Size Frequecy Frequecy 1 30 0.10 0.10 110 037 0.37 047 0.47 3 45 0.15 0.6 4 71 0.4 0.86 5 1 004 0.04 090 0.90 6 13 0.04 0.94 7 7 0.0 0.96 8 1 0.04 1.00 Chapter 5. Statistical Models i Simulatio 51
Empirical Distributios - Eample Chapter 5. Statistical Models i Simulatio 5
Summary The world that the simulatio aalyst sees is probabilistic, ot determiistic. I this chapter: Reviewed several importat probability distributios. Showed applicatios of the probability distributios i a simulatio cotet. Importat task i simulatio modelig is the collectio ad aalysis of iput data, e.g., hypothesize a distributioal form for the iput data. Studet should kow: Differece betwee discrete, cotiuous, ad empirical i distributios. ib ti Poisso process ad its properties. Chapter 5. Statistical Models i Simulatio 53
Poisso Process Nostatioary Poisso Process Computer Sciece, Iformatik 4 Poisso Process without the statioary a icremets, e characterized acte ed by λt, the arrival rate at time t. The epected umber of arrivals by time t, Λt: Λt t λsds Relatig statioary Poisso process t with rate λ1 ad NSPP Nt with rate λt: Let arrival times of a statioary process with rate λ 1 be t 1, t,, ad arrival times of a NSPP with rate λt be T 1, T,, we kow: t 0 t i ΛT i T i Λ 1 t i Chapter 5. Statistical Models i Simulatio 54
Poisso Distributio Nostatioary Poisso Process Eample: Suppose arrivals to a Post Office have rates per miute from 8 am util 1 pm, ad the 0.5 per miute util 4 pm. Let t 0 correspod to 8 am, NSPP Nt has rate fuctio:, 0 t < 4 λ t 0.5, 4 t < 8 Epected umber of arrivals by time t: t, 0 t < 4 Λ t 4 t t + + < ds 0.5ds 6, 4 t 8 0 4 Hece, the probability distributio of the umber of arrivals betwee 11 am ad pm. P[N6 N3 k] P[NΛ6 NΛ3 k] P[N9 N6 k] e 9-6 9-6 k /k! e 3 3 k /k! Chapter 5. Statistical Models i Simulatio 55