310 likes | 421 Views
SIMULATION MODELING AND ANALYSIS WITH ARENA T. Altiok and B. Melamed Chapter 7 Input Analysis. Input Analysis Activities. Input Analysis activities consist of the following stages: Stage 1: data collection Stage 2: data analysis Stage 3: modeling time series data
E N D
SIMULATION MODELING AND ANALYSIS WITH ARENA T. Altiok and B. Melamed Chapter 7 Input Analysis Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Input Analysis Activities • Input Analysis activities consist of the following stages: • Stage 1: data collection • Stage 2: data analysis • Stage 3: modeling time series data • Stage 4: goodness-of-fit testing • Random variables with negligible variability are simplified • and modeled as deterministic quantities. • Unknown distributions are postulated to have a particular • functional form that incorporates any available partial • information. Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Data Collection • To illustrate data collection activities, consider modeling a painting station, where • jobs arrive at random, wait in the buffer until the sprayer is available • having been sprayed, they leave the station • suppose that the spray nozzle can get clogged – an event that results in a stoppage during which the nozzle is cleaned or replaced. • suppose further that the measure of interest is the expected job delay in the buffer. • The data collection activity in this simple case would consist of the following tasks: • collection of job inter-arrival times • collection of painting times • collection of times between nozzle clogging • collection of nozzle cleaning/replacement times Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Data Analysis • Data Analysis deals with statistics of empirical data: • statistics related to moments (mean, standard deviation, coefficient of variation, etc.) • statistics related to distributions (histograms) • statistics related to temporal dependence (autocorrelations within an empirical time series, or cross-correlations among two or more distinct time series) • For example, consider the sample of 100 repair time observations • 12.9 27.7 13.5 13.7 22.2 • 20.9 26.6 29.1 22.4 10.7 • 30.0 27.4 18.8 25.3 15.0 • 17.0 21.7 13.7 15.5 23.2 • 11.0 27.5 22.5 27.1 25.2 • 10.3 18.0 11.5 14.1 24.0 • 10.9 27.0 24.2 25.6 22.4 • 21.0 21.3 23.1 15.8 13.2 • 22.8 25.9 22.4 13.8 16.6 • 10.8 10.3 15.1 19.0 27.9 • 20.5 19.4 10.9 24.1 10.9 • 22.2 25.5 17.2 10.9 15.6 • 14.3 29.9 17.8 19.8 17.6 • 13.3 24.0 29.7 18.1 28.4 • 28.6 26.9 20.7 22.0 16.8 • 19.4 27.4 22.5 28.3 27.1 • 18.9 11.9 13.2 10.9 22.1 • 16.7 28.5 19.9 18.5 16.5 • 12.7 18.1 15.0 21.0 25.7 • 19.5 11.9 22.9 23.2 18.9 Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Data Analysis Example • Data Analysis of the repair time data produced the histogram and summarystatistics shown below Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Modeling Time Series Data • Independent observations are modeled as a renewal time series, namely, a sequence of iid random variables. In this case, the analyst’s task is to merely identify (fit) a “good” distribution and its parameters to the empirical data. • Arena provides built-in facilities for fitting distributions to empirical data. • Dependent observations are modeled as random processes with temporal • dependence. In this case, the analyst’s task is to identify (fit) a “good” probability law to empirical data. This is a far more difficult task • than the previous one, and often requires advanced mathematics. • Arena does not provide facilities for fitting dependent random processes • An advanced method is described, however, in Chapter 10 • Examples: • Observed sequences of arrival times to a queue are often modeled as iid exponential inter-arrival times (i.e., Poisson processes) • For observed sequence of times to failure and the corresponding repair times, the associated uptimes may be modeled as a Poisson process, and the downtimes as a renewal process or as a dependent process (e.g., Markov process) Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Modeling Empirical Distributions • The simplest approach is to construct a histogram from the empirical data • (sample), and then normalize it to a step pdf or a pmf, depending on the underlying state space. The obtained pdf or pmf is then declared to be the fitted distribution. The main advantage of this approach is that no assumptions are required on the functional form (shape) of the fitted distribution. • The previous approach may reveal (by inspection) that the histogram pdf has a particular functional form (e.g., decreasing, bell shape, etc.). The analyst may then try to obtain a better fit, by postulating a particular class of distributions having that shape, and then proceeding to estimate (fit) its parameters from the sample, using such common techniques as the method ofmoments and the maximum likelihood estimation (MLE) method. This approach can be further generalized to multiple functional forms by searching for the best fit among a number of postulated classes of distributions. • The Arena Input Analyzer provides facilities for both fitting approaches. Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Method of Moments • The method of moments fits the moments of a candidate model to sample • moments, using appropriate empirical statistics as constraints on the • candidate model parameters. • As an example, consider a random variable X and a data sample whose first • two moments, and are estimated as and . • Write the formulas for the mean and variance of a gamma distribution, connecting the first two moments of a gamma distribution with its parameters, and , namely • Substitute into the above the previous estimates • Solve the above equation to obtain Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Maximal-likelihood Estimation (MLE) • The Maximal-likelihood Estimation (MLE) method postulates a particular class of distributions (e.g., normal, uniform, exponential, etc.), and then estimates their parameters from the sample, such that the resulting parameters give rise to the maximal likelihood (highest probability or density) of obtaining the sample. More precisely, • Let be the postulated pdf, as a function of its ordinary argument, , as well as the unknown parameter (possibly be a vector of parameters, but here is assume a scalar for simplicity) • Let be a sample of independent observations • The MLE method estimates via the likelihood function Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
MLE Method Examples • For the exponential distribution Expo( ) with parameter , • the corresponding maximal likelihood function is • the log-likelihood function is • the value of that maximizes is obtained by differentiating it with respect to and setting the derivative to zero, that is • solving the above in yields the maximal likelihood estimate • For the uniform distribution Unif(a,b), a similar computation yields the MLE estimates Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
The Arena Input Analyzer • The Arena Input Analyzer is a tool that fits a distribution to sample data. Arena-supported distributions and their parameters Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Best-fit uniform distribution for the repair time data Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Best-fit beta distribution for the repair time data Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Best-fit gamma distribution for a sample of lead time data Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Fit All Summary for a sample of lead time data Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Goodness-of-Fit Tests for Distributions • Tests of goodness-of-fit for distributions determine the likelihood that an empirical sample is drawn from a given distribution • a statistical hypothesis is formulated • a statistic is computed from the empirical data • the distribution of the statistic is assumed known under the null hypothesis, allowing the computation of the probability that it exceedsthe observed value • rejection or acceptance decisions can be taken at a given significance level, but these are subject to Type I and Type II statistical errors • Common goodness-of-fit tests for distributions: • Chi-Square test • Kolmogorov-Smirnov test Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Chi-Square Test • The Chi-Square test compares the empirical histogram density, constructed from sample data, to a candidate theoretical density • assume that the empirical sample is a set of iid realizations from an underlying (unknown) random variable, . • this sample is used to construct an empirical histogram with cells, where cell corresponds to the interval • The estimator of the probability of cell is • is the number of observations in cell • it is commonly suggested to take for statistical reliability) Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Chi-Square Test (Cont.) • Let be some theoretical candidate distribution of the random variable whose goodness-of-fit is to be assessed • Compute the corresponding theoretical probabilities • for continuous data we have • where is the density of • The Chi-square test statistic is then given by Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Chi-Square Test Example • As an example, consider the repair time sample data of size N = 100, given earlier, for which a histogram with J = 10 cells was constructed by the Input Analyzer • The table below displays the elements of the Chi-Square test for the repair data Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Chi-Square Test Example (Cont.) • The histogram of the repair data suggests that a uniform distribution Unif(a,b) is an acceptably good fit to the sample repair data • The parameters of the uniform distribution are estimated as: • The Chi-Square statistic computation yields • A Chi-Square table shows that for significance level and degrees of freedom, the critical value is • Since the test statistic computed above is , we accept the null hypothesis that the uniform distribution Unif(10,30)is an acceptably good fit to the sample repair data Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Kolmogorov-Smirnov Test • The Kolmogorov-Smirnov (K-S) test compares the empirical cdf to a theoretical counterpart • while, the Chi-Square test requires a considerable amount of data (at least to set up a reasonably “smooth” histogram), the K-S test can get away with smaller samples, since it does not require a histogram • The K-S test procedure proceeds as follows: • sort the sample is ascending order as • constructs the empirical cdf • construct the K-S test statistic • The smaller is the observed value of KS, the better is the fit Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Multi-Modal Distributions • A mode of a distribution is that value of its associated pdf or pmf at which the respective function attains a maximal value • A uni-modal distribution has exactly one mode • A multi-modal distribution is one whose associated pdf or pmf is of the following form: • It has more than one mode • It has only one mode, but it is either not monotone increasing to the left of its mode, or not monotone decreasing to the right of its mode Thus, a multi-modal distribution has a pdf or pmf with multiple “humps” • One approach to Input Analysis of multi-modal samples is: • Separate the sample into mutually exclusive uni-modal sub-samples • Fit a separate distribution to each sub-sample • The fitted models are then combined into a final model according to the relative frequency of each sub-sample Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7
Multi-Modal Distribution Example • Consider a sample of observations such that • observations appear to form a uni-modal distribution in an interval • observations appear to form a uni-modal distribution in an interval • Suppose that the theoretical distributions, and , are fitted separately to the respective sub-samples • The combined distribution to be fitted the entire sample is defined by • The distribution above is a legitimate distribution, formed as a probabilistic mixture of the two distributions, and Altiok / Melamed Simulation Modeling and Analysis with Arena Chapter 7