Presentation is loading. Please wait.

Presentation is loading. Please wait.

Input Modeling for Simulation Chapter 3 “As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they.

Similar presentations


Presentation on theme: "Input Modeling for Simulation Chapter 3 “As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they."— Presentation transcript:

1 Input Modeling for Simulation Chapter 3 “As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they do not refer to reality.” − Albert Einstein Last revision July 14, 2013 For more information on this book and materials, visit the official website, http://www.vms-technology.com/book/

2 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 1. Introduction (1/1) If actual data collected are available, there are three ways of input modeling: 1.Trace-driven simulation: the collected data values are directly used 2.Empirical input modeling: random variables for simulation are generated directly from the collected data; 3.Theoretical input modeling: the parameters of a theoretical distribution function are estimated from the actual data and random variables are generated from the fitted distribution function. Table of Contents 1. Introduction 2. Empirical Input Modeling 3. Overview of Theoretical Distribution Fitting 4. Theoretical Modeling of Arrival Processes 5. Theoretical Modeling of Service Times 6. Input Modeling for Special Applications No.2

3 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 2. Empirical Input Modeling (0/3) Table of Contents 2-1. Non-parametric Modeling 2-2. Empirical Modeling of Individual Data 2-3. Empirical Modeling of Grouped Data No.3

4 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 2. Empirical Input Modeling (1/3) 2-1. Non-parametric Modeling The value of the random variable x is repeatedly sampled from collected data {X k : k= 1~n} with probability 1/n. (1) Generate a uniform random number U ~ U(0,1); (2) Set P = n*U and k = [P] + 1; // [P] is the integer part of P. (3) Return x = X k ; Example 3.1: Generate a service time using the non-parametric method from the service time data {X k } given in Table 3.1. Let the value of the generated uniform random number U ~ Uni (0, 1) be 0.369881, then the index ‘ k ’ in the non-parametric modeling method is computed as k = |10 * 0.369881| + 1 = 3 + 1 = 4. Thus, is ‘sampled’ as an empirical service-time to be used in a simulation. No.4

5 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 2. Empirical Input Modeling (2/3) 2-2. Empirical Modeling of Individual Data Sort the individual data in an increasing order {X (k) : k=1~n}, and the random variable x is sampled from a piecewise linear function with F(X (k) )= (k–1)/ (n–1).. (1) Generate a uniform random number U ~ U(0,1); (2) Set P = (n – 1)*U and J = [P] + 1; // [P] is the integer part of P. (3) Return x = X (J) + (P – J + 1)*(X (J+1) – X (J) ); Example 3.2: Table 3.2 shows the ordered service-time data {X (k) } that were obtained by rearranging the collected data in Table 3.1 in an ascending order. If the value of U is 0.369881 as before, we have P = 9 * 0.369881 = 3.328929 and J = |P| + 1 = 4. Then, an empirical service time is generated as: No.5

6 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 2. Empirical Input Modeling (3/3) (1) Generate U ~ U(0,1). (2) Find integer J such that G(a J )≤U < G(a J+1 ). (3) Return x = a J + (U – G(a J ))*(a J+1 – a J ) / (G(a J+1 ) – G(a J )) No.6

7 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 3. Overview of Theoretical Distribution Fitting (1/1) 3-1. Data Independence Checking A simple method of assessing data independence is a scatter diagram plotting. For the data X 1, X 2 … X n listed in time-order of collection, pairs (X i, X i+1 ) for i=1 ~ n–1 are plotted on an x, y-coordinate system (X i as x-value and X i+1 as y-value). If the plotted points are randomly scattered, one may conclude that the data are independent. 3-2. Distribution Function Selection For example, Erlang distribution is commonly selected for inter-arrival times, while Weibull distribution is the choice for an inter-failure time distribution. Service time distributions that are widely used are Beta distribution and lognormal distribution. 3-3. Parameter Estimation MLE is used for exponential, normal, and lognormal distributions; the method of moment for Erlang and Beta distributions; the rank regression method for Weibull distribution. No.7

8 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 4. Theoretical Modeling of Arrival Processes (0/3) Table of Contents 4-1. Generation of Inter-arrival Times for Constant Arrival Rate (λ) 4-2. Generation of Inter-arrival Times for Varying Arrival Rates λ(t) 4-3. Generation of Inter-arrival Times from Historical Data {xi} No.8

9 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 4. Theoretical Modeling of Arrival Processes (1/3) (1) Generate independent u ~ U(0,1). (2) Return x = –(θ)*ln(u) 4-1. Generation of Inter-arrival Times for Constant Arrival Rate (λ) When the arrival process is stationary with a constant arrival rate λ, the inter-arrival time X follows Exp(θ) with mean θ=1/λ. - X ~ Exp(θ)  F(x) = 1 – e –x/θ. Exponential variate x with mean θ is generated by the inverse-transform method. - U = F(x) = 1 – e –x/θ  e –x/θ = (1– U)  x = –θ*ln(1– U) ≡ –θ*ln(U) No.9

10 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 4. Theoretical Modeling of Arrival Processes (2/3) (1) Set: t = t i–1 ; // the previous arrive-time (2) Generate: U 1 ~ U(0.1) and U 2 ~ U(0.1); (3) D = –(1/λ * ) ln(U 1 ); //exponential random variable with θ= 1/λ * (4) t = t + D (5) If U 2 ≤ λ(t)/λ *, then return t i = t, else go back to Step (2) 4-2. Generation of Inter-arrival Times for Varying Arrival Rates λ(t) A widely used method, called thinning, for generating non-stationary inter-arrival times is as shown below. No.10

11 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 4. Theoretical Modeling of Arrival Processes (3/3) 4-3. Generation of Inter-arrival Times from Historical Data {xi} 1)Erlang(k,θ): mean = k*θ; variance = k*θ 2 2)Compute sample moments m 1 and m 2 : 3)Estimate parameters of Erlang(k,θ): 4)Generate Erlang(k,θ) variate via convolution of Exponential variates (k=integer). (1) Generate independent u i ~ U(0.1) for i=1~k. (2) Return x= No.11

12 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 5. Theoretical Modeling of Service Times (0/3) Table of Contents 5-1. Uniform random variate 5-2. Triangular random variate 5-3. House distribution random variate 5-4. Beta distribution random variate No.12

13 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 5. Theoretical Modeling of Service Times (1/3) 1) Uniform random variate: X~ Uniform (a, b) When only the range data [a, b] is given, a simple but useful method is to generate the service time X from the uniform distribution U(a, b). Namely, let U~ U(0,1) then the uniform random variate X~ U(a, b) is generated by: X = a + (b– a)*U 2) Triangular random variate: X~ Triangular (a, b, c) If the mode c is also given in addition to the range data [a, b], service times may be sampled from a triangular distribution. Service-time random variate X following the triangular distribution Triangular (a, b, c) may be generated by using a composition method given below: No.13

14 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 5. Theoretical Modeling of Service Times (2/3) 3) House distribution random variate: X~ House (a, b, c, h) When the height (h) the house is also specified (in addition to a, b, and c), service time may be sampled from the house distribution. A composition method is employed to generate house- distribution random variates X. a 2/(c–a) cb a cb a cb 2/(b–c) 1/(b–a) Y = a + (c – a) * (U) 1/2 Y = c + (b – c) * [1 – (1 – U 2 ) 1/2 ] Y = a + (b – a) * U 2 No.14

15 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 5. Theoretical Modeling of Service Times (3/3) As the direct methods (i.e., inverse-transform and convolution methods) are not applicable to Beta distribution, the acceptance-rejection method is used in generating a Beta random variate. 4) Beta distribution random variate: Beta(α, β) The beta distribution is defined by the shape parameter α and scale parameter β and is widely used in modeling service times, especially, in the field of project management mainly due to its flexibility. No.15

16 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 6. Inter-failure Time Modeling with Weibull Distribution (0/2) Table of Contents 6-1. Generation of Weibull Random Variate 6-2. Estimation of Weibull Distribution Parameters No.16

17 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 6. Inter-failure Time Modeling with Weibull Distribution (1/2) Weibull(α,β) random variate X is obtained from a uniform random variate U as follows: X = β*(– ln U) 1/α 1) Generation of Weibull Random Variate: Weibull(α, β) Inter-failure time is modeled by the Weibull distribution mainly due to its flexibility. If the failure rate decreases over time, then use α 1. U = F(t) =  (Inverse transform)  x = F –1 (U) = β*(– ln (1– U)) 1/α = β*(– ln U) 1/α No.17

18 Modeling and Simulation of Discrete-Event SystemsChapter 3- Input Modeling for Simulation 6. Inter-failure Time Modeling with Weibull Distribution (2/2) 2) Estimation of Weibull Distribution Parameters: Weibull(α, β) Weibull parameters α, β can be estimated from the collected inter-failure time data {X i } by using a rank regression method. In order to estimate the parameters, 1) the collected data {X i } are rearranged in an increasing order to obtain a set of ordered sample data {X (i) : i = 1 ~ n} and the median rank R i of the i-th sample data X (i) is computed using the following equation: R i = (i – 0.3) / (N + 0.4). Then, the sequence of ordered rank data pairs {X (i), R i } are fitted to the Weibull distribution as follows X (1) X (2) X (3) X (4) X (5) 1.00 x 0 R1R1 R2R2 R3R3 R4R4 R5R5 F(x)= No.18


Download ppt "Input Modeling for Simulation Chapter 3 “As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they."

Similar presentations


Ads by Google