CPSC 531:Input Modeling Instructor: Anirban Mahanti Office: ICT 745

Slides:



Advertisements
Similar presentations
Hypothesis Testing Steps in Hypothesis Testing:
Advertisements

Outline input analysis input analyzer of ARENA parameter estimation
Chapter 5 Statistical Models in Simulation
Selecting Input Probability Distribution. Introduction need to specify probability distributions of random inputs –processing times at a specific machine.
CPSC 531:Random-Variate Generation
Chapter 8 Random-Variate Generation
Chapter 8 Random-Variate Generation Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
DISTRIBUTION FITTING.
Simulation Modeling and Analysis
Agenda Purpose Prerequisite Inverse-transform technique
Analysis of Simulation Input.. Simulation Machine n Simulation can be considered as an Engine with input and output as follows: Simulation Engine Input.
Inferences About Process Quality
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 4 Continuous Random Variables and Probability Distributions.
Lecture 6 Data Collection and Parameter Estimation.
Nonparametrics and goodness of fit Petter Mostad
Exponential Distribution & Poisson Process
1 Exponential Distribution & Poisson Process Memorylessness & other exponential distribution properties; Poisson process and compound P.P.’s.
Chapter 5 Sampling and Statistics Math 6203 Fall 2009 Instructor: Ayona Chatterjee.
CS433: Modeling and Simulation
Al-Imam Mohammad Ibn Saud University
Chapter 5 Modeling & Analyzing Inputs
Chapter 5 Statistical Models in Simulation Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
Standard Statistical Distributions Most elementary statistical books provide a survey of commonly used statistical distributions. The reason we study these.
Graduate Program in Engineering and Technology Management
Input Analysis 1.  Initial steps of the simulation study have been completed.  Through a verbal description and/or flow chart of the system operation.
CPSC 531: Probability Review1 CPSC 531:Distributions Instructor: Anirban Mahanti Office: ICT Class Location: TRB 101.
0 Simulation Modeling and Analysis: Input Analysis K. Salah 8 Generating Random Variates Ref: Law & Kelton, Chapter 8.
Chapter 3 Basic Concepts in Statistics and Probability
Continuous Probability Distributions  Continuous Random Variable  A random variable whose space (set of possible values) is an entire interval of numbers.
Modeling and Simulation CS 313
Modeling and Simulation Input Modeling and Goodness-of-fit tests
Chapter 9 Input Modeling
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
2 Input models provide the driving force for a simulation model. The quality of the output is no better than the quality of inputs. We will discuss the.
1 Statistical Distribution Fitting Dr. Jason Merrick.
CPSC 531: Probability Review1 CPSC 531:Probability & Statistics: Review II Instructor: Anirban Mahanti Office: ICT 745
CPSC 531: RN Generation1 CPSC 531:Random-Number Generation Instructor: Anirban Mahanti Office: ICT Class Location:
Chapter 7 Random-Number Generation
Tests for Random Numbers Dr. Akram Ibrahim Aly Lecture (9)
CS433: Modeling and Simulation Dr. Anis Koubâa Al-Imam Mohammad bin Saud University 15 October 2010 Lecture 05: Statistical Analysis Tools.
Maximum Likelihood Estimator of Proportion Let {s 1,s 2,…,s n } be a set of independent outcomes from a Bernoulli experiment with unknown probability.
The Examination of Residuals. Examination of Residuals The fitting of models to data is done using an iterative approach. The first step is to fit a simple.
Ch9. Inferences Concerning Proportions. Outline Estimation of Proportions Hypothesis concerning one Proportion Hypothesis concerning several proportions.
1 SMU EMIS 7364 NTU TO-570-N Inferences About Process Quality Updated: 2/3/04 Statistical Quality Control Dr. Jerrell T. Stracener, SAE Fellow.
Ch5. Probability Densities II Dr. Deshi Ye
MEGN 537 – Probabilistic Biomechanics Ch.5 – Determining Distributions and Parameters from Observed Data Anthony J Petrella, PhD.
Chapter 9 Input Modeling Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
ETM 607 – Input Modeling General Idea of Input Modeling Data Collection Identifying Distributions Parameter estimation Goodness of Fit tests Selecting.
Selecting Input Probability Distribution. Simulation Machine Simulation can be considered as an Engine with input and output as follows: Simulation Engine.
Chapter 10 Verification and Validation of Simulation Models
Lecture 3: Statistics Review I Date: 9/3/02  Distributions  Likelihood  Hypothesis tests.
Learning Simio Chapter 10 Analyzing Input Data
Chapter 8 Random-Variate Generation Banks, Carson, Nelson & Nicol Discrete-Event System Simulation.
Sampling and estimation Petter Mostad
Chapter 9 Input Modeling
2 Input models provide the driving force for a simulation model. The quality of the output is no better than the quality of inputs. In this chapter, we.
MEGN 537 – Probabilistic Biomechanics Ch.5 – Determining Distributions and Parameters from Observed Data Anthony J Petrella, PhD.
Selecting Input Probability Distributions. 2 Introduction Part of modeling—what input probability distributions to use as input to simulation for: –Interarrival.
CHI SQUARE DISTRIBUTION. The Chi-Square (  2 ) Distribution The chi-square distribution is the probability distribution of the sum of several independent,
Modeling and Simulation CS 313
Exponential Distribution & Poisson Process
Modeling and Simulation CS 313
Chapter 9 Input Modeling
Subject Name: SYSTEM MODELING AND SIMULATION [UNIT-7 :INPUT MODELING]
Chapter 10 Verification and Validation of Simulation Models
Chapter 5 Statistical Models in Simulation
CPSC 531: System Modeling and Simulation
Chapter 7 Random Number Generation
Discrete Event Simulation - 4
Chapter 8 Random-Variate Generation
Presentation transcript:

CPSC 531:Input Modeling Instructor: Anirban Mahanti Office: ICT 745 Email: mahanti@cpsc.ucalgary.ca Class Location: TRB 101 Lectures: TR 15:30 – 16:45 hours Class web page: http://pages.cpsc.ucalgary.ca/~mahanti/teaching/F05/CPSC531 Notes from “Discrete-event System Simulation” by Banks, Carson, Nelson, and Nicol, Prentice Hall, 2005, and “Simulation Modeling and Analysis” by Law and Kelton, McGraw Hill, 2000. CPSC 531:Input Modeling

Outline Quality of output depends on the input models driving the simulation This module discusses the following: Data collection from the real system Hypothesize probability distributions Choose parameters for the distributions Goodness of fit test – how well does the fitted distribution model available data Selecting distributions in absence of data Models of arrival process (Poisson Process, Non-stationary Poisson Process, Batch Arrivals) CPSC 531:Input Modeling

Data Collection Plan ahead: begin by a practice or pre-observing session, watch for unusual circumstances Analyze the data as it is being collected: check adequacy Combine homogeneous data sets, e.g. successive time periods, during the same time period on successive days Be aware of data censoring: the quantity is not observed in its entirety, danger of leaving out long process times Check for relationship between variables, e.g. build scatter diagram Check for autocorrelation Collect input data, not performance data CPSC 531:Input Modeling

Identifying Probability Distributions Several possible techniques (may use a combination of these) Prior knowledge of the random variable’s role Inter-arrival times are exponential if arrivals occur one at a time, have constant mean rate, and are independent Service times are not normally distributed because service time can not be negative Product of many independent pieces may imply Lognormal Use the physical basis of the distribution as guide Summary statistics Histograms CPSC 531:Input Modeling

Distribution Guide Use the physical basis of the distribution as a guide, for example: Binomial: # of successes in n trials Poisson: # of independent events that occur in a fixed amount of time or space Normal: dist’n of a process that is the sum of a number of component processes Exponential: time between independent events, or a process time that is memoryless Weibull: time to failure for components Discrete or continuous uniform: models complete uncertainty Triangular: a process for which only the minimum, most likely, and maximum values are known Empirical: resamples from the actual data collected CPSC 531:Input Modeling

Summary Statistics CPSC 531:Input Modeling

Histograms A frequency distribution or histogram is useful in determining the shape of a distribution The number of class intervals depends on: The number of observations The dispersion of the data Suggested: the square root of the sample size For continuous data: Corresponds to the probability density function of a theoretical distribution For discrete data: Corresponds to the probability mass function If few data points are available: combine adjacent cells to eliminate the ragged appearance of the histogram CPSC 531:Input Modeling

Histogram for Continuous Data Sample n = 100 interarrival times of requests to a Web server during a 1-minute period (see Web page) Request arrival approximately stationary – # of requests arriving in 10-second periods approx. equal Sample mean = 0.534 s; median = 0.398; CV = 0.98 exponential distribution? Right-hand side shows two histograms: top with interval or bin size of 0.1 s; bottom with bin size of 0.25 s. CPSC 531:Input Modeling

Histogram for Discrete Data Sample n = 100 observations of the number of items requested from a job shop per week over a long time period (# req., # observations): {(0,1), (1,3), (2,8), (3,14), (4, 18), (5,17), (6,16), (7,10), (8,8), (9,4), (10, 1)} Mean = 4.94, variance = 4.4, Lexis ratio = 0.9 Poisson distribution? CPSC 531:Input Modeling

Parameter Estimation Next step after selecting a family of distributions If observations in a sample of size n are X1, X2, …, Xn (discrete or continuous), the sample mean and variance are: If the data are discrete and have been grouped in a frequency distribution: where fj is the observed frequency of value Xj CPSC 531:Input Modeling

Parameter Estimation When raw data are unavailable (data are grouped into class intervals), the approximate sample mean and variance are: where fj is the observed frequency of in the jth class interval mj is the midpoint of the jth interval, and c is the number of class intervals A parameter is an unknown constant, but an estimator is a statistic. CPSC 531:Input Modeling

How Representative are the fits? Continuous data – plot over the histogram and look for similarities Discrete data – compare the observed frequency with the expected frequency Try a Quantile-Quantile Plot Fitted Dist Observed CPSC 531:Input Modeling

Quantile-Quantile Plots Q-Q plot is a useful tool for evaluating distribution fit If X is a random variable with cdf F, then the q-quantile of X is the g such that When F has an inverse, g = F-1(q) Let {xi, i = 1,2, …., n} be a sample of data from X and {yj, j = 1,2, …, n} be the observations in ascending order: where j is the ranking or order number CPSC 531:Input Modeling

Quantile-Quantile Plots The plot of yj versus F-1( (j-0.5)/n) is Approximately a straight line if F is a member of an appropriate family of distributions The line has slope 1 if F is a member of an appropriate family of distributions with appropriate parameter values CPSC 531:Input Modeling

Quantile-Quantile Plots Example: Check whether the door installation times follows a normal distribution [BCNN05] The observations are now ordered from smallest to largest: yj are plotted versus F-1( (j-0.5)/n) where F has a normal distribution with the sample mean (99.99 sec) and sample variance (0.28322 sec2) CPSC 531:Input Modeling

Quantile-Quantile Plots [BCNN05] Example (continued): Check whether the door installation times follow a normal distribution. Straight line, supporting the hypothesis of a normal distribution Superimposed density function of the normal distribution CPSC 531:Input Modeling

Quantile-Quantile Plots [BCNN05] Consider the following while evaluating the linearity of a q-q plot: The observed values never fall exactly on a straight line The ordered values are ranked and hence not independent, unlikely for the points to be scattered about the line Variance of the extremes is higher than the middle. Linearity of the points in the middle of the plot is more important. Q-Q plot can also be used to check homogeneity Check whether a single distribution can represent both sample sets Plotting the order values of the two data samples against each other CPSC 531:Input Modeling

Goodness-of-Fit Tests [BCNN05] Conduct hypothesis testing on input data distribution using: Kolmogorov-Smirnov (KS) test Chi-square test No single correct distribution in a real application exists. If very little data are available, it is unlikely to reject any candidate distributions If a lot of data are available, it is likely to reject all candidate distributions CPSC 531:Input Modeling

Chi-Square Test [BCNN05] Compare histogram of the data to the shape of the candidate distribution function Valid for large sample sizes when parameters are estimated by maximum likelihood Arrange the n observations into a set of k class intervals or cells, the test statistics is: which approximately follows the chi-square distribution with k-s-1 degrees of freedom, where s = # of parameters of the hypothesized distribution estimated by the sample statistics. Expected Frequency Ei = n*pi where pi is the theoretical prob. of the ith interval. Suggested Minimum = 5 Observed Frequency CPSC 531:Input Modeling

Chi-Square Test Null hypothesis – observations come from a specified distribution cannot be rejected at a significance of α if: Comments: Errors in cells with small Ei’s affect the test statistics more than cells with large Ei’s. Minimum size of Ei debated: [BCNN05] recommends a value of 3 or more; if not combine adjacent cells. Test designed for discrete distributions and large sample sizes only. For continuous distributions, Chi-Square test is only an approximation (i.e., level of significance holds only for n->∞). Obtained from a table CPSC 531:Input Modeling

Chi-Square Test Example 1: 500 random numbers generated using a random number generator; observations categorized into cells at intervals of 0.1, between 0 and 1. At level of significance of 0.1, are these numbers IID U(0,1)? CPSC 531:Input Modeling

Chi-Square test [BCNN05] Example 2: Vehicle Arrival H0: the random variable is Poisson distributed. H1: the random variable is not Poisson distributed. Degree of freedom is k-s-1 = 7-1-1 = 5, hence, the hypothesis is rejected at the 0.05 level of significance. Combined because of min Ei CPSC 531:Input Modeling

Chi-Square Test If the distribution tested is continuous: where ai-1 and ai are the endpoints of the ith class interval and f(x) is the assumed pdf, F(x) is the assumed cdf. Recommended number of class intervals (k): Caution: Different grouping of data (i.e., k) can affect the hypothesis testing result. CPSC 531:Input Modeling

Kolmogorov-Smirnov (KS) Test Difference between observed CDF F0(x) and expected CDF Fe(x) should be small; formalizes the idea behind the Q-Q plot. Step 1: Rank observations from smallest to largest: Y1 ≤ Y2 ≤ Y3 ≤ … ≤ Yn Step 2: Define Fe(x) = (#i: Yi ≤ x)/n Step 3: Compute K as follows: CPSC 531:Input Modeling

KS Test Example: Test if given population is exponential with parameter β = 0.01; that is Fe(x) = 1 – e–βx; K[0.9,15] = 1.0298. CPSC 531:Input Modeling

KS Test KS test suitable for small samples, continuous as well as discrete distributions KS test, unlike the Chi-Square test, uses each observation in the given sample without grouping data into cells (intervals). KS test is exact provided all parameters of the expected distribution are known. CPSC 531:Input Modeling

Selecting Model without Data If data is not available, some possible sources to obtain information about the process are: Engineering data: often product or process has performance ratings provided by the manufacturer or company rules specify time or production standards. Expert option: people who are experienced with the process or similar processes, often, they can provide optimistic, pessimistic and most-likely times, and they may know the variability as well. Physical or conventional limitations: physical limits on performance, limits or bounds that narrow the range of the input process. The nature of the process. The uniform, triangular, and beta distributions are often used as input models. [ see LK00 for details] CPSC 531:Input Modeling

Models of Arrival Processes Poisson Process Non-stationary Poisson Batch Arrivals CPSC 531:Input Modeling

Poisson Process Definition: Let N(t) denote the number of arrivals that occur in time interval [0,t]. The stochastic process {N(t), t>=0} is a Poisson process with mean rate l if: N(0) = 0 Arrivals occur one at a time {N(t), t>=0} has stationary increments – number of arrivals in a given interval depends only on the length of the interval, not its location {N(t), t>=0} has independent increments – number of arrivals in disjoint time intervals are independent. And … CPSC 531:Input Modeling

Poisson Process: Interarrival Times Consider the interarrival times of a Possion process (A1, A2, …), where Ai is the elapsed time between arrival i and arrival i+1 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-lt P{A1 <= t} = 1 – e-lt [cdf of exp(l)] Interarrival times, A1, A2, …, are exponentially distributed and independent with mean 1/l Arrival counts ~ Poisson(l) Interarrival time ~ Exp(1/l) Stationary & Independent Memoryless CPSC 531:Input Modeling

Poisson Process: Splitting and Pooling Suppose each event of a Poisson process can be classified as Type I, with probability p and Type II, with probability 1-p. N(t) = N1(t) + N2(t), where N1(t) and N2(t) are both Poisson processes with rates l p and l (1-p) Pooling: Suppose two Poisson processes are pooled together N1(t) + N2(t) = N(t), where N(t) is a Poisson processes with rates l1 + l2 lp N1(t) ~ Poisson[lp] l N(t) ~ Poisson(l) N2(t) ~ Poisson[l(1-p)] l(1-p) N1(t) ~ Poisson[l1] l1 l1 + l2 N(t) ~ Poisson(l1 + l2) N2(t) ~ Poisson[l2] l2 CPSC 531:Input Modeling

Non-stationary Poisson Process (NSPP) Poisson Process without the stationary increments, characterized by l(t), the arrival rate at time t. The expected number of arrivals by time t, L(t): Relating stationary Poisson process n(t) with rate l=1 and NSPP N(t) with rate l(t): Let arrival times of a stationary process with rate l = 1 be t1, t2, …, and arrival times of a NSPP with rate l(t) be T1, T2, …, we know: ti = L(Ti) Ti = L-1(ti) CPSC 531:Input Modeling

Non-stationary Poisson Process (NSPP) Example: Suppose arrivals to a Post Office have rates 2 per minute from 8 am until 12 pm, and then 0.5 per minute until 4 pm. Let t = 0 correspond to 8 am, NSPP N(t) has rate function: Expected number of arrivals by time t: Hence, the probability distribution of the number of arrivals between 11 am and 2 pm. P[N(6) – N(3) = k] = P[N(L(6)) – N(L(3)) = k] = P[N(9) – N(6) = k] = e(9-6)(9-6)k/k! = e3(3)k/k! CPSC 531:Input Modeling

Batch Process Let N(t) be the number of batches that have arrived by time t. If interarrival times of batches are IID exponential random variables, {N(t), t≥0} can be modeled as a Poisson process. Let X(t) = total number of individual customers to arrive by time t; let Bi = number of customers in the ith batch; then If Bi’s are IID random variables independent of {N(t) t≥0}, and if {N(t), t≥0} is a Poisson process, then the stochastic process {X(t), t≥0} is a Compound Poisson process CPSC 531:Input Modeling