Skip to content

11 Estimation of Absolute Performance

Output analysis is the examination of data generated by a simulation. Its purpose is either to predic the performance ofa system or to compare the performance oftwo or more alternative system designs. This chapter deals with estimating absolute performance, by which we mean estimating the value of one or more system performance measures as opposed to the comparison of two or more systems, in other words relative performance.

The need for statistical output analysis is based on the observation that the output data from a simulation exhibits random variability when random-number generators are used to produce the values of the input variables—that is, two different streams or sequences of random numbers wil produce two sets ofoutputs, which (probably) will differ. Ifthe performance ofthe system is measured by a parameter θ,\theta , the result ofa set ofsimulation experiments will be an estimator θ ofθ. The precision of the estimator θ^\widehat {\theta} can be measured by the standard error of θ^\widehat {\theta}-or by the width of a confidence interva - -for θ. The purpose of the statistical analysis is either to estimate this standard error or confidence interval or to figure out the number of observations required to achieve a standard error or confidence interval of a given size—or both.

Consider a typical output variable Y, the total cost per week of an inventory system; Y should be treated as a random variable with an unknown distribution. A simulation run of length 1 week provides a single sample observation from the population of all possible observations on Y. By increasing the run length, the sample size can be increased to n observations,Y1,Y2,…,Yn.Y_{1} , Y_{2} , \ldots , Y_{n} ., based on a run length of n weeks. However, these observations do not constitute a random sample, in the classic sense, because they are not statistically independent. In this case, the inventory on hand a the end of one week is the beginning inventory on hand for the next week, and so the value of YiY_{i} has some influence on the value of Yi+1Y_{i + 1}. Thus, the sequence of random variables Y1,Y2,…,YnY_{1} , Y_{2} , \dots , Y_{n} could be autocorrelated (i.e., correlated with itself). This autocorrelation, which is a measure of a lack of statistical independence, means that classic methods of statistics, which assume independence, are not directly applicable to the analysis of these output data. The methods must be properly modified and the simulation experiments properly designed for valid inferences to be made.

In addition to the autocorrelation present in most simulation output data, the specification o the initial conditions of the system at time 0 can pose a problem for the simulation analyst and could influence the output data. By “time 0∘0^{\circ} we mean whatever point in time the beginning of the simulation run represents. For example, the inventory on hand and the number of backorders at time 0 (Monday morning) would most likely influence the value of Y1Y_{1}, the total cost for week 1. Because of the autocorrelation, these initial conditions would also influence the costs Y2,…,YnY_{2} , \dots , Y_{n} for subsequent weeks. The specified initial conditions, if not chosen well, can have an effect on estimation of the steady-state (long-run) performance of a simulation model. For purposes of statistical analysis, the effect of the initial conditions is that the output observations might not be identically distributed and that the initial observations might not be representative of the steady-state behavior of the system.

Section 1 distinguishes between two types of simulation—transient versus steady state—and defines commonly used measures of system performance for each type of simulation. Section 2 illustrates by example the inherent variability in a stochastic (i.e., probabilistic) discrete-event simulation and thereby demonstrates the need for a statistical analysis of the output. Section 3 covers the statistical estimation of performance measures. Section 4 discusses the analysis of terminating simulations, and Section 5 the analysis of steady-state simulations. To support the calculations in this chapter a spreadsheet called SimulationTools.xls is provided at www.bcnn.net. SimulationTools.xls is a menu-driven application that allows the user to paste in their own data—generated by any simulation application—and perform statistical analyses on it. A detailed user guide is also available on the book web site, and SimulationTools.xls has integrated help.

1 Types of Simulations with Respect to Output Analysis

In analyzing simulation output data, a distinction is made between terminating or transient simulations and steady-state simulations.

A terminating simulation is one that runs for some duration of time TET_{E}, where E is a specified event (or set of events) that stops the simulation. Such a simulated system opens at time 0 under well-specified initial conditions and closes at the stopping time TET_{E}. The next four examples are terminating simulations.

Example 1

The Shady Grove Bank opens at 8:30 A.M. (time 0) with no customers present and 8 of the 11 tellers working (initial conditions) and closes at 4:30 P.M. (time TE=480T_{E} = 480 minutes). Here, the event E is merely the fact that the bank has been open for 480 minutes. The simulation analyst is interested in modeling the interaction between customers and tellers over the entire day, including the effect of starting up and closing down at the end of the day.

Example 2

Consider the Shady Grove Bank of Example 1, but restricted to the period from 11:30 A.M. (time 0) to 1:30 P.M., when it is especially busy. The simulation run length is TE=120T_{E} = 120 minutes. The initial conditions at time 0 (11:30 A.M.) could be specified in essentially two ways: (a) the real system could be observed at 11:30 on a number of different days and a distribution of number of customers in system (at 11:30 A.M.) could be estimated, then these data could be used to load the simulation model with customers at time 0; or (b) the model could be simulated from 8:30 A.M. to 11:30 A.M. without collecting output statistics, and the ending conditions at 11:30 A.M. used as initial conditions for the 11:30 A.M. to 1:30 P.M. simulation.

Example 3

A communications system consists of several components plus several backup components. It is represented schematically in Figure 1. Consider the system over a period of time TE,T_{E} ,, until the system fails. The stopping event E is defined by E={AE = \{A fails, or D fails, or (B and C both fail) . Initia conditions are that all components are new at time 0.

Figure 1 Example of a communications system.

Notice that, in the bank model of Example 1, the stopping time TE=480T_{E} = 480 minutes is known, but in Example 3, the stopping time TET_{E} is generally unpredictable in advance; in fact,TET_{E} is probably the output variable of interest, as it represents the total time until the system breaks down. One goal o the simulation might be to estimate E(TE)E ( T_{E} ), the mean time to system failure.

Example 4

A manufacturing process runs continuously from Monday mornings until Saturday mornings. The first shift of each work week is used to load inventory buffers and chemical tanks with the components

and catalysts needed to make the final product. These components and catalysts are made continually throughout the week, except for the last shift Friday night, which is used for cleanup and maintenance. Thus, most inventory buffers are near empty at the end of the week. During the first shift on Monday, a buffer stock is built up to cover the eventuality of breakdown in some part of the process. It is desired to simulate this system during the first shift (time 0 to time TE=8T_{E} = 8 hours) to study various scheduling policies for loading inventory buffers.

In the simulating of a terminating system, the initial conditions of the system at time 0 must be specified, and the stopping time TE−orT_{E} - \mathrm {{o r}}, alternatively, the stopping event E—must be well defined. Although it is certainly true that the Shady Grove Bank in Example 1 will open again the next day, the simulation analyst has chosen to consider it a terminating system because the object of interest is one day’s operation, including start up and close down. On the other hand, if the simulation analys were interested in some other aspect of the bank’s operations, such as the flow of money or operation of automated teller machines, then the system might be considered as a nonterminating one. Similar comments apply to the communications system of Example 3. If the failed component were replaced and the system continued to operate, and, most important, if the simulation analyst were interested in studying its long-run behavior, it might be considered as a nonterminating system. In Example 3, however, interest is in its short-run behavior, from time 0 until the first system failure at time TET_{E} Therefore whether a simulation is considered to be terminating depends on both the obiectives of the simulation study and the nature of the system.

Example 4 is a terminating system, too. It is also an example of a transient (or nonstationary) simulation: the variables of interest are the in-process inventory levels, which are increasing from zero or near zero (at time 0) to full or near full (at time 8 hours).

A nonterminating system is a system that runs continuously, or at least over a very long period of time. Examples include assembly lines that shut down infrequently, continuous production systems of many different types, telephone and other communications systems such as the Internet, hospita emergency rooms, police dispatching and patrolling operations, fire departments, and continuously operating computer networks.

A simulation of a nonterminating system starts at simulation time 0 under initial conditions defined by the analyst and runs for some analyst-specified period of time TET_{E}. (Significant problems arise concerning the specification of these initial and stopping conditions, problems that we discuss later.) Usually, the analyst wants to study steady-state, or long-run, properties of the system—tha is, properties that are not influenced by the initial conditions of the model at time 0. A steadystate simulation is a simulation whose objective is to study long-run, or steady-state, behavior of a nonterminating system.

The next two examples are steady-state simulations.

Example 5

Consider the manufacturing process ofExample 4, beginning with the second shift, when the complete production process is under way. It is desired to estimate long-run production levels and production efficiencies. For the relatively long period of 13 shifts, this may be considered as a steady-state simulation. To obtain sufficiently precise estimates of production efficiency and other response variables, the analyst could decide to simulate for any length of time,TET_{E}(even longer than 13 shifts). That is,TET_{E} is not determined by the nature of the problem (as it was in terminating simulations); rather, it is set by the analyst as one parameter in the design of the simulation experiment.

Example 6

HAL Inc., a large web-based order-processing company, has many customers worldwide. Thus, its large computer system with many servers, workstations, and peripherals runs continuously, 24 hours per day. To handle an increased work load, HAL is considering additional CPUs, memory, and storage devices in various configurations. Although the load on HAL’s computers varies throughou the day, management wants the system to be able to accommodate sustained periods of peak load. Furthermore, the time frame in which HAL’s business will change in any substantial way is unknown, so there is no fixed planning horizon. Thus, a steady-state simulation at peak-load conditions is appropriate. HAL systems staff develops a simulation model of the existing system with the current peak work load and then explores several possibilities for expanding capacity. HAL is interested in long-run average throughput and utilization of each computer. The stopping time TET_{E} is determined not by the nature of the problem, but rather by the simulation analyst, either arbitrarily or with a certain statistical precision in mind.

2 Stochastic Nature of Output Data

Consider one run of a simulation model over a period of time [0,TE]T_{E} ]. Since the model is an inputoutput transformation, and since some of the model input variables are random variables, it follows that the model output variables are random variables. Two examples are now given to illustrate the nature of the output data from stochastic simulations and to give a preliminary discussion of severa important properties of these data. Do not be concerned if some of these properties and the associated terminology are not entirely clear on a first reading. They will be explained carefully later in the chapter.

Example 7: Software Made Personal

Software Made Personal (SMP) customizes software products for clients in two areas: financia tracking and contact management. They have a customer support call center that handles questions for owners of their software from 8 A.M. to 4 P.M. Eastern Time. When a customer calls they use an automated system to select among the two product lines. Each product line has its own operators, and if an appropriate operator is available then the call is immediately routed to the operator; otherwise, the caller is placed in a hold queue. SMP is hoping to reduce the total number of operators they need by cross-training them so that they can answer calls for any product line. This is expected to increase the time to process a call by about 10%. Before considering reducing operators, however, SMP wants to know what their quality of service would be if they simply cross-train the operators they currently have. Using historical data, incoming calls have been modeled as a nonstationary Poisson arriva process and distributions have been fit for operator time to answer questions. Their quality of service measures are caller response time (time from initiating a call until speaking to an operator) and the number of callers on hold. Response-time differences of more than 30 seconds matter.

This is clearly a terminating simulation experiment with time 0 corresponding to 8 A.M. and TET_{E} corresponding to 4 P.M. (another way to terminate the simulation is when the last call that arrives before 4 P.M. is terminated, in which case TET_{E} is a random value). Table 1 shows the results from 4 replications of the SMP simulation; each row presents the average number of minutes callers spen on hold, and the average number of callers on hold, during the course of a simulated 8-hour day.

Table 1 Results of Four Independent Replications of the SMP Call Center

Replication,rAverage Waiting Time,w^Qr\widehat{w}_{Qr}(minutes)Average on Hold,L^Qr\widehat{L}_{Qr}(people)
10.880.68
25.044.18
34.133.26
40.520.34

The table illustrates that there is significant variation in these averages from day to day, implying that a substantial number of replications may be required to precisely estimate, say, the mean values wQ=E(w^Q)w_{Q} = E ( \widehat {w} _ {Q} ) and LQ=E(L^Q)L _ {\mathcal {Q}} = E ( \widehat {L} _ {\mathcal {Q}} ). Even with a large number of replications there will still be some - -estimation error, which is why we want to report not just a single value (the point estimate), but also a measure of its error in the form of a confidence interval or standard error.

These questions are addressed in Section 4 for terminating simulations such as Example 7. Classic methods of statistics may be used because w^Q1,w^Q2,w^Q3\widehat {w} _ {Q 1} , \widehat {w} _ {Q 2} , \widehat {w} _ {Q 3}, and w^Q4\widehat {w} _ {Q 4} constitute a random sample—that is, they are independent and identically distributed. In addition,wQ=E(w^Qr)w_{Q} = E ( \widehat {w} _ {Q r} ) is the parameter being estimated, so each w^Qr\widehat {w} _ {Q r} is an unbiased estimate of the true mean waiting time wQw_{Q} The analysis of Example 7 is considered in Example 10 of Section 4. A survey of statistical methods applicable to terminating simulations is given by Law [1980]. Additional guidance may be found in Alexopoulos and Seila [1998], Kleijnen [1987], Law [2007], and Nelson [2001].

The next example illustrates the effects of correlation and initial conditions on the estimation o long-run mean measures of performance of a system.

Example 8

Semiconductor wafer fabrication is an amazingly expensive process involving hundreds of millions of dollars in processing equipment, material handling, and human resources. FastChip, Inc. wants to use simulation to design a new “fab” by evaluating the steady-state mean cycle time (time from wafer release to completion) that they can expect under a particular loading of two distinct products, called C-chip and D-chip. The process of wafer fabrication consists of two basic steps, diffusion and lithography, each of which contains many substeps, and the fabrication process requires multiple passes through these steps. Product will be released in cassettes at the rate of 1 cassette/hour, 7 days a week, 24-hours a day, to achieve a desired throughput of 1 cassette/hour. The hope is that the curren design will achieve long-run average cycle times of less than 45 hours for the C-chip and 30 hours for the D-chip.

Figure 2 shows the first 30 Chip-C cycle times from one run of the simulation model of the fab. The goal is to estimate the long-run average cycle time as, conceptually, the number of cassettes produced goes to infinity. Notice that the first few cycle times seem lower than the ones that follow; this occurs because the simulation was started with the fab “empty and idle,” which is not representative of long-run or steady-state conditions. Also notice that when there is a low cycle time (say, around 40 hours), it tends to be followed by several additional low cycle times. Thus, the cycle time of successive cassettes may be correlated. These features suggest that the cycle-time data are not a random sample, so classic statistical methods may not apply. The analysis of Example 8 is considered in Section 5.

Figure 2 First 30 Chip-C cycle times from one simulation run.

3 Absolute Measures of Performance and Their Estimation

Consider the estimation of a performance parameter θ (or φ) of a simulated system. It is desired to have a point estimate and an interval estimate of θ (or φ). The length of the interval estimate is a measure of the error in the point estimate. The simulation output data are of the form {Y1,Y2,…,Yn}\{Y_{1} , Y_{2} , \ldots , Y_{n} \} for estimating θ;\theta ; we refer to such output data as discrete-time data, because the index n is discrete valued. The simulation output data are of the form {Y(t),0≤t≤TE}\{Y ( t ) , 0 \leq t \leq T_{E} \} for estimating φ; we refer to such output data as continuous-time data, because the index t is continuous valued. For example,YiY_{i} might be the delay of customer i, or the total cost in week i;Y(t)i ; Y ( t ) might be the queue length at time t, or the number of backlogged orders at time t. The parameter θ\theta is an ordinary mean;ϕ\phi will be referred to as a time-weighted mean. Whether we call the performance parameter θ\theta or ϕ\phi does not really matter; we use two different symbols here simply to provide a distinction between ordinary means and time-weighted means. To make the discussions more concrete, we consider output measures of queueing systems.

3.1 Point Estimation

The point estimator of θ, based on the data {Y1,…,Yn}\{Y_{1} , \ldots , Y_{n} \}, is defined by

θ^=1n∑i=1nYi(1) \widehat {\theta} = \frac {1}{n} \sum_{i = 1} ^ {n} Y_{i}\tag{1}

where θ^\widehat {\theta} is a sample mean based on a sample of size n. Computer simulation languages may refer to -this as a “discrete-time,” “collect,” “tally,” or “observational” statistic.

The point estimator θ is said to be unbiased for θ if its expected value is θ;\theta ; that is,{\mathrm{i s}} , if

E(θ^)=θ(2) E (\widehat {\theta}) = \theta\tag{2}

In general, however,

E(θ^)≠θ(3) E (\widehat {\theta}) \neq \theta\tag{3}

and E(θ^)−θE ( \widehat {\theta} ) - \theta is called the bias in the point estimator θ^.{\widehat {\theta}} . It is desirable to have estimators that are -unbiased,or,^ {\mathrm{o r ,}}-if this is not possible, to have a small bias relative to the magnitude of θ. Examples of estimators of the form of Equation (1) include w^\widehat {w} and w^Q\widehat {w} _ {Q} of equations w^=1N∑i=1NWi\widehat {w} = \textstyle \frac {1} {N} \sum_{i = 1} ^ {N} W_{i} and w^Q=\widehat {w} _ {Q} =1N∑i=1N :WiQ⟶wQ\frac {1} {N} \sum_{i = 1} ^ {N} \ : W_{i} ^ {Q} \longrightarrow w_{Q} as N⟶∞N \longrightarrow \infty, in which case YiY_{i} is the time spent in the (sub)system by customer i. The point estimator of ϕ,\phi , based on the data {Y(t),0≤t≤TE}\{Y ( t ) , 0 \leq t \leq T_{E} \}, where TET_{E} is the simulation run length, is defined by

ϕ^=1TE∫0TEY(t)dt(4) \widehat {\phi} = \frac {1}{T_{E}} \int_{0} ^ {T_{E}} Y (t) d t\tag{4}

and is called a time average of Y(t)Y ( t ) over [0,TE][ 0 , T_{E} ]. Simulation languages may refer to this as a “continuous-time,” “discrete-change,” or “time-persistent” statistic. In general,

E(ϕ^)≠ϕ(5) E (\widehat {\phi}) \neq \phi\tag{5}

and ϕ^\widehat {\phi} is said to be biased for φ. Again, we would like to obtain unbiased or low-bias estimators. -Examples of time averages include L^\widehat {L} and L^Q\widehat {L} _ {Q} of Equations L^=1T∫0TL(t)dt⟶L\begin{array} {r} {\widehat {L} = \frac {1} {T} \int_{0} ^ {T} L ( t ) d t \longrightarrow L} \end{array} as T⟶∞T \longrightarrow \infty and L^Q=1T∑i=0∞iTiQ=1T∫0TLQ(t)dt⟶LQ\begin{array} {r} {\widehat {L} _ {Q} = \frac {1} {T} \displaystyle \sum_{i = 0} ^ {\infty} i T_{i} ^ {Q} = \frac {1} {T} \int_{0} ^ {T} L_{Q} ( t ) d t \longrightarrow L_{Q}} \end{array} as T⟶∞T \longrightarrow \infty and YjY_{j} of Equation (11.4)

Generally, θ and φ are regarded as mean measures of performance of the system being simulated. Other measures usually can be put into this common framework. For example, consider estimation o the proportion of days on which sales are lost through an out-of-stock situation. In the simulation, le

Yi={1,if out of stock on dayi0,otherwise Y_{i} = \left\{\begin{array}{l l} 1, & \text{if out of stock on day} i \\ 0, & \text{otherwise} \end{array} \right.

With n equal to the total number of days θ^,{\widehat {\theta}} ,, as defined by Equation (1), is a point estimator of θ;\theta_{;}, the -proportion of out-of-stock days. For a second example, consider estimation of the proportion of time queue length is greater than 10 customers. If LQ(t)L_{Q} ( t ) represents simulated queue length at time t,t , then (in the simulation) define

Y(t)={1,if LQ(t)>100,otherwise Y (t) = \left\{\begin{array}{l l} 1, & \text{if }L_{Q}(t) > 10 \\ 0, & \text{otherwise} \end{array} \right.

Then ϕ^,{\widehat {\phi}} , as defined by Equation (4), is a point estimator of ϕ,\phi ,, the proportion of time that the queue -length is greater than 10 customers. Thus, estimation of proportions or probabilities is a special case of the estimation of means.

A performance measure that does not fit this common framework is a quantile or percentile. Quantiles describe the level of performance that can be delivered with a given probability p.p . For instance, suppose that Y represents the delay in queue that a customer experiences in a service system, measured in minutes. Then the p=0.85p = 0 . 85 quantile of Y is the value θ such that

Pr⁡{Y≤θ}=0.85(6) \operatorname * {P r} \{Y \leq \theta \} = 0. 85\tag{6}

As a percentage,θ\theta is the 100pth or 85th percentile of customer delay. Therefore, 85% of all customers will experience a delay of θ minutes or less. Stated differently, a customer has only a 0.15 probabilit of experiencing a delay of longer than θ minutes. A widely used performance measure is the median, which is the 0.5 quantile or 50th percentile.

The problem of estimating a quantile is the inverse of the problem of estimating a proportion or probability. In estimating a proportion,θ\theta is given and the probability pp is to be estimated; however, in estimating a quantile,pp is given and θ is to be estimated.

The most intuitive method for estimating a quantile is to form a histogram of the observed values of Y, then find a value θ^\widehat {\theta} such that 100p% of the histogram is to the left of (smaller than) θ^.{\widehat {\theta}} . For instance, if we observe n=250n = 250 customer delays {Y1,…,Y250}\{Y_{1} , \ldots , Y_{250} \}-, then an estimate of the 85th percentile of delay is a value θ^\widehat {\theta} such that (0.85)(250)=212.5≈213( 0 . 85 ) ( 250 ) = 212 . 5 \approx 213 of the observed values are less than or equal to θ.\theta .-An obvious estimate is, therefore, to set θ^\widehat {\theta} equal to the 213th smallest value -in the sample (this requires sorting the data). When the output is a continuous-time process, such as the queue-length process {LQ(t),0≤t≤TE}\{L_{Q} ( t ) , 0 \leq t \leq T_{E} \}, then a histogram gives the fraction of time tha the process spent at each possible level (queue length, in this example). However, the method for quantile estimation remains the same: Find a value θ^\widehat {\theta} such that 100p% of the histogram is to the left of θ^.{\widehat {\theta}} ..

3.2 Confidence-Interval Estimation

To understand confidence intervals fully, it is important to understand the difference between a measure of error and a measure of risk. One way to make the difference clear is to contrast a confidence interval with a prediction interval (which is another useful output-analysis tool).

Both confidence intervals and prediction intervals are based on the premise that the data being produced by the simulation is represented well by a probability model. Suppose that model is the normal distribution with mean θ and variance σ2\sigma^{2}, both unknown. To make the example concrete, let YiY_{i} be the average cycle time for parts produced on the ith replication (representing a day of production) of the simulation. Therefore,θ\theta is the mathematical expectation of YiY_{i}, and σ is represents the day-to-day variation of the average cycle time.

Suppose our goal is to estimate θ. If we are planning to be in business for a long time, producing parts day after day, then θ\theta is a relevant parameter, because it is the long-run mean daily cycle time. Our average cycle time will vary from day to day, but over the long run the average of the averages will be close to θ.

The natural estimator for θ\theta is the overall sample mean of n independent replications,Yˉ =\bar {Y} \ =∑i=1nYi/n\scriptstyle \sum_{i = 1} ^ {n} Y_{i} / n. But Yˉ\bar {Y} is not θ, it is an estimate, based on a sample, and it has error. A confidence interva is a measure of that error. Let

S2=1n−1∑i=1n(Yi−Yˉ)2 S^{2} = \frac {1}{n - 1} \sum_{i = 1} ^ {n} \left(Y_{i} - \bar {Y}\right) ^ {2}

be the sample variance across the R replications. The usual confidence interval, which assumes the YiY_{i} are normally distributed, is

Yˉ±tα/2,n−1Sn \bar {Y} \pm t_{\alpha / 2, n - 1} \frac {S}{\sqrt {n}}

where tα/2,R−1t_{\alpha / 2 , R - 1} is the quantile of the t distribution with R−1R - 1 degrees of freedom that cuts off α/2\alpha / 2 the area of each tail. (See Table A.5 in the Appendix). We cannot know for certain exactly how far Yˉ\bar {Y} is from θ,\theta , but the confidence interval attempts to bound that error. Unfortunately, the confidence interval itself may be wrong. A confidence level, such as 95%, tells us how much we can trust the interval to actually bound the error between Y¯ and θ. The more replications we make, the less error there is in Yˉ,{\bar {Y}} , and our confidence interval reflects that because tα/2,n−1S/nt_{\alpha / 2 , n - 1} S / {\sqrt {n}} will tend to get smaller as n increases, converging to 0 as n goes to infinity.

Now suppose we need to make a promise about what the average cycle time will be on a particular day. A good guess is our estimator Yˉ,{\bar {Y}} ,, but it is unlikely to be exactly right. Even θ itself, which is the center of the distribution, is not likely to be the actual average cycle time on any particular day, because the daily average cycle time varies. A prediction interval, on the other hand, is designed to be wide enough to contain the actual average cycle time on any particular day, with high probability.

The normal-theory prediction interval is

Yˉ±tα/2,n−1S1+1n \bar {Y} \pm t_{\alpha / 2, n - 1} S \sqrt {1 + \frac {1}{n}}

The length of this interval will not go to 0 as n increases. In fact, in the limit it becomes

θ±zα/2σ \theta \pm z_{\alpha / 2} \sigma

to reflect the fact that, no matter how much we simulate, our daily average cycle time still varies.

In summary, a prediction interval is a measure of risk, and a confidence interval is a measure of error. We can simulate away error by making more and more replications, but we can never simulate away risk, which is an inherent part of the system. We can, however, do a better job of evaluating risk by making more replications.

Example 9

Suppose that the overall average of the average cycle time on 120 replications of a manufacturing simulation is 5.80 hours, with a sample standard deviation of 1.60 hours. Since t0.025,119=1.98,t_{0 . 025 , 119} = 1 . 98 ,, a 95% confidence interval for the long-run expected daily average cycle time is 5.80±1.98(1.60/120)5 . 80 {\pm} 1 . 98 ( 1 . 60 / \sqrt {120} ) or 5.80±0.295 . 80 \pm 0 . 29 hours. Thus, our best guess of the long-run average of the daily average cycle times is 5.80 hours, but there could be as much as 0.29 hours error in this estimate.

On any particular day, we are 95% confident that the average cycle time for all parts produced on that day will be

5.80±1.98(1.60)1+1120 5. 80 \pm 1. 98 (1. 60) \sqrt {1 + \frac {1}{120}}

or 5.80±3.185 . 80 \pm 3 . 18 hours. The 3.18 hours reflects the inherent variability in the daily average cycle times and the fact that we want to be 95% confident of covering the actual average cycle time on a particular day, rather than simply covering the long-run average.

A caution: In neither case (prediction interval or confidence interval) can we make statements about the cycle time for individual products because we observed the daily average. To make valid statements about the cycle times of individual products, the analysis must be based on individua cycle times.

4 Output Analysis for Terminating Simulations

Consider a terminating simulation that runs over a simulated time interval [0,TE][ 0 , T_{E} ] and results in observations Y1,…,YnY_{1} , \dots , Y_{n}. The sample size n may be a fixed number, or it may be a random variable (say, the number of observations that occur during time TE)T_{E} ). A common goal in simulation is to estimate

θ=E(1n∑i=1nYi) \theta = E \left(\frac {1}{n} \sum_{i = 1} ^ {n} Y_{i}\right)

When the output data are of the form {Y(t),0≤t≤TE}\{Y ( t ) , 0 \leq t \leq T_{E} \}, the goal is to estimate

ϕ=E(1TE∫0TEY(t)dt) \phi = E \left(\frac {1}{T_{E}} \int_{0} ^ {T_{E}} Y (t) d t\right)

The method used in each case is the method of independent replications. The simulation is repeated a total of R times, each run using a different random number stream and independently chosen initia conditions (which includes the case that all runs have identical initial conditions). We now address this problem.

4.1 Statistical Background

Perhaps the most confusing aspect of simulation output analysis is distinguishing within-replication data from across-replication data, and understanding the properties and uses of each. The issue can be further confused by the fact that simulation languages often provide only summary measures, like sample means, sample variances, and confidence intervals, rather than all of the raw data. Sometimes these summary measures are all that the simulation language provides, without a lot of extra work.

To illustrate the key ideas, think in terms of the simulation of a manufacturing system and two performance measures of that system, the cycle time for parts (time from release into the factory until completion) and the work in process (WIP, the total number of parts in the factory at any time). In computer applications, these two measures could correspond to the response time and the length of the task queue at the CPU; in a service application, they could be the time to fulfill a customer’s request and the number of requests on the “to do” list; in a supply-chain application, they could be the order fill time and the inventory level. Similar measures appear in many systems.

Here is the usual set up for something like cycle time: Let YijY_{i j} be the cycle time for the jth part produced in the ith replication. If each replication represents two shifts of production, then the number of parts produced in each replication might differ. Table 2 shows, symbolically, the results of R replications.

Table 2 Within and Across-Replication Cycle-Time Data

Within-Rep DataAcross-Rep Data
Y11Y_{11}Y12Y_{12}⋯\cdotsY1n1Y_{1n_1}Yˉ1..,S12,H1\bar{Y}_{1..}, S_1^2, H_1
Y21Y_{21}Y22Y_{22}⋯\cdotsY2n2Y_{2n_2}Yˉ2..,S22,H2\bar{Y}_{2..}, S_2^2, H_2
⋮\vdots⋮\vdots⋯\cdots⋮\vdots⋮\vdots
YR1Y_{R1}YR2Y_{R2}⋯\cdotsYRnRY_{Rn_R}YˉR..,SR2,HR\bar{Y}_{R..}, S_R^2, H_R
Yˉ..,S2,H\bar{Y}_{..}, S^2, H

The across-replication data are formed by summarizing within-replication data:^1Yˉi⋅{\bar {Y}} _ {i \cdot} is the sample mean of the nin_{i} cycle times from the ith replication,Si2S_{i} ^ {2} is the sample variance of the same data, and

Hi=tα/2,ni−1Sini(7) H_{i} = t _ {\alpha / 2, n_{i} - 1} \frac {S_{i}}{\sqrt {n_{i}}}\tag{7}

is a confidence-interval half-width based on this dataset.

From the across-replication data, we compute overall statistics, the average of the daily cycle time averages

Yˉ⋅⋅=1R∑i=1RYˉi.(8) \bar {Y} _ {\cdot \cdot} = \frac {1}{R} \sum_{i = 1} ^ {R} \bar {Y} _ {i}.\tag{8}

the sample variance of the daily cycle time averages

S2=1R−1∑i=1R(Yˉi.−Yˉ..)2(9) S^{2} = \frac {1}{R - 1} \sum_{i = 1} ^ {R} (\bar {Y} _ {i.} - \bar {Y} _ {..}) ^ {2}\tag{9}

and finally, the confidence-interval half-width

H=tα/2,R−1SR(10) H = t_{\alpha / 2, R - 1} \frac {S}{\sqrt {R}}\tag{10}

The quantity S/RS / \sqrt {R} is the standard error, which is sometimes interpreted as the average error in Yˉ.{\bar {Y}} . as an estimator of θ. Notice that S2S^{2} is not the average of the within-replication sample variances Si2S_{i} ^ {2}; rather, it is the sample variance of the within-replication averages Yˉ1⋅,Yˉ2⋅,…,YˉR⋅\bar {Y} _ {1 \cdot} , \bar {Y} _ {2 \cdot} , \dots , \bar {Y} _ {R \cdot} Table 3 Within and Across-Replication WIP Data

Within-Rep DataAcross-Rep Data
Y1(t),0≤t≤TE1Y_{1}(t), 0 \leq t \leq T_{E_{1}}Yˉ1..,S12,H1\bar{Y}_{1..}, S_{1}^{2}, H_{1}
Y2(t),0≤t≤TE2Y_{2}(t), 0 \leq t \leq T_{E_{2}}Yˉ2..,S22,H2\bar{Y}_{2..}, S_{2}^{2}, H_{2}
⋮\vdots⋮\vdots
YR(t),0≤t≤TERY_{R}(t), 0 \leq t \leq T_{E_{R}}YˉR..,SR2,HR\bar{Y}_{R..}, S_{R}^{2}, H_{R}
Yˉ..,S2,H\bar{Y}_{..}, S^{2}, H

Within a replication, work in process is a continuous-time output, denoted Yi(t)Y_{i} ( t ). The stopping time for the ith replication TEiT _ {E_{i}} could be a random variable, in general; in this example, it is the end of the second shift. Table 3 is an abstract representation of the data produced

The within-replication sample mean and variance are defined appropriately for continuous-time data:

Yˉi.=1TEi∫0TEiYi(t)dt(11) \bar {Y} _ {i.} = \frac {1}{T _ {E_{i}}} \int_{0} ^ {T _ {E_{i}}} Y_{i} (t) d t\tag{11}

and

Si2=1TEi∫0TEi(Yi(t)−Yˉi.)2dt(12) S_{i} ^ {2} = \frac {1}{T _ {E_{i}}} \int_{0} ^ {T _ {E_{i}}} \left(Y_{i} (t) - \bar {Y} _ {i.}\right) ^ {2} d t\tag{12}

A definition for HiH_{i} is more problematic, but, to be concrete, take it to be

Hi=zα/2SiTEi.(13) H_{i} = z_{\alpha / 2} \frac {S_{i}}{\sqrt {T _ {E_{i}}}}.\tag{13}

It is difficult to conceive of a situation in which HiH_{i} is relevant, a topic we discuss later. Although the definitions of the within-replication data change for continuous-time data, the across-replication statistics are unchanged, and this is a critical observation.

Here are the key points that must be understood:

The overall sample average Yˉ⋅⋅{\bar {Y}} _ {\cdot \cdot} and the individual replication sample averages Yˉi{\bar {Y}} _ {i} are always unbiased estimators of the expected daily average cycle time or daily average WIP.

Across-replication data are independent, since they are based on different random numbers; are identically distributed, since we are running the same model on each replication; and tend to be normally distributed, if they are averages of within-replication data, as they are here. This implies that the confidence interval Yˉ..±H{\bar {Y}} . . \pm H is often pretty good.

Within-replication data, on the other hand, might have none of these properties. The individua cycle times may not be identically distributed, if the first few parts of the day find the system empty; they are almost certainly not independent, because one part follows another; and whether they are normally distributed is difficult to know in advance. For this reason,Si2S_{i} ^ {2} and Hi⋅H_{i \cdot}, which are computed under the assumption of independent and identically distributed (i.i.d.)\mathrm{( i . i . d . )} data, tend not to be useful, although there are exceptions.

There are situations in which Y¯ and Yi⋅Y_{i \cdot} are valid estimators of the expected cycle time for an individual part or the expected WIP at any point in time, rather than the daily average. (See Section 5 on steady-state simulations.) Even when this is the case, the confidence interva Yˉ..±H{\bar {Y}} . . \pm H is valid, and Yˉi⋅±Hi\bar {Y} _ {i \cdot} \pm H_{i} is not. The difficulty occurs because Si2S_{i} ^ {2} is a reasonable estimator of the variance of the cycle time, but Si2/niS_{i} ^ {2} / n_{i} and Si2/TEiS_{i} ^ {2} / T _ {E_{i}} are not good estimators of the Var[Yˉi⋅];\mathrm{V a r} [ \bar {Y} _ {i \cdot} ] ; more on this in Section 5.2.

Example 10: Software Made Personal (cont.)

Consider Example 7, the SMP call center problem, with the data for R=4R = 4 replications given in Table 1. The four number-on-hold estimates L^Qr\widehat {L} _ {Q r} are time averages of the form of Equation (11), where Yr(t)=LO(t)Y_{r} ( t ) = L _ {\mathcal {O}} ( t )-, the number of customers on hold at time t. Similarly, the four average system times w^Q1,…,w^Q4\widehat {w} _ {Q 1} , \dots , \widehat {w} _ {Q 4} are analogous to Yˉr.{\bar {Y}} _ {r} . of Table 2, where YriY_{r i} is the actual time spent on hold by - -customer i on replication r.r . Suppose that the analyst desires a 95% confidence interval for the mean time spent on hold,wQw_{Q} Using Equation (8), compute an overall point estimator

Yˉ⋅⋅=w^Q=0.88+5.04+4.13+0.524=2.64 \bar {Y} _ {\cdot \cdot} = \widehat {w} _ {Q} = \frac {0 . 88 + 5 . 04 + 4 . 13 + 0 . 52}{4} = 2. 64

Using Equation (9), compute its estimated variance:

S2=(0.88−2.64)2+⋯+(0.52−2.64)24−1=(2.28)2 S^{2} = \frac {(0 . 88 - 2 . 64) ^ {2} + \cdots + (0 . 52 - 2 . 64) ^ {2}}{4 - 1} = (2. 28) ^ {2}

Thus, the standard error of w^Q=2.64\widehat {w} _ {Q} = 2 . 64 is estimated by s.e.(w^O)=S/4=1.14\mathrm{s . e .} ( \widehat {w} _ {O} ) = S / \sqrt {4} = 1 . 14. Obtain t0.025,3=t_{0 . 025 , 3} =- -3.18 from Table A.5, and compute the 95% confidence interval half-width by Equation (10) as

H=t0.025,3S4=(3.18)(1.14)=3.62 H = t_{0. 025, 3} \frac {S}{\sqrt {4}} = (3. 18) (1. 14) = 3. 62

giving 2.64±3.622 . 64 \pm 3 . 62 minutes with 95% confidence. Clearly 4 replications are far too few to make any sort of useful estimate of wQw_{Q}, since a negative mean waiting time is impossible. Later in the chapter we return to this problem and determine how many replications are required to get a meaningfu estimate.

4.2 Confidence Intervals with Specified Precision

By Expression (10), the half-length H of a 100(1−α)%100 ( 1 - \alpha ) \% confidence interval for a mean θ, based on the t distribution, is given by

H=tα/2,R−1SR H = t_{\alpha / 2, R - 1} \frac {S}{\sqrt {R}}

where S2S^{2} is the sample variance and R is the number of replications. In simulation we seldom need to select R and just accept the confidence interval half-length that results. Instead, we can drive the number of replications to be large enough so that H is small enough to facilitate the decision that the simulation is supposed to support. The acceptable size of H depends on the problem at hand: i might be $5000 in a financial simulation, 6 minutes for product cycle time, or 1 customer on hold in a call center.

Suppose that an error criterion of  is specified; in other words, it is desired to estimate θ by Yˉ.{\bar {Y}} . to within  with high probability—say, at least 1 α. Thus, it is desired that a sufficiently large sample size R be taken to satisfy

P(∣Yˉ..−θ∣≤ϵ)≥1−α P (| \bar {Y}.. - \theta | \leq \epsilon) \geq 1 - \alpha

When the sample size R is fixed, no guarantee can be given for the resulting error. But if the sample size can be increased, an error criterion (such as ϵ=$5000\epsilon = \$5000, 6 minutes, or 1 customer) can be specified.

Assume that an initial sample of size R0R_{0} replications has been observed—that is, the simulation analyst initially makes R0R_{0} independent replications. We must have R0≥2R_{0} \ge 2, with 10 or more being desirable. The R0R_{0} replications will be used to obtain an initial estimate S02S_{0} ^ {2} of the population variance σ2\sigma^{2}. To meet the half-length criterion, a sample size R must be chosen such that R≥R0R \geq R_{0} and

H=tα/2,R−1S0R≤ϵ(14) H = t_{\alpha / 2, R - 1} \frac {S_{0}}{\sqrt {R}} \leq \epsilon\tag{14}

Solving for R in Inequality (14) shows that R is the smallest integer satisfying R≥R0R \geq R_{0} and

R≥(tα/2,R−1S0ϵ)2(15) R \geq \left(\frac {t_{\alpha / 2 , R - 1} S_{0}}{\epsilon}\right) ^ {2}\tag{15}

An initial estimate for R is given by

R≥(zα/2S0ϵ)2(16) R \geq \left(\frac {z_{\alpha / 2} S_{0}}{\epsilon}\right) ^ {2}\tag{16}

where zα/2z_{\alpha / 2} is the 100(1−α/2)100 ( 1 - \alpha / 2 ) percentage point of the standard normal distribution from Table A.3 in the Appendix. And since tα/2,R−1≈zα/2t_{\alpha / 2 , R - 1} \approx z_{\alpha / 2} for large R, say,R≥50R \geq 50, the second inequality for R is adequate when R is large. After determining the final sample size R, collect R−R0R - R_{0} additional observations (i.e., make R−R0R - R_{0} additional replications, or start over and make R total replications) and form the 100(1 α)% confidence interval for θ by

Yˉ⋅⋅−tα/2,R−1SR≤θ≤Yˉ⋅⋅+tα/2,R−1SR(17) \bar {Y} _ {\cdot \cdot} - t_{\alpha / 2, R - 1} \frac {S}{\sqrt {R}} \leq \theta \leq \bar {Y} _ {\cdot \cdot} + t_{\alpha / 2, R - 1} \frac {S}{\sqrt {R}}\tag{17}

where Yˉ.{\bar {Y}} . and S2S^{2} are computed on the basis of all R replications,Yˉ.{\bar {Y}} . by Equation (8), and S2S^{2} by Equation (9). The half-length of the confidence interval given by Inequality (17) should be approximately  or smaller; however, with the additional R−R0R - R_{0} observations, the variance estimator S2S^{2} could differ somewhat from the initial estimate S02,S_{0} ^ {2} , possibly causing the half-length to be greater than desired. If the confidence interval from Inequality (17) is too large, the procedure may be repeated, using Inequality (15), to determine an even larger sample size.

Example 11

Suppose that it is desired to estimate the mean waiting time in SMP’s hold queue in Example 7 to within 0.5 minutes with 95% confidence. We will illustrate this calculation using the “Get Sample Sizeγ\mathrm {S i z e^{\gamma}} utility of SimulationTools.xls. The input dialog box is shown in Figure 3 and the results are displayed in Figure 4. Notice that “Absolute Precision” means that we directly specify the half width of the confidence interval ( 0.5 minutes in this case); “Relative Precision” specifies the length of the half width as a fraction of the mean.

An initial sample of size R0 = 20R_{0} ~ = ~ 20 is taken, and the program determines that R = 175R \ = \ 175 is the smallest integer satisfying Inequality (16). Therefore,R−R0=175−20=155R - R_{0} = 175 - 20 = 155 additional replications are needed. After obtaining the additional outputs, we would again need to compute the half-width H to ensure that it is as small as is desired. In this case the result—which can also be found at www.bcnn.net—was 2.66±0.342 . 66 \pm 0 . 34 minutes

Figure 3 Input Dialog for the ‘‘Get Sample Size’’ utility of SimulationTools.xls

Get Sample SizeCompletedData ColumnMinimum Sample Size
10.880897931175
Number of Observations2025.04340304
Alpha0.0534.132638545
Precision Type140.517418075
Precision Value0.552.584490259
60.860547939
71.544612493
81.762676832
96.925242515
102.201491896
112.915438392
120.486246064
131.792947434
141.244455641
154.278579049
1613.91696167
170.235565331
180.685156864
191.577792626
201.070626537

Figure 4 Sample Size Calculation using ‘‘Get Sample Size’’ in SimulationTools.xl

4.3 Quantiles

To present the interval estimator for quantiles, it is helpful to review the interval estimator for a mean in the special case when the mean represents a proportion or probability p.p . In this book, we have chosen to treat a proportion or probability as just a special case of a mean. However, in many statistics texts, probabilities are treated separately.

When the number of independent replications Y1,…,YRY_{1} , \dots , Y_{R} is large enough that tα/2,n−1≐zα/2t_{\alpha / 2 , n - 1} \doteq z_{\alpha / 2} the confidence interval for a probability pp is often written as

p^±zα/2p^(1−p^)R−1 \widehat {p} \pm z_{\alpha / 2} \sqrt {\frac {\widehat {p} (1 - \widehat {p})}{R - 1}}

where p^\widehat {p} is the sample proportion (algebra shows that this formula for the half-width is precisely -equivalent to Equation (10) when used in estimating a proportion).

As mentioned in Section 3, the quantile-estimation problem is the inverse of the probabilityestimation problem: Find θ such that Pr⁡{Y≤θ}=p.\operatorname* {P r} \{Y \leq \theta \} = p .. Thus, to estimate the pp quantile, we find tha value θ^\widehat {\theta} such that 100p% of the data in a histogram of Y is to the left of θ^,{\widehat {\theta}} ,, or, stated differently, the -npth smallest value of Y1,…,YRY_{1} , \dots , Y_{R} Extending this idea, an approximate (1−α)100%( 1 - \alpha ) 100 \% confidence interval for θ\theta can be obtained by finding two values:θℓ\theta_{\ell} that cuts off 100pℓ100 p_{\ell}% of the histogram and θu\theta_{u} that cuts off 100pu%100 p_{u} \% of the

histogram, where

pℓ=p−zα/2p(1−p)R−1 p_{\ell} = p - z_{\alpha / 2} \sqrt {\frac {p (1 - p)}{R - 1}} pu=p+zα/2p(1−p)R−1(18) p_{u} = p + z_{\alpha / 2} \sqrt {\frac {p (1 - p)}{R - 1}}\tag{18}

(Recall that we know p.)p . ) In terms of sorted values,θℓ^\widehat {\theta_{\ell}} is the RpℓR p_{\ell} smallest value (rounded down) and θu^\widehat {\theta_{u}} is the RpuR p_{u} smallest value (rounded up), of Y1,…,YRY_{1} , \dots , Y_{R}

Example 12

Suppose that we want to estimate the 0.75 quantile of average daily waiting time in the hold queue for SMP and form a 95% confidence interval for it, based on R=300R = 300 replications. The data may be found in the spreadsheet Quantile.xls at www.bcnn.net. The point estimator is θ^=3.39˙\widehat \theta = 3 . 3 \dot {9} minutes, because that is the 300×0.75=225th300 \times 0 . 75 = 225 \mathrm{t h}-smallest value of the sorted data. The interpretation is that, over the long run, on 75% of the days the average time customers spend on hold will be less than or equal to 3.39 minutes.

To obtain the confidence interval, we first compute

pℓ=p−zα/2p(1−p)R−1=0.75−1.960.75(0.25)299=0.700 p_{\ell} = p - z_{\alpha / 2} \sqrt {\frac {p (1 - p)}{R - 1}} = 0. 75 - 1. 96 \sqrt {\frac {0 . 75 (0 . 25)}{299}} = 0. 700 pu=p+zα/2p(1−p)R−1=0.75+1.960.75(0.25)299=0.799 p_{u} = p + z_{\alpha / 2} \sqrt {\frac {p (1 - p)}{R - 1}} = 0. 75 + 1. 96 \sqrt {\frac {0 . 75 (0 . 25)}{299}} = 0. 799

The lower bound ofthe confidence interval is θℓ^=3.13\widehat {\theta_{\ell}} = 3 . 13 minutes (the 300×pℓ=2300 \times p_{\ell} = 210th smallest value, -rounding down); the upper bound of the confidence interval is θu^=3\widehat {\theta_{u}} = 3.98 minutes (the 300×pu=300 \times p_{u} =-240th smallest value, rounding up). Thus, with 95% confidence, the point estimate of 3.39 minutes is no more than max {3.98−3.39,3.39−3.13}=0.59\{3 . 98 - 3 . 39 , 3 . 39 - 3 . 13 \} = 0 . 59 minutes off the true 0.75 quantile.

It is important to understand the 3.39 minutes is an estimate of the 0.75 quantile (75th percentile) of daily average customer delay, not an individual customer’s delay. Because the call center starts the day empty and idle, and the customer load on the system varies throughout the day, the 0.75 quantile of individual customer waiting time varies throughout the day and cannot be given by a single number.

4.4 Estimating Probabilities and Quantiles from Summary Data

Knowing the equation for the confidence interval half-width is important if all that the simulation software provides is Y¯ and H and you need to work out the number of replications required to get a prespecified precision, or if you need to estimate a probability or quantile. You know the number of replications, so the sample standard deviation can be extracted from H by using the formula

S=HRtα/2,R−1 S = \frac {H \sqrt {R}}{t_{\alpha / 2 , R - 1}}

With this information, the method in Section 4.2 can be employed.

The more difficult problem is estimating a probability or quantile from summary data. When al we have available is the sample mean and confidence-interval halfwidth (which gives us the sample standard deviation), then one approach is to use a normal-theory approximation for the probabilities or quantiles we desire, specifically

Pr⁡{Yˉi.≤c}≈Pr⁡{Z≤c−Yˉ..S} \operatorname * {P r} \{\bar {Y} _ {i.} \leq c \} \approx \operatorname * {P r} \left\{Z \leq \frac {c - \bar {Y} _ {. .}}{S} \right\}

and

θ^≈Yˉ..+zpS \widehat {\theta} \approx \bar {Y} _ {..} + z_{p} S

The following example illustrates how this is done.

Example 13

From 25 replications of a manufacturing simulation, a 90% confidence interval for the daily average WIP is 218 32. What is the probability that the daily average WIP is less than 350? What is the 85th percentile of daily average WIP?

First, we extract the standard deviation:

S=HRt0.05,24=32251.71=93 S = \frac {H \sqrt {R}}{t_{0 . 05 , 24}} = \frac {32 \sqrt {25}}{1 . 71} = 93

Then, we use the normal approximations and Table A.3 to get

Pr⁡{Yˉi.≤350}≈Pr⁡{Z≤350−21893}=Pr⁡{Z≤1.42}=0.92 \operatorname * {P r} \{\bar {Y} _ {i.} \leq 350 \} \approx \operatorname * {P r} \left\{Z \leq \frac {350 - 218}{93} \right\} = \operatorname * {P r} \{Z \leq 1. 42 \} = 0. 92

and

θ^≈Yˉ..+z0.85S=218+1.04(93)=315parts \widehat {\theta} \approx \bar {Y} _ {..} + z_{0. 85} S = 218 + 1. 04 (93) = 315 \text{parts}

There are shortcomings to obtaining our probabilities and quantiles this way. The approximation depends heavily on whether the output variable of interest is normally distributed. If the outpu variable itself is not an average, then this approximation is suspect. Therefore, we expect the approximation to work well for statements about the average daily cycle time, for instance, but very poorly for the cycle time of an individual part.

5 Output Analysis for Steady-State Simulations

Consider a single run of a simulation model whose purpose is to estimate a steady-state, or long-run, characteristic of the system. Suppose that the single run produces observations Y1,Y2,…Y_{1} , Y_{2} , \ldots, which, generally, are samples of an autocorrelated time series. The steady-state (or long-run) measure o performance, θ, is defined by

θ=lim⁡n⟶∞1n∑i=1nYi(19) \theta = \lim_{n \longrightarrow \infty} \frac {1}{n} \sum_{i = 1} ^ {n} Y_{i}\tag{19}

with probability 1, where the value of θ is independent of the initial conditions. (The phrase “with probability 1∘1^{\circ} means that essentially all simulations of the model, using different random numbers, will produce a series Yi,i=1,2,..Y_{i} , i = 1 , 2 , . .. whose sample average converges to θ.) For example, if YiY_{i} was the time customer i spent talking to an operator, then θ would be the long-run average time a customer spends talking to an operator; and, because θ is defined as a limit, it is independent of the call center’s conditions at time 0. Similarly, the steady-state performance for a continuous-time output measure {Y(t),t≥0}\{Y ( t ) , t \geq 0 \}, such as the number of customers in the call center’s hold queue, is defined as

ϕ=lim⁡TE⟶∞1TE∫0TEY(t)dt \phi = \lim _ {T_{E} \longrightarrow \infty} \frac {1}{T_{E}} \int_{0} ^ {T_{E}} Y (t) d t

with probability 1.

Of course, the simulation analyst could decide to stop the simulation after some number of observations, say, n, have been collected; or the simulation analyst could decide to simulate for some length of time TET_{E} that determines n (although n may vary from run to run). The sample size n (or TE)T_{E} ) is a design choice; it is not inherently determined by the nature of the problem. The simulation analyst will choose simulation run length (n or TE)T_{E} ) with several considerations in mind:

  1. Any bias in the point estimator that is due to artificial or arbitrary initial conditions. (The bias can be severe if run length is too short, but generally it decreases as run length increases.)

  2. The desired precision of the point estimator, as measured by the standard error or confidence interval half-width.

  3. Budget constraints on the time available to execute the simulation.

The next subsection discusses initialization bias and the following subsections outline two methods of estimating point-estimator variability. For clarity of presentation, we discuss only estimation of θ from a discrete-time output process. Thus, when discussing one replication (or run), the notation

Y1,Y2,Y3,… Y_{1}, Y_{2}, Y_{3}, \ldots

will be used; if several replications have been made, the output data for replication r will be denoted by

Yr1,Yr2,Yr3,…(20) Y_{r 1}, Y_{r 2}, Y_{r 3}, \ldots\tag{20}

5.1 Initialization Bias in Steady-State Simulations

There are several methods of reducing the point-estimator bias caused by using artificial and unrealistic initial conditions in a steady-state simulation. The first method is to initialize the simulation in a state that is more representative of long-run conditions. This method is sometimes called intelligent initialization. Examples include

  1. setting the inventory levels, number of backorders, and number of items on order and their arrival dates in an inventory simulation;

  2. placing customers in queue and in service in a queueing simulation;

  3. having some components fail or degrade in a reliability simulation.

There are at least two ways to specify the initial conditions intelligently. If the system exists, collect data on it and use these data to specify more nearly typical initial conditions. This method sometimes requires a large data-collection effort. In addition, if the system being modeled does no exist—for example, if it is a variant of an existing system—this method is impossible to implement. Nevertheless, it is recommended that simulation analysts use any available data on existing systems to help initialize the simulation, as this will usually be better than assuming the system to be “completely stocked,” “empty and idle,” or “brand new” at time 0.

A related idea is to obtain initial conditions from a second model of the system that has been simplified enough to make it mathematically solvable. The queueing models are very useful for this purpose. The simplified model can be solved to find long-run expected or most likely conditions— such as the expected number of customers in the queue—and these conditions can be used to initialize the simulation.

A second method to reduce the impact of initial conditions, possibly used in conjunction with the first, is to divide each simulation run into two phases: first, an initialization phase, from time 0 to time T0,T_{0} , followed by a data-collection phase from time T0T_{0} to the stopping time T0+TE;T_{0} + T_{E} ; that is, the simulation begins at time 0 under specified initial conditions I0I_{0} and runs for a specified period of time T0T_{0}. Data collection on the response variables of interest does not begin until time T0T_{0} and continues until time T0+TET_{0} + T_{E}. The choice of T0T_{0} is quite important, because the system state at time T0,T_{0} , denoted by I,I , should be more nearly representative of steady-state behavior than are the origina initial conditions I0I_{0} at time 0. In addition, the length TET_{E} of the data-collection phase should be long enough to guarantee sufficiently precise estimates of steady-state behavior. Notice that the system state I at time T0T_{0} is a random variable and to say that the system has reached an approximate steady state is to say that the probability distribution of the system state at time T0T_{0} is sufficiently close to the steady-state probability distribution as to make the bias in point estimates of response variables negligible. Figure 5 illustrates the two phases of a steady-state simulation. The effect of starting a simulation run of a queueing system in the empty and idle state, as well as a useful plot to aid the simulation analyst in choosing an appropriate value for T0,T_{0} ,, are given in the following example.

Figure 5 Initialization and data collection phases of a steady-state simulation run.

Consider the FastChip wafer fabrication problem discussed in Example 8. Suppose that a total of R 10 independent replications were made, each run long enough so that 250 cycle times were collected for each of Chip-C and Chip-D. We will focus on Chip-C.

Normally we average all data within each replication to obtain a replication average. However, our goal at this stage is to identify the trend in the data due to initialization bias and find out when i dissipates. To do this, we will average corresponding cycle times across replications and plot them (this idea is usually attributed to Welch [1983]). Such averages are known as ensemble averages. Specifically, let Yr1,Yr2,…,Yr250Y_{r 1} , Y_{r 2} , \dots , Y_{r 250} be the 250 Chip-C cycle times, in order of completion, from replication r. For the jth cycle time, define the ensemble average across all R replications to be

Yˉ.j=1R∑r=1RYrj(21) \bar {Y} _ {. j} = \frac {1}{R} \sum_{r = 1} ^ {R} Y_{r j}\tag{21}

(R 10 here). The ensemble averages are plotted as the solid line in Figure 6 (the dashed lines will be discussed below). This plot was produced by the SimulationTools.xls spreadsheet, and we will refer to it as a mean plot.

Notice the gradual upward tread at the beginning. The simulation analyst may suspect that this is due to the downward bias in these estimators, which in turn is due to the fab being empty and idle at time 0. As time becomes larger (so the number of cycle times recorded increases), the effect of the initial conditions on later observations lessens and the observations appear to vary around a common mean. When the simulation analyst feels that this point has been reached, then the data-collection phase begins. Here approximately 120 Chip-C cycle times might be adequate.

Although we have determined a deletion amount of 120 cycle times, the initialization phase is almost always specified in terms of simulation time T0,T_{0} , because we need to consider the initialization phase for each performance measure, and they may differ. In the FastChip example we would also

Figure 6 Mean Plot Across 10 Replications of 250 Product C Cycle Times

need to examine the cycle times for Chip-D. If we specified the initialization phase as a count for each output, then we would have to track these counts. When the initialization phase is specified by time, on the other hand, then a single event can be scheduled at time T0,T_{0} ,, and data only retained beyond that point.

To specify T0T_{0} by time we have to convert the appropriate counts into approximate times and use the largest of these. For instance, for the FastChip simulation 120 Chip-C cycle times corresponds to approximately 200 hours of simulation time, since cassettes are released at 1 per hour and 60% o the releases are Chip-C: 120 cycle times/0.6 releases/hour 200 hours (we could also increase this somewhat to account for the time it takes the 120th Chip-C release to traverse the fab). This turns out to be larger than the initialization phase for Chip-D, so we set T0=200T_{0} = 200 hours.

Plotting ensemble averages is extra work (although SimulationTools.xls makes it easier), so it might be tempting to take a shortcut. For instance, one might plot the output from only replication 1,Y11,Y12,…,Y1nY_{11} , Y_{12} , \dots , Y_{1 n}, or the cumulative average from a replication 1

Yˉ1ℓ=1ℓ∑j=1ℓY1j \bar {Y} _ {1 \ell} = \frac {1}{\ell} \sum_{j = 1} ^ {\ell} Y_{1 j}

for ℓ=1,2,…,n.\ell = 1 , 2 , \ldots , n .. Figure 7 shows both. Notice that the raw data from a single replication can be too highly variable to detect the trend, while the cumulative plot is clearly biased low because it retains all of the data from the beginning of the run. Thus, these shortcuts should be avoided and the mean plot used instead.

Figure 7 Plot of 250 Product C Cycle Times from 1 Replication, Raw and Cumulative Average

Some additional factors to keep in mind when using the mean plot to determine the initialization phase:

  1. When first starting to examine the initialization phase, a run length and number of replications will have to be guessed. Ensemble averages, such as Figure 6, will reveal a smoother and more precise trend as the number of replications R is increased, and it may have to be increased several times until the trend is clear. It is also possible that the run length guess is not long enough to get past the initialization phase (this would be indicated if the trend in the mean plot does not disappear), so the run length may have to be increased as well.

  2. Ensemble averages can also be smoothed by plotting a moving average rather than the original ensemble averages. In a moving average, each plotted point is actually the average of severa adjacent ensemble averages. Specifically, the jth plot point would be

Y~⋅j=12m+1∑i=j−mj+mYˉ⋅i \tilde {Y} _ {\cdot j} = \frac {1}{2 m + 1} \sum_{i = j - m} ^ {j + m} \bar {Y} _ {\cdot i}

for some m≥1m \geq 1, rather than the original ensemble average Yˉ⋅j{\bar {Y}} _ {\cdot j}. The value of m is typically chosen by trial and error until a smooth plot is obtained. The mean plot in Figure 6 was obtained with m=2m = 23. Since each ensemble average (or moving average) is the sample mean of i.i.d. observations across R replications, a confidence interval based on the t distribution can be placed around each point, as shown by the dashed lines in Figure 6,^ {6 ,} and these intervals can be used to judge whether or not the plot is precise enough to decide that bias has diminished. This is the preferred method to determine a deletion point.

  1. Cumulative averages, such as in Figure 7, become less variable as more data are averaged. Therefore, it is expected that the left side of the curve will always be less smooth than the righ side. Remember that cumulative averages tend to converge more slowly to long-run performance than do ensemble averages, because cumulative averages contain all observations, including the most biased ones from the beginning of the run. For this reason, cumulative averages should be used only if it is not feasible to compute ensemble averages, such as when only a single replication is possible.

There has been no shortage of solutions to the initialization-bias problem. Unfortunately, for every “solution” that works well in some situations, there are other situations in which either it is not applicable or it performs poorly. Important ideas include testing for bias (e.g., Kelton and Law [1983], Schruben [1980], Goldsman, Schruben, and Swain [1994]); modeling the bias (e.g., Snel and Schruben [1985]); and randomly sampling the initial conditions on multiple replications (e.g., Kelton [1989]).

5.2 Error Estimation for Steady-State Simulation

If {Y1,…,Yn}\{Y_{1} , \ldots , Y_{n} \} are not statistically independent, then S2/n,S^{2} / n ,, given by Equation (9),( 9 ) ,, is a biased estimator of the true variance ∇(θ^)\nabla ( \widehat {\theta} ). This is almost always the case when {Y1,…,Yn}\{Y_{1} , \ldots , Y_{n} \} is a sequence of output observations from within a single replication. In this situation,Y1,Y2,…Y_{1} , Y_{2} , \ldots. is an autocorrelated sequence, sometimes called a time series.

Suppose that our point estimator for θ is the sample mean Yˉ=∑i=1nYi/n.A⁡\textstyle {\bar {Y}} = \sum_{i = 1} ^ {n} Y_{i} / n . \operatorname{A} general result^2 from mathematical statistics is that the variance of Yˉ\bar {Y} is

V(Yˉ)=1n2∑i=1n∑j=1ncov⁡(Yi,Yj)(22) \mathrm{V} (\bar {Y}) = \frac {1}{n^{2}} \sum_{i = 1} ^ {n} \sum_{j = 1} ^ {n} \operatorname{cov} (Y_{i}, Y_{j})\tag{22}

where cov (Yi,Yi)=V⁡(Yi)( Y_{i} , Y_{i} ) = \operatorname{V} ( Y_{i} ). To construct a confidence interval for θ, an estimate of V(Yˉ)\mathrm{V} ( {\bar {Y}} ) is required. But obtaining an estimate of Equation (22) is futile, because each term cov (Yi,Yj)( Y_{i} , Y_{j} ) could be different, in general. Fortunately, systems that have a steady state will, if simulated long enough to pass the transient phase, produce an output process that is approximately covariance stationary. Intuitively, stationarity implies that Yi+kY_{i + k} depends on Yi+1Y_{i + 1} in the same manner as YkY_{k} depends on Y1Y_{1}. In particular, the covariance between two random variables in the time series depends only on the number o observations between them, called the lagl a g For a covariance-stationary time series,{Y1,Y2,…}\{Y_{1} , Y_{2} , \ldots \}, define the lag-k autocovariance by

γk=cov⁡(Y1,Y1+k)=cov⁡(Yi,Yi+k)(23) \gamma_{k} = \operatorname{cov} (Y_{1}, Y_{1 + k}) = \operatorname{cov} (Y_{i}, Y_{i + k})\tag{23}

which, by definition of covariance stationarity, is not a function of i. For k=0,k = 0 ,, γ becomes the population variance σ2;\sigma^{2} ; that is,

γ0=cov⁡(Yi,Yi+0)=V(Yi)=σ2(24) \gamma_{0} = \operatorname{cov} (Y_{i}, Y_{i + 0}) = \mathrm{V} (Y_{i}) = \sigma^{2}\tag{24}

The lag-k autocorrelation is the correlation between any two observations k apart. It is defined by

ρk=γkσ2(25) \rho_{k} = \frac {\gamma_{k}}{\sigma^{2}}\tag{25}

and has the property that

$$

  • 1 \leq \rho_{k} \leq 1, \quad k = 1, 2, \dots $$

If a time series is covariance stationary, then Equation (22) can be simplified substantially. Algebra shows that

V(Yˉ)=σ2n[1+2∑k=1n−1(1−kn)ρk](26) \mathrm{V} (\bar {Y}) = \frac {\sigma^{2}}{n} \left[ 1 + 2 \sum_{k = 1} ^ {n - 1} \left(1 - \frac {k}{n}\right) \rho_{k} \right]\tag{26}

where ρk\rho_{k} is the lag-k autocorrelation given by Equation (25).

When ρk>0\rho_{k} > 0 for all k (or most k), the time series is said to be positively autocorrelated. In this case, large observations tend to be followed by large observations, small observations by smal ones. Such a series will tend to drift slowly above and then below its mean. Figure 8(a) is an example of a stationary time series exhibiting positive autocorrelation. The output data from most queueing simulations are positively autocorrelated.

(a)

(b)

(c) Figure 8 (a) Stationary time series Yj\pmb {Y_{j}} exhibiting positive autocorrelation; (b) stationary time series Yj\pmb {Y_{j}} exhibiting negative autocorrelation; (c) nonstationary time series with an upward trend.

On the other hand, if some of the ρk<0,\rho_{k} < 0 , the series Y1,Y2,…Y_{1} , Y_{2} , \ldots. will display the characteristics of negative autocorrelation. In this case, large observations tend to be followed by small observations, and vice versa. Figure 8(b) is an example of a stationary time series exhibiting negative autocorrelation. The output of certain inventory simulations might be negatively autocorrelated.

Figure 8(c) also shows an example of a time series with an upward trend. Such a time series is not stationary; the probability distribution of YiY_{i} is changing with the index i.

Why does autocorrelation make it difficult to estimate V(Yˉ)?{\mathrm{V}} ( {\bar {Y}} ) {\mathrm{?}} Recall that the standard estimator for the variance of a sample mean is S2/nS^{2} / n. By using Equation (26), it can be shown [Law, 1977] that the expected value of the variance estimator S2/nS^{2} / n is

E(S2n)=BV(Yˉ)(27) E \left(\frac {S^{2}}{n}\right) = B \mathrm{V} (\bar {Y})\tag{27}

where

B=n/c−1n−1(28) B = \frac {n / c - 1}{n - 1}\tag{28}

and c is the quantity in brackets in Equation (26). The effect of the autocorrelation on the estimator S2/nS^{2} / n is derived by an examination of Equations (26) and (28). There are essentially three possibilities:

Case 1

If the YiY_{i} are independent, then ρk = 0\rho_{k} \ = \ 0 for k=1,2,3,…k = 1 , 2 , 3 , \ldots. Therefore,c=1+2∑k=1n−1(1−\begin{array} {r} {c = 1 + 2 \sum_{k = 1} ^ {n - 1} ( 1 -} \end{array}k/n)ρk=1k / n ) \rho_{k} = 1 and Equation (26) reduces to the familiar σ2/n\sigma^{2} / n. Notice also that B=1B = 1, so S2/nS^{2} / n is an unbiased estimator of V(Y¯ ). The YiY_{i} will always be independent when they are obtained from differen replications; that independence is the primary reason that we prefer experiment designs calling for multiple replications.

Case 2

If the autocorrelations ρk\rho_{k} are primarily positive, then c=1+2∑k=1n−1(1−k/n)ρk>1\begin{array} {r} {c = 1 + 2 \sum_{k = 1} ^ {n - 1} ( 1 - k / n ) \rho_{k} > 1} \end{array}, so that n/c<n,n / c < n ,, and hence B<1B < 1. Therefore,S2/nS^{2} / n is biased low as an estimator of V(Yˉ)\mathrm{V} ( {\bar {Y}} ). If this correlation were ignored, the nominal 100(1−α)%100 ( 1 - \alpha ) \% confidence interval given by Expression (10) would be too short, and its true confidence coefficient would be less than 1−α.1 - \alpha .. The practical effect would be that the simulation analyst would have unjustified confidence in the apparent precision of the poin estimator due to the shortness of the confidence interval. If the correlations ρk\rho_{k} are large, B could be quite small, implying a significant underestimation.

Case 3

If the autocorrelations ρk\rho_{k} are substantially negative, then 0≤c<10 \leq c < 1, and it follows that B>1B > 1 and S2/nS^{2} / n is biased high for V(Yˉ)\mathrm{V} ( {\bar {Y}} ). In other words, the true precision of the point estimator Yˉ\bar {Y} would be greater than what is indicated by its variance estimator S2/nS^{2} / n, because

V(Yˉ)<E(S2n) \mathrm{V} (\bar {Y}) < E \left(\frac {S^{2}}{n}\right)

As a result, the nominal 100(1−α)%100 ( 1 - \alpha ) \% confidence interval of Expression (10) would have true confidence coefficient greater than 1−α1 - \alpha. This error is less serious than Case 2, because we are unlikely to make incorrect decisions if our estimate is actually more precise than we think it is.

A simple example demonstrates why we are especially concerned about positive correlation: Suppose you want to know how students on a university campus will vote in an upcoming election. To estimate their preferences, you plan to solicit 100 responses. The standard experiment is to randomly select 100 students to poll; call this experiment A. An alternative is to randomly select 20 students and ask each of them to state their preference 5 times in the same day; call this experiment B. Both experiments obtain 100 responses, but clearly an estimate based on experiment B will be less precise (will have larger variance) than an estimate based on experiment A. Experiment A obtains 100 independent responses, whereas experiment B obtains only 20 independent responses and 80 dependent ones. The five opinions from any one student are perfectly positively correlated (assuming a student names the same candidate all five times). Although this is an extreme example, i illustrates that estimates based on positively correlated data are more variable than estimates based on independent data. Therefore, a confidence interval or other measure of error should account correctly for dependent data, but S2/nS^{2} / n does not.

Two methods for eliminating or reducing the deleterious effects of autocorrelation upon estimation of a mean are given in the following sections. Unfortunately, some simulation languages either use or facilitate the use of S2/nS^{2} / n as an estimator of V(Yˉ)\mathrm{V} ( {\bar {Y}} )), the variance of the sample mean, in all situations. If used uncritically in a simulation with positively autocorrelated output data, the downward bias in S2/nS^{2} / n and the resulting shortness of a confidence interval for θ will convey the impression of much greater precision than actually exists. When such positive autocorrelation is present in the output data, the true variance of the point estimator Yˉ\bar {Y} can be many times greater than is indicated by S2/nS^{2} / n

5.3 Replication Method for Steady-State Simulations

If initialization bias in the point estimator has been reduced to a negligible level (through some combination of intelligent initialization and deletion), then the method of independent replications can be used to estimate point-estimator variability and to construct a confidence interval. The basic idea is simple: Make R replications, initializing and deleting from each one the same way.

If, however, significant bias remains in the point estimator and a large number of replications are used to reduce point-estimator variability, the resulting confidence interval can be misleading. This happens because bias is not affected by the number of replications R; it is affected only by deleting more data (i.e., increasing T0)T_{0} ) or extending the length of each run (i.e., increasing TE)T_{E} ) Thus, increasing the number of replications R could produce shorter confidence intervals around the “wrong point.” Therefore, it is important to do a thorough job of investigating the initial-condition bias.

If the simulation analyst decides to delete d observations of the total of n observations in a replication, then the point estimator of θ is

Yˉ⋅⋅(n,d)=1R∑r=1R1n−d∑j=d+1nYrj(29) \bar {Y} _ {\cdot \cdot} (n, d) = \frac {1}{R} \sum_{r = 1} ^ {R} \frac {1}{n - d} \sum_{j = d + 1} ^ {n} Y_{r j}\tag{29}

That is, the point estimator is the average of the remaining data. The basic raw output data {Yrj,r=\{Y_{r j} , r =1,…,R;j=1,…,n}1 , \dots , R ; j = 1 , \dots , n \} are exhibited in Table 4. For instance,YrjY_{r j} could be the delay of customer j in queue, or the response time of job j in a job shop, on replication r. The number d of deleted observations and the total number of observations n might vary from one replication to the next, in which case replace d by drd_{r} and n by nr.n_{r} .. For simplicity, assume that d and n are constant over replications.

Table 4 Raw Output Data from a Steady-State Simulation

ReplicationObservationsReplication Averages
1⋯\cdotsdd+1d+1⋯\cdotsn
1Y1,1Y_{1,1}⋯\cdotsY1,dY_{1,d}Y1,d+1Y_{1,d+1}⋯\cdotsY1,nY_{1,n}Yˉ1.(n,d)\bar{Y}_{1}.(n,d)
2Y2,1Y_{2,1}⋯\cdotsY2,dY_{2,d}Y2,d+1Y_{2,d+1}⋯\cdotsY2,nY_{2,n}Yˉ2.(n,d)\bar{Y}_{2}.(n,d)
......
......
......
RYR,1Y_{R,1}⋯\cdotsYR,dY_{R,d}YR,d+1Y_{R,d+1}⋯\cdotsYR,nY_{R,n}YˉR.(n,d)\bar{Y}_{R}.(n,d)
Yˉ.1\bar{Y}_{.1}⋯\cdotsYˉ.d\bar{Y}_{.d}Yˉ.,d+1\bar{Y}_{.,d+1}⋯\cdotsYˉ.n\bar{Y}_{.n}Yˉ..(n,d)\bar{Y}_{..}(n,d)

When using the replication method, each replication is regarded as a single sample for the purpose of estimating θ. For replication r,r , define

Yˉr.(n,d)=1n−d∑j=d+1nYrj(30) \bar {Y} _ {r.} (n, d) = \frac {1}{n - d} \sum_{j = d + 1} ^ {n} Y_{r j}\tag{30}

as the sample mean of all (nondeleted) observations in replication r. Because all replications use different random-number streams and all are initialized at time 0 by the same set of initial conditions I0,I_{0} ,, the replication averages

Yˉ1.(n,d),…,YˉR.(n,d) \bar {Y} _ {1.} (n, d), \dots , \bar {Y} _ {R.} (n, d)

are independent and identically distributed random variables; that is, they constitute a random sample from some underlying population having unknown mean

θn,d=E⁡[Yˉr.(n,d)](31) \theta_{n, d} = \operatorname{E} [ \bar {Y} _ {r.} (n, d) ]\tag{31}

The overall point estimator, given in Equation (29), is also given by

Yˉ⋅⋅(n,d)=1R∑r=1RYˉr⋅(n,d)(32) \bar {Y} _ {\cdot \cdot} (n, d) = \frac {1}{R} \sum_{r = 1} ^ {R} \bar {Y} _ {r \cdot} (n, d)\tag{32}

as can be seen from Table 4 or from using Equation (21). Thus, it follows that

E⁡[Yˉ..(n,d)]=θn,d \operatorname{E} [ \bar {Y}.. (n, d) ] = \theta_{n, d}

also. If d and n are chosen sufficiently large, then θn,d≈θ\theta_{n , d} \approx \theta, and Yˉ⋅⋅(n,d){\bar {Y}} _ {\cdot \cdot} ( n , d ) is an approximately unbiased estimator of θ. The bias in Yˉ⋅⋅(n,d){\bar {Y}} _ {\cdot \cdot} ( n , d ) is θn,d−θ\theta_{n , d} - \theta For convenience, when the value of n and d are understood, abbreviate Yˉr.(n,d)\bar {Y} _ {r} . ( n , d )(the mean of the undeleted observations from the rth replication) and Yˉ⋅⋅(n,d){\bar {Y}} _ {\cdot \cdot} ( n , d )[the mean of Yˉ1⋅(n,d),…,YˉR⋅(n,d)]\bar {Y} _ {1 \cdot} ( n , d ) , \dots , \bar {Y} _ {R \cdot} ( n , d ) ] by Yˉr.{\bar {Y}} _ {r} . and Yˉ.{\bar {Y}} ., respectively. To estimate the standard error of Yˉ..{\bar {Y}} . ., first compute the sample variance,

S2=1R−1∑r=1R(Yˉr.−Yˉ..)2=1R−1(∑r=1RYˉr.2−RYˉ..2)(33) S^{2} = \frac {1}{R - 1} \sum_{r = 1} ^ {R} (\bar {Y} _ {r.} - \bar {Y} _ {..}) ^ {2} = \frac {1}{R - 1} \left(\sum_{r = 1} ^ {R} \bar {Y} _ {r.} ^ {2} - R \bar {Y} _ {..} ^ {2}\right)\tag{33}

The standard error of Yˉ.{\bar {Y}} . is given by

s.e.(Yˉ⋅⋅)=SR(34) \mathrm{s.e.} (\bar {Y} _ {\cdot \cdot}) = \frac {S}{\sqrt {R}}\tag{34}

A 100(1−α)%100 ( 1 - \alpha ) \% confidence interval for θ,\theta ,, based on the t distribution, is given by

Yˉ⋅⋅−tα/2,R−1SR≤θ≤Yˉ⋅⋅+tα/2,R−1SR(35) \bar {Y} _ {\cdot \cdot} - t_{\alpha / 2, R - 1} \frac {S}{\sqrt {R}} \leq \theta \leq \bar {Y} _ {\cdot \cdot} + t_{\alpha / 2, R - 1} \frac {S}{\sqrt {R}}\tag{35}

where tα/2,R−1t_{\alpha / 2 , R - 1} is the 100(1−α/2)100 ( 1 - \alpha / 2 ) percentage point of a t distribution with R−1R - 1 degrees of freedom. This confidence interval is valid only if the bias of Yˉ.{\bar {Y}} . is approximately zero.

As a rough rule, the length of each replication, beyond the deletion point, should be at least ten times the amount of data deleted. In other words,(n−d)( n - d ) should at least 10d (or more generally,TET_{E} should be at least 10T0)10 T_{0} ). Given this run length, the number of replications should be as many as time permits, up to about 25 replications. Kelton [1986] established that there is little value in dividing the available time into more than 25 replications, so, if time permits making more than 25 replications of length T0+10T0T_{0} + 10 T_{0}, then make 25 replications of longer than T0+10T0.T_{0} + 10 T_{0} \mathrm{.}, instead. Again, these are rough rules that need not be followed slavishly.

In this section we have presented results as if the run length is n observations and d of them are deleted. As discussed earlier, in practice we make a run of length T0+TET_{0} + T_{E} time units and delete the first T0T_{0} time units. In this case dd becomes the number of observations obtained up to time T0,T_{0} , and n−dn - d is the number of observations recorded between times T0T_{0} and TE+T0,T_{E} + T_{0} ,, both random variables that typically differ from replication to replication. In the following example we will use (T0+TE,T0)( T_{0} + T_{E} , T_{0} ) instead of (n,d)( n , d ) in the notation to make this point clear.

Example 15

Consider again the FastChip wafer fab simulation of Examples 8 and 14. Suppose that the simulation analyst decides to make R=10R = 10 replications, each of length T0+TE=2200T_{0} + T_{E} = 2200 hours, deleting the first T0=200T_{0} = 200 hours before data collection, begins as determined in Example 14. Remember that the raw output data consist of cycle times for Chip-C cassettes, and the output from each replication is the average of all of the Chip-C cassettes that finish between times T0=200T_{0} = 200 hours and T0+TE=2200T_{0} + T_{E} = 2200 hours (approximately 2000×60%=12002000 \times 60 \% = 1200 cycle times per replication). The purpose of the simulation is to estimate the long-run average cycle time, denoted w,w ,, and to measure the error of the estimate by a 95% confidence interval.

Table 5 Data Summary for FastChip Simulation by Replication

Replication rSample Mean for Replication r
146.86
246.09
347.64
447.43
546.94
646.43
747.11
846.56
946.73
1046.80
Yˉ..\bar{Y}_{..}46.86
S0.46

The replication averages Yˉr⋅(T0+TE,T0),r=1,2,…,10\bar {Y} _ {r \cdot} ( T_{0} + T_{E} , T_{0} ) , r = 1 , 2 , \ldots , 10, are shown in Table 5. The poin estimator is computed by Equation (32) as

Yˉ⋅⋅(T0+TE,T0)=46.86 \bar {Y} _ {\cdot \cdot} (T_{0} + T_{E}, T_{0}) = 46. 86

Its standard error is given by Equation (34) as

s.e.(Yˉ..T0+TE,T0))=SR=0.15 \text{s.e.} (\bar {Y}.. T_{0} + T_{E}, T_{0})) = \frac {S}{\sqrt {R}} = 0. 15

and using α=0.05\alpha = 0 . 05 and t0.025,9=2.26t_{0 . 025 , 9} = 2 . 26, the 95% confidence interval for long-run mean queue length is given by Inequality (35) a

46.86−2.26(0.15)≤w≤46.86+2.26(0.15) 46. 86 - 2. 26 (0. 15) \leq w \leq 46. 86 + 2. 26 (0. 15)

or

46.52≤w≤47.20 46. 52 \leq w \leq 47. 20

The simulation analyst may conclude with a high degree of confidence that the long-run mean cycle time for Chip-C is between 46.52 and 47.20 hours. The confidence interval computed here as given by Inequality (35) should be used with caution, because a key assumption behind its validity is tha enough data have been deleted to remove any significant bias due to initial conditions—that is, that T0T_{0} and TE+T0T_{E} + T_{0} are sufficiently large so that the bias θTE+T0,T0−θ\theta _ {T_{E} + T_{0} , T_{0}} - \theta is negligible.

5.4 Sample Size in Steady-State Simulations

Suppose it is desired to estimate a long-run performance measure θ within , with confidence 100(1−α)%100 ( 1 - \alpha ) \%. In a steady-state simulation, a specified precision may be achieved either by increasing the number of replications R or by increasing the run length TET_{E}. The first solution, controlling R, is carried out as given in Section 4.2 for terminating simulations.

Example 16

Consider the data in Table 5 for the FastChip wafer fab simulation as an initial sample of size R0=10R_{0} = 10 The initial estimate of standard deviation is S0=0.46S_{0} = 0 . 46 hours. Suppose that it is desired to estimate long-run mean cycle time of Chip-C, w, to within ϵ=0.\epsilon = 0 .1 hours (6 minutes) with 95% confidence. Using α=0.05\alpha = 0 . 05 in Inequality (16) yields an initial estimate of

R≥(z0.025S0ϵ)2=((1.96)(0.46)0.1)2=81.3 R \geq \left(\frac {z_{0 . 025} S_{0}}{\epsilon}\right) ^ {2} = \left(\frac {(1 . 96) (0 . 46)}{0 . 1}\right) ^ {2} = 81. 3

Thus, at least 82 replications will be needed.

An alternative to increasing R is to increase total run length T0+TET_{0} + T_{E} within each replication. If the calculations in Section 4.2, as illustrated in Example 16, indicate tha R−R0R - R_{0} additional replications are needed beyond the initial number R0.R_{0} ., then an alternative is to increase run length (T0+TE)( T_{0} + T_{E} ) in the same proportion (R/R0)( R / R_{0} ) to a new run length (R/R0)(T0+TE)( R / R_{0} ) ( T_{0} + T_{E} ). Thus, additional data will be deleted, from time 0 to time (R/R0)T0,( R / R_{0} ) T_{0} ,, and more data will be used to compute the point estimates, as illustrated by Figure 9. However, the total amount of simulation effort is the same as if we had simply increased the number of replications but maintained the same run length. The advantage of increasing total run length per replication and deleting a fixed proportion [T0/(T0+TE)][ T_{0} / ( T_{0} + T_{E} ) ] of the tota run length is that any residual bias in the point estimator should be further reduced by the additiona deletion of data at the beginning of the run. A possible disadvantage of the method is that, in order to continue the simulation of all R replications [from time T0+TET_{0} + T_{E} to time (R/R0)(T0+TE)]( R / R_{0} ) ( T_{0} + T_{E} ) ]], it is

Figure 9 Increasing run length to achieve specified accuracy.

necessary to have saved the state of the model at time T0+TET_{0} + T_{E} and to be able to restart the mode and run it for the additional required time. Otherwise, the simulations would have to be rerun from time 0, which could be time consuming for a complex model. Some simulation languages have the capability to save enough information that a replication can be continued from time TET_{E} onward, rather than having to start over from time 0.

Example 17

In Example 16,^ {16 ,} suppose that run length was to be increased to achieve the desired error 0.1 hours. Since R/R0=82/10=8.2R / R_{0} = 82 / 10 = 8 . 2, the run length should be (R/R0)(T0+TE)=8.2(2200)=18,040( R / R_{0} ) ( T_{0} + T_{E} ) = 8 . 2 ( 2200 ) = 18 , 040 hours. The data collected from time 0 to time (R/R0)T0=8.2(200)=1640( R / R_{0} ) T_{0} = 8 . 2 ( 200 ) = 1640 hours would be deleted, and the data from time 1640 to time 18,040 used to compute new point estimates and confidence intervals.

5.5 Batch Means Method for Steady-State Simulations

One disadvantage of the replication method is that data must be deleted on each replication and, in one sense, deleted data are wasted data, or at least lost information. This suggests that there might be merit in using an experiment design that is based on a single, long replication. The disadvantage of a single-replication design arises when we try to compute the standard error of the sample mean. Since we only have data from within one replication, the data are dependent, and the usual estimator is biased.

The method of batch means attempts to solve this problem by dividing the output data from one replication (after appropriate deletion) into a few large batches and then treating the means of these batches as if they were independent. When the raw output data after deletion form a continuous-time process {Y(t),T0≤t≤T0+TE}\{Y ( t ) , T_{0} \leq t \leq T_{0} + T_{E} \}, such as the length of a queue or the level of inventory, then we form k batches of size m=TE/km = T_{E} / k and compute the batch means as

Yˉj=1m∫(j−1)mjmY(t+T0)dt \bar {Y} _ {j} = \frac {1}{m} \int_{(j - 1) m} ^ {j m} Y (t + T_{0}) d t

forj=1,2,…,k\mathrm{f o r} j = 1 , 2 , \dots , k. In other words, thejth batch mean isjust the time-weighted average of the process over the time interval [T0+(j−1)m,T0+jm)[ T_{0} + ( j - 1 ) m , T_{0} + j m ).

When the raw output data after deletion form a discrete-time process {Yi,i=d+1,d+2,…,n}\{Y_{i} , i = d + 1 , d + 2 , \dots , n \} such as the customer delays in a queue or the cost per period of an inventory system, then we form k batches of size m=(n−d)/km = ( n - d ) / k and compute the batch means as

Yˉj=1m∑i=(j−1)m+1jmYi+d \bar {Y} _ {j} = \frac {1}{m} \sum_{i = (j - 1) m + 1} ^ {j m} Y_{i + d}

for j=1,2,…,kj = 1 , 2 , \dots , k(assuming k divides n−dn - d evenly, otherwise round down to the nearest integer). That is the batch means are formed as shown here

Y1,…,Yd⏟deleted,Yd+1,…,Yd+m⏟Yˉ1,Yd+m+1,…,Yd+2m⏟Yˉ2,…,Yd+(k−1)m+1,…,Yd+km⏟Yˉk \underbrace {Y_{1} , \ldots , Y_{d}} _ {\text{deleted}}, \underbrace {Y_{d + 1} , \ldots , Y_{d + m}} _ {\bar {Y} _ {1}}, \underbrace {Y_{d + m + 1} , \ldots , Y_{d + 2 m}} _ {\bar {Y} _ {2}}, \ldots , \underbrace {Y_{d + (k - 1) m + 1} , \ldots , Y_{d + k m}} _ {\bar {Y} _ {k}}

Starting with either continuous-time or discrete-time data, the variance of the sample mean is estimated by

S2k=1k∑j=1k(Yˉj−Yˉ)2k−1=∑j=1kYˉj2−kYˉ2k(k−1)(36) \frac {S^{2}}{k} = \frac {1}{k} \sum_{j = 1} ^ {k} \frac {(\bar {Y} _ {j} - \bar {Y}) ^ {2}}{k - 1} = \frac {\sum_{j = 1} ^ {k} \bar {Y} _ {j} ^ {2} - k \bar {Y} ^ {2}}{k (k - 1)}\tag{36}

where Yˉ\bar {Y} is the overall sample mean of the data after deletion. The batch means Yˉ1,Yˉ2,…,Yˉk{\bar {Y}} _ {1} , {\bar {Y}} _ {2} , \dots , {\bar {Y}} _ {k} are not independent; however, if the batch size is sufficiently large, successive batch means will be approximately independent, and the variance estimator will be approximately unbiased.

Unfortunately, there is no widely accepted and relatively simple method for choosing an acceptable batch size m (or equivalently, choosing a number of batches k)k ). But there are some genera guidelines that can be culled from the research literature:

a. Schmeiser [1982] found that, for a fixed total sample size, there is little benefit from dividing it into more than k 30 batches, even if we could do so and still retain independence between the batch means. Therefore, there is no reason to consider numbers of batches much greater than 30, no matter how much raw data are available. He also found that the performance of the confidence interval, in terms of its width and the variability of its width, is poor for fewer than 10 batches. Therefore, a number of batches between 10 and 30 should be used in mos applications.

b. Although there is typically autocorrelation between batch means at all lags, the lag-1 autocorrelation ρ1=corr⁡(Yˉj,Yˉj+1)\rho_{1} = \operatorname{c o r r} ( \bar {Y} _ {j} , \bar {Y} _ {j + 1} ) is usually studied to assess the dependence between batch means. When the lag-1 autocorrelation is nearly 0, then the batch means are treated as independent. This approach is based on the observation that the autocorrelation in many stochastic processes decreases as the lag increases. Therefore, all lag autocorrelations should be smaller, in absolute value, than the lag-1 autocorrelation.

c. The lag-1 autocorrelation between batch means can be estimated (see below). However, the autocorrelation should not be estimated from a small number of batch means (such as the 10≤k≤3010 \leq k \leq 30 recommended above); there is bias in the autocorrelation estimator. Law and Carson [1979] suggest estimating the lag-1 autocorrelation from a large number of batch means based on a smaller batch size, perhaps 100≤k≤400100 \leq k \leq 400. When the autocorrelation between these batch means is approximately 0, then the autocorrelation will be even smaller if we rebatch the data to between 10 and 30 batch means based on a larger batch size. Hypothesis tests for 0 autocorrelation are available, as described next.

d. If the total sample size is to be chosen sequentially, say to attain a specified precision, then it is helpful to allow the batch size and number of batches to grow as the run length increases. I can be shown that a good strategy is to allow the number of batches to increase as the square root of the sample size after first finding a batch size at which the lag-1 autocorrelation is approximately 0. Although we will not discuss this point further, an algorithm based on it can be found in Fishman and Yarberry [1997]; see also Steiger and Wilson [2002] and Lada, Steiger, and Wilson [2006].

Given these insights, we recommend the following general strategy:

  1. Obtain output data from a single replication and delete as appropriate. Recall our guideline: collecting at least 10 times as much data as are deleted.

  2. Form up to k=400k = 400 batches (but at least 100 batches) with the retained data, and compute the batch means. Estimate the sample lag-1 autocorrelation of the batch means as

ρ^1=∑j=1k−1(Yˉj−Yˉ)(Yˉj+1−Yˉ)∑j=1k(Yˉj−Yˉ)2 \widehat {\rho} _ {1} = \frac {\sum_{j = 1} ^ {k - 1} (\bar {Y} _ {j} - \bar {Y}) (\bar {Y} _ {j + 1} - \bar {Y})}{\sum_{j = 1} ^ {k} (\bar {Y} _ {j} - \bar {Y}) ^ {2}}
  1. Check the correlation to see whether it is sufficiently small.

(a) If ρ^1≤0.2\widehat {\rho} _ {1} \leq 0 . 2, then rebatch the data into 30≤k≤4030 \leq k \leq 40 batches, and form a confidence -interval using k−1k - 1 degrees of freedom for the t distribution and Equation (36) to estimate the variance of Yˉ˘\breve {\bar {Y}}.

(b) If ρ^1>0.2\widehat {\rho} _ {1} > 0 . 2, then extend the replication by 50% to 100% and go to Step 2. If it is -not possible to extend the replication, then rebatch the data into approximately k=10k = 10 batches, and form the confidence interval, using k−1k - 1 degrees of freedom for the t distribution and Equation (36) to estimate the variance of Yˉ.{\bar {Y}} .4. As an additional check on the confidence interval, examine the batch means (at the larger or smaller batch size) for independence, using the following test. See, for instance, Alexopoulos and Seila [1998]. Compute the test statistic

C=k2−1k−2(ρ1^+(Yˉ1−Yˉ)2+(Yˉk−Yˉ)22∑j=1k(Yˉj−Yˉ)2) C = \sqrt {\frac {k^{2} - 1}{k - 2}} \left(\widehat {\rho_{1}} + \frac {(\bar {Y} _ {1} - \bar {Y}) ^ {2} + (\bar {Y} _ {k} - \bar {Y}) ^ {2}}{2 \sum_{j = 1} ^ {k} (\bar {Y} _ {j} - \bar {Y}) ^ {2}}\right)

If C < zβC \ < \ z_{\beta} then accept the independence of the batch means, where β\beta is the Type I error level of the test, such as 0.1, 0.05, 0.01. Otherwise, extend the replication by 50% to 100% and go to Step 2. If it is not possible to extend the replication, then rebatch the data into approximately k=10k = 10 batches, and form the confidence interval, using k−1k - 1 degrees of freedom for the t distribution and Equation (36) to estimate the variance of Y.

This procedure, including the final check, is conservative in several respects. First, if the lag-1 autocorrelation is substantially negative then we proceed to form the confidence interval anyway. A dominant negative correlation tends to make the confidence interval wider than necessary, which is an error, but not one that will cause us to make incorrect decisions. The requirement that ρ^1<0.2\widehat {\rho} _ {1} < 0 . 2 at 100≤k≤400100 \leq k \leq 400-batches is pretty stringent and will tend to force us to get more data (and therefore create larger batches) if there is any hint of positive dependence. And finally, the hypothesis test at the end has a probability of β\beta of forcing us to get more data when none are really needed. But this conservatism is by design; the cost of an incorrect decision is typically much greater than the cos of some additional computer run time.

The batch-means approach to confidence-interval estimation is illustrated in the next example.

Example 18

Reconsider the FastChip wafer fab simulation of Example 8. Suppose that we want to estimate the steady-state mean cycle time for Chip-C, w, by a 95% confidence interval. To illustrate the method of batch means, assume that one run of the model has been made, simulating 5000 cycle times after the deletion point. We then form batch means from k=100k = 100 batches of size m=50m = 50 and estimate the lag-1 autocorrelation to be ρ^1=0.37>0.2\widehat {\rho} _ {1} = 0 . 37 > 0 . 2. Thus, we decide to extend the simulation to 10,000 customers after the deletion point, and again we estimate the lag-1 autocorrelation. This estimate, based on k=100k = 100 batches of size m=100m = 100, is ρ1^=0.15<0.2\widehat {\rho_{1}} = 0 . 15 < 0 . 2 Having passed the correlation check, we rebatch the data into k=40k = 40 batches of size m=250m = 250 The point estimate is the overall mean

Yˉ=110000∑j=110000Yˉj=47.00hours. \bar {Y} = \frac {1}{10000} \sum_{j = 1} ^ {10000} \bar {Y} _ {j} = 47. 00 \text{hours.}

The variance of Yˉ,{\bar {Y}} , computed from the 40 batch means, is

S2k=∑j=140Yˉj2−40Yˉ240(39)=0.049 \frac {S^{2}}{k} = \frac {\sum_{j = 1} ^ {40} \bar {Y} _ {j} ^ {2} - 40 \bar {Y} ^ {2}}{40 (39)} = 0. 049

Thus, a 95% confidence interval is given by

Yˉ−t0.025,390.049≤w≤Yˉ+t0.025,390.049 \bar {Y} - t_{0. 025, 39} \sqrt {0 . 049} \leq w \leq \bar {Y} + t_{0. 025, 39} \sqrt {0 . 049}

or

46.55=47.00−2.02(0.221)≤w≤47.00+2.02(0.221)=47.45 46. 55 = 47. 00 - 2. 02 (0. 221) \leq w \leq 47. 00 + 2. 02 (0. 221) = 47. 45

Thus, we assert with 95% confidence that true mean cycle time w is between 46.55 and 47.45 hours. If these results are not sufficiently precise, then the run length should be increased to achieve greater precision.

As a further check on the validity of the confidence interval, we can apply the correlation hypothesis test. To do so, we compute the test statistic from the k=40k = 40 batches of size m=250m = 250 used to form the confidence interval. This gives

C=−0.58<1.96=z0.05 C = - 0. 58 < 1. 96 = z_{0. 05}

which confirms the lack of correlation at the 0.05 significance level. Notice that, at this small number of batches, the estimated lag-1 autocorrelation appears to be slightly negative, illustrating our poin about the difficulty of estimating correlation with small numbers of observations.

5.6 Steady-State Quantiles

Constructing confidence intervals for quantile estimates in a steady-state simulation can be tricky, especially if the output process of interest is a continuous-time process, such as LQ(t)L_{Q} ( t )), the number of customers in queue at time t. In this section, we outline the main issues.

Taking the easier case first, suppose that the output process from a single replication, after appropriate deletion of initial data, is Yd+1,…,Yn.Y_{d + 1} , \dots , Y_{n} .. To be concrete,YiY_{i} might be the delay in queue of the ith customer. Then the point estimate of the pth quantile can be obtained as before, either from the histogram of the data or from the sorted values. Of course, only the data after the deletion point are used. Suppose we make RR replications and let θr^\widehat {\theta_{r}} be the quantile estimate from the rth. Then the R quantile estimates,θ1^,…,θR^\widehat {\theta_{1}} , \ldots , \widehat {\theta_{R}}-, are independent and identically distributed. Their average is

θ.^=1R∑i=1Rθi^ \widehat {\theta .} = \frac {1}{R} \sum_{i = 1} ^ {R} \widehat {\theta_{i}}

It can be used as the point estimator of θ;\theta ; and an approximate confidence interval is

θ^.±tα/2,R−1SR \widehat {\theta}. \pm t_{\alpha / 2, R - 1} \frac {S}{\sqrt {R}}

where S2S^{2} is the usual sample variance of θ1^,…,θR^\widehat {\theta_{1}} , \ldots , \widehat {\theta_{R}}- -What if only a single replication is obtained? Then the same reasoning applies if we let θi^\widehat {\theta_{i}} be -the quantile estimate from within the ith batch of data. This requires sorting the data or forming a histogram within each batch. If the batches are large enough, then these within-batch quantile estimates will also be approximately i.i.d.

When we have a continuous-time output process, then, in principle, the same methods apply. However, we must be careful not to transform the data in a way that changes the problem. In particular, we cannot first form batch means, as we have done throughout this chapter, and then estimate the quantile from these batch means. The p quantile of the batch means of LQ(t)L_{Q} ( t ) is not the same as the p quantile of LQ(t)L_{Q} ( t ) itself. Thus, the quantile point estimate must be formed from the histogram of the raw data, either from each run, if we make replications, or within each batch, if we make a single replication.

6 Summary

This chapter emphasized the idea that a stochastic discrete-event simulation is a statistical experiment. Therefore, before sound conclusions can be drawn on the basis of the simulation-generated output data, a proper statistical analysis is required. The purpose of the simulation experiment is to obtain estimates of the performance measures of the system under study. The purpose of the statistica analysis is to acquire some assurance that these estimates are sufficiently precise for the proposed use of the model.

A distinction was made between terminating simulations and steady-state simulations. Steadystate simulation output data are more difficult to analyze, because the simulation analyst must address the problem of initial conditions and the choice of run length. Some suggestions were given regarding these problems, but unfortunately no simple, complete, and satisfactory solution exists. Nevertheless, simulation analysts should be aware of the potential problems, and of the possible solutions—namely, deletion of data and increasing of the run length. More advanced statistical techniques (not discussed in this text) are given in Alexopoulos and Seila [1998], Bratley, Fox, and Schrage [1996], and Law [2007].

The statistical precision of point estimators can be measured by a standard-error estimate or by a confidence interval. The method of independent replications was emphasized. With this method, the simulation analyst generates statistically independent observations, and thus standard statistical methods can be employed. For steady-state simulations, the method of batch means was also discussed.

The main point is that simulation output data contain some amount ofrandom variability; withou some assessment of its size, the point estimates cannot be used with any degree of reliability.

REFERENCES

ALEXOPOULOS, C.,ANDA. F. SEILA [1998], “Output DataAnalysis,” Chapter 7 in Handbook ofSimulation, J. Banks, ed., Wiley, New York.

BRATLEY, P., B. L. FOX, AND L. E. SCHRAGE [1996], A Guide to Simulation, 2d ed., Springer-Verlag, New York.

FISHMAN, G. S.,AND L. S.YARBERRY [1997], “An Implementation ofthe Batch Means Method,” INFORMS Journal on Computing, Vol. 9, pp. 296–310.

GOLDSMAN, D., L. SCHRUBEN, AND J. J. SWAIN [1994], “Tests for Transient Means in Simulated Time Series,” Naval Research Logistics, Vol. 41, pp. 171–187.

KELTON, W. D. [1986], “Replication Splitting and Variance for Simulating Discrete-Parameter Stochastic Processes,” Operations Research Letters, Vol. 4, pp. 275–279.

KELTON, W. D. [1989], “Random Initialization Methods in Simulation,” IIETransactions,Vol. 21, pp. 355–367.

KELTON, W. D., AND A. M. LAW [1983], “A New Approach for Dealing with the Startup Problem in Discrete Event Simulation,” Naval Research Logistics Quarterly, Vol. 30, pp. 641–658.

KLEIJNEN, J. P. C. [1987], Statistical Toolsfor Simulation Practitioners, Dekker, New York.

LADA, E. K., N. M. Steiger, AND J. R. WILSON [2006], “Performance Evaluation of Recent Procedures for Steady-state Simulation Analysis,” IIE Transactions, Vol. 38, pp. 711-–727.

LAW, A. M. [1977], “Confidence Intervals in Discrete Event Simulation: A Comparison of Replication and Batch Means,” Naval Research Logistics Quarterly, Vol. 24, pp. 667–78.

LAW, A. M. [1980], “Statistical Analysis of the Output Data from Terminating Simulations,” Naval Research Logistics Quarterly, Vol. 27, pp. 131–43.

LAW, A. M. [2007], Simulation Modeling and Analysis, 4th ed., McGraw-Hill, New York.

LAW,A. M.,AND J. S. CARSON [1979], “A Sequential Procedure for Determining the Length of a Steady-State Simulation,” Operations Research, Vol. 27, pp. 1011–1025.

NELSON, B. L. [2001], “Statistical Analysis of Simulation Results,” Chapter 94 in Handbook of Industrial Engineering, 3d ed., G. Salvendy, ed., Wiley, New York.

SCHMEISER, B. [1982], “Batch Size Effects in the Analysis of Simulation Output,” Operations Research, Vol. 30, pp. 556–568.

SCHRUBEN, L. [1982], “Detecting Initialization Bias in Simulation Output,” Operations Research, Vol. 30, pp. 569–590.

SNELL, M., AND L. SCHRUBEN [1985], “Weighting Simulation Data to Reduce Initialization Effects,” IIE Transactions, Vol. 17, pp. 354–363

STEIGER, N. M., AND J. R. Wilson [2002], “An Improved Batch Means Procedure for Simulation Output Analysis,” Management Science, Vol. 48, pp. 1569–1586.

WELCH, P. D. [1983], “The StatisticalAnalysis ofSimulation Results,” in The Computer Performance Modeling Handbook, S. Lavenberg, ed., Academic Press, New York, pp. 268–328.

Estimation of Absolute Performance

EXERCISES

  1. For each of the systems described below, under what circumstances would it be appropriate to use a terminating simulation versus a steady-state simulation to analyze this system?

(a) A walk-in medical clinic simulated to determine staffing levels.

(b) A portfolio of stocks, bonds, and derivative securities simulated to estimate long-run return.

(c) A fuel injector assembly plant that runs two shifts per day simulated to estimate throughput.

(d) The United States air traffic control system simulated to evaluate safety.

  1. Suppose that the output process from a queueing simulation is L(t),0≤t≤TL ( t ) , 0 \leq t \leq T, the total number in queue at time t. A continuous-time output process can be converted into the sort of discretetime process Y1,Y2,…Y_{1} , Y_{2} , \ldots. described in this chapter by first forming k=T/mk = T / m batch means of size m time units:
Yj=1m∫(j−1)mjmL(t)dt Y_{j} = \frac {1}{m} \int_{(j - 1) m} ^ {j m} L (t) d t

for j=1,2,…,kj = 1 , 2 , \dots , k. Ensemble averages of these batch means can be plotted to check for initialcondition bias.

(a) Show algebraically that the batch mean over 2m time units can be obtained by averaging two adjacent batch means over m time units. [Hint: This implies that we can start with batch means over rather small time intervals m and build up batch means over longer intervals without reanalyzing all of the data.]

(b) Simulate an M/M/1M / M / 1 queue with λ=1\lambda = 1 and μ=1.25\mu = 1 . 25 for a run length of 4000 time units, computing batch means of the total number in queue with batch size m=4m = 4 time units. Make replications and use a mean plot to determine an appropriate number of batches to delete. Convert this number of batches to delete into a deletion time.

  1. Using the results of Exercise 2 above, design and execute an experiment to estimate the steadystate expected number in this M/M/1M / M / 1 queue, L, to within ±0.5\pm 0 . 5 customers with 95% confidence. Check your estimate against the true value of L=λ/(μ−λ)L = \lambda / ( \mu - \lambda )).

  2. In Example 7, suppose that management desired a 95% confidence interval on the estimate of mean cycle time and that the error allowed was ϵ=0.05\epsilon = 0 . 05 hours (3 minutes). Using the same initial data given in Table 5, estimate the required total sample size. Although we cut the error in half, by how much did the required sample size increase?

  3. Again, simulate an M/M/1M / M / 1 queue with λ=1\lambda = 1 and μ=1.25\mu = 1 . 25, this time recording customer time in system (from arrival to departure) as the performance measure for 4000 customers. Make replications and use a mean plot to determine an appropriate number of customers to delete when starting the system empty, with 4 customers initially in the system, and with 8 customers initially in the system. How does the warmup period change with these different initial conditions? What does this suggest about how to initialize simulations?

  4. Consider an (M, L) inventory system, in which the procurement quantity Q is defined by

Q={M−IifI<L0ifI≥L Q = \left\{\begin{array}{l l} M - I & \text{if} I < L \\ 0 & \text{if} I \geq L \end{array} \right.

where I is the level of inventory on hand plus on order at the end of a month, M is the maximum inventory level, and L is the reorder point. M and L are under management control, so the pair (M, L) is called the inventory policy. Under certain conditions, the analytical solution of such a model is possible, but not always. Use simulation to investigate an (M,L)( M , L ) inventory system with the following properties: The inventory status is checked at the end of each month. Backordering is allowed at a cost of $4 per item short per month. When an order arrives, it will first be used to relieve the backorder. The lead time is given by a uniform distribution on the interval [0.25, 1.25] months. Let the beginning inventory level stand at 50 units, with no orders outstanding. Let the holding cost be $1 per unit in inventory per month. Assume that the inventory position is reviewed each month. If an order is placed, its cost is $60 $5Q, where $60 is the ordering cos and $5 is the cost of each item. The time between demands is exponentially distributed with a mean of 1/15 month. The sizes of the demands follow this distribution:

DemandProbability
11/2
21/4
31/8
41/8

(a) Make ten independent replications, each of run length 100 months preceded by a 12-month initialization period, for the (M, L) (50, 30) policy. Estimate long-run mean monthly cos with a 90% confidence interval.

(b) Using the results of part (a). estimate the total number of replications needed to estimate mean monthly cost within $5.

  1. Reconsider Exercise 6, except that, if the inventory level at a monthly review is zero or negative, a rush order for QQ units is placed. The cost for a rush order is $120+5120\$120+5120, where $120 is the ordering cost and $12 is the cost of each item. The lead time for a rush order is given by a uniform distribution on the interval [0.10, 0.25] months.

(a) Make ten independent replications for the (M, L) policy, and estimate long-run mean monthly cost with a 90% confidence interval.

(b) Using the results of part (a). estimate the total number of replications needed to estimate mean monthly cost within $5.

  1. Suppose that the items in Exercise 6 are perishable, with a selling price given by the following data:
On the Shelf (months)Selling Price
0-1$10
1-25
>20

Thus, any item that has been on the shelf more than 2 months cannot be sold. The age is measured at the time the demand occurs. If an item is outdated, it is discarded, and the next item is brough forward. Simulate the system for 100 months.

(a) Make ten independent replications for the (M, L) (50, 30) policy, and estimate long-run mean monthly cost with a 90% confidence interval.

(b) Using the results of part (a), estimate the total number of replications needed to estimate mean monthly cost within $5.

At first, assume that all the items in the beginning inventory are fresh. Is this a good assumption? What effect does this “all-fresh” assumption have on the estimates of long-run mean monthly cost? What can be done to improve these estimates? Carry out a complete analysis.

  1. Consider the following inventory system:

(a) Whenever the inventory level falls to or below 10 units, an order is placed. Only one order can be outstanding at a time.

(b) The size of each order is Q. Maintaining an inventory costs $0.50 per day per item in inventory. Placing an order incurs a fixed cost of $10.00.

(c) Lead time is distributed in accordance with a discrete uniform distribution between zero and 5 days.

(d) If a demand occurs during a period when the inventory level is zero, the sale is lost at a cost of $2.00 per unit.

(e) The number of customers each day is given by the following distribution:

Number of Customers per DayProbability
10.23
20.41
30.22
40.14

(f) The demand on the part of each customer is Poisson distributed with a mean of 3 units.

(g) For simplicity, assume that all demands occur at noon and that all orders are placed immediately thereafter.

Assume further that orders are received at 5:00 P.M., or after the demand that occurred on tha day. Consider the policy having Q 20. Make ten independent replications, each of length 100

days, and compute a 90% confidence interval for long-run mean daily cost. Investigate the effect of initial inventory level and existence of an outstanding order on the estimate of mean daily cost. Begin with an initial inventory of Q 10 and no outstanding orders.

  1. A store selling Mother’s Day cards must decide 6 months in advance on the number of cards to stock. Reordering is not allowed. Cards cost $0.45 and sell for $1.25. Any cards not sold by Mother’s Day go on sale for $0.50 for 2 weeks. However, sales of the remaining cards is probabilistic in nature according to the following distribution:

32% of the time, all cards remaining get sold.

40% of the time, 80% of all cards remaining are sold.

28% of the time, 60% of all cards remaining are sold.

Any cards left after 2 weeks are sold for $0.25. The card-shop owner is not sure how many cards can be sold, but thinks it is somewhere (i.e., uniformly distributed) between 200 and 400. Suppose that the card-shop owner decides to order 300 cards. Estimate the expected total profit with an error of at most $5.00. [Hint: Make ten initial replications. Use these data to estimate the total sample size needed. Each replication consists of one Mother’s Day.]

  1. A very large mining operation has decided to control the inventory of high-pressure piping by a “periodic review, order up to M” policy, where M is a target level. The annual demand for this piping is normally distributed, with mean 600 and variance 800. This demand occurs fairly uniformly over the year. The lead time for resupply is Erlang distributed of order k 2 with its mean at 2 months. The cost of each unit is $400. The inventory carrying charge, as a proportion of item cost on an annual basis, is expected to fluctuate normally about the mean 0.25 (simple interest), with a standard deviation of 0.01. The cost of making a review and placing an order is $200, and the cost of a backorder is estimated to be $100 per unit backordered. Suppose that the inventory level is reviewed every 2 months, and let M 337.

(a) Make ten independent replications, each of run length 100 months, to estimate long-run mean monthly cost by means of a 90% confidence interval.

(b) Investigate the effects of initial conditions. Calculate an appropriate number of monthly observations to delete, in order to reduce initialization bias to a negligible level.

  1. Consider some number, say N, ofM/M/1 queues in series. The M/M/1 queue has Poisson arrivals at some rate λ customers per hour, exponentially distributed service times with mean 1/µ, and a single server. (Recall that “Poisson arrivals” means that interarrival times are exponentially distributed.) By M/M/1 queues in series, it is meant that, upon completion of service at a given server, a customer joins a waiting line for the next server. The system can be shown as follows:

All service times are exponentially distributed with mean 1/μ,1 / \mu ,, and the capacity of each waiting line is assumed to be unlimited. Assume that λ 8 customers per hour and 1/μ=0.1 / \mu = 0 .1 hour. The measure of performance is response time, which is defined to be the total time a customer is in the system.

(a) By making appropriate simulation runs, compare the initialization bias for N 1 (i.e., one M/M/1 queue) to N=2(i.e.N = 2 ( {\mathrm{i . e .}}, two M/M/1 queues in series). Start each system with all servers idle and no customers present. The purpose of the simulation is to estimate mean response time.

(b) Investigate the initialization bias as a function of N,N , for N=1,2,3,4,N = 1 , 2 , 3 , 4 ,, and 5.

(c) Draw some general conclusions concerning initialization bias for “large” queueing systems when at time 0 the system is assumed to be empty and idle.

  1. Jobs enter a job shop in random fashion according to a Poisson process at a stationary overal rate, two every 8-hour day. The jobs are of four types. They flow from work station to work station in a fixed order, depending on type, as shown below. The proportions of each type are also shown.
TypeFlow through StationsProportion
11, 2, 3, 40.4
21, 3, 40.3
32, 4, 30.2
41, 40.1

Processing times perjob at each station depend on type, but all times are, approximately, normally distributed with mean and s.d. in hours as follows:

TypeStation
1234
1(20, 3)(30, 5)(75, 4)(20, 3)
2(18, 2)(60, 5)(10, 1)
3(20, 2)(50, 8)(10, 1)
4(30, 5)(15, 2)

Station i will have cic_{i} workers,i=1,2,3,i = 1 , 2 , 3 ,4. Each job occupies one worker at a station for the duration of a processing time. All jobs are processed on a first-in–first-out basis, and all queues for waiting jobs are assumed to have unlimited capacity. Simulate the system for 800 hours, preceded by a 200-hour initialization period. Assume that c1=8,c2=8,c3=20,c4=7c_{1} = 8 , c_{2} = 8 , c_{3} = 20 , c_{4} = 7 Based on R=20R = 20 replications, compute a 95% confidence interval for average worker utilization at each of the four stations. Also, compute a 95% confidence interval for mean total response time for each job type, where a total response time is the total time that a job spends in the shop.

  1. Change Exercise 13 to give priority at each station to the jobs by type. Type I jobs have priority over type II, type II over type III, and type III over type IV. Use 800 hours as run length, 200 hours as initialization period, and R=20R = 20 replications. Compute four 95% confidence intervals for mean total response time by type. Also, run the model without priorities and compute the same confidence intervals. Discuss the trade-offs when using first-in-first-out versus a priority system.

  2. Consider a single-server queue with Poisson arrivals at rate λ=10.82\lambda = 10 . 82 per minute and normally distributed service times with mean 5.1 seconds and variance 0.98 seconds^2. It is desired to estimate the mean time in the system for a customer who, upon arrival, finds i other customers in the system; that is, to estimate

wi=E(W∣N=i)fori=0,1,2,… w_{i} = E (W | N = i) \quad \text{for} i = 0, 1, 2, \ldots

where W is a typical system time and N is the number of customers found by an arrival. For example,w0w_{0} is the mean system time for those customers who find the system empty,w1w_{1} is the mean system time for those customers who find one other customer present upon arrival, and so on. The estimate w^i\widehat {w} _ {i} of wiw_{i} will be a sample mean of system times taken over all arrivals who -find i in the system. Plot w^i\widehat {w} _ {i} vs i. Hypothesize and attempt to verify a relation between wiw_{i} and i.

-(a) Simulate for a 10-hour period with empty and idle initial conditions.

(b) Simulate for a 10-hour period after an initialization of one hour. Are there observable differences in the results of (a) and (b)!( \mathsf {b} ) !(c) Repeat parts (a) and (b) with service times exponentially distributed with mean 5.1 seconds.

(d) Repeat parts (a) and (b) with deterministic service times equal to 5.1 seconds.

(e) Find the number of replications needed to estimate w_0,w1,…,w6w_{1} , \ldots , w_{6} with a standard error for each of at most 3 seconds. Repeat parts (a)–(d), but using this number of replications.

  1. At Smalltown U., there is one specialized graphics workstation for student use located across campus from the computer center. At 2:00 A.M. one day, six students arrive at the workstation to complete an assignment. A student uses the workstation for 108 minutes, then leaves to go to the computer center to pick up their graphics output. There is a 25% chance that the run wil be OK and the student will go to sleep. If it is not OK, the student returns to the workstation and waits until it becomes free. The round trip from workstation to computer center and back takes 30±530 \pm 5 minutes. The computer becomes inaccessible at 5:00 A.M. Estimate the probability p that at least five of the six students will finish their assignment in the 3-hour period. First, make R=10R = 10 replications, and compute a 95% confidence interval for p.p . Next, work out the number of replications needed to estimate pp within .02, and make this number of replications. Recompute the 95% confidence interval for p.p .17. Four workers are spaced evenly along a conveyor belt. Items needing processing arrive according to a Poisson process at the rate of 2 per minute. Processing time is exponentially distributed, with mean 1.6 minutes. If a worker becomes idle, then he or she takes the first item to come by on the conveyor. If a worker is busy when an item comes by, that item moves down the conveyor to the next worker, taking 20 seconds between two successive workers. When a worker

finishes processing an item, the item leaves the system. If an item passes by the last worker, i is recirculated on a loop conveyor and will return to the first worker after 5 minutes.

Management is interested in having a balanced workload—that is, management would like worker utilizations to be equal. Let ρi\rho_{i} be the long-run utilization of worker i, and let ρ\rho be the average utilization of all workers. Thus,ρ=(ρ1+ρ2+ρ3+ρ4)/4\rho = ( \rho_{1} + \rho_{2} + \rho_{3} + \rho_{4} ) / 4. According to queueing theory, ρ can be estimated by ρ=λ/cμ.\rho = \lambda / c \mu ., where λ=2\lambda = 2 arrivals per minute,c=4c = 4 servers, and 1/μ=1.61 / \mu = 1 . 6 minutes is the mean service time. Thus,ρ=λ/cμ=(2/4)1.6=0.8;\rho = \lambda / c \mu = ( 2 / 4 ) 1 . 6 = 0 . 8 ; so, on the average, a worker will be busy 80% of the time.

(a) Make 10 independent replications, each of run length 40 hours preceded by a one-hour initialization period. Compute 95% confidence intervals for ρ1\rho_{1} and ρ4\rho_{4}. Draw conclusions concerning workload balance.

(b) Based on the same 10 replications, test the hypothesis H0:ρ1=0.8H_{0} {:} \rho_{1} = 0 . 8 at a level of significance α=0.05\alpha = 0 . 05. If a difference of .05 is important to detect, determine the probability that such a deviation is detected. In addition, if it is desired to detect such a deviation with probability at least 0.9, figure out the sample size needed to do so. [Hint: See any basic statistics textbook for guidance on hypothesis testing.]

(c) Repeat (b) for H0;ρ4=0.8H_{0} ; \rho_{4} = 0 . 8(d) From the results of (a)–(c), draw conclusions for management about the balancing of workloads.

  1. At a small rock quarry, a single power shovel dumps a scoop full of rocks at the loading area approximately every 10 minutes, with the actual time between scoops modeled well as being exponentially distributed, with mean 10 minutes. Three scoops of rocks make a pile; whenever one pile of rocks is completed, the shovel starts a new pile.

The quarry has a single truck that can carry one pile (3 scoops) at a time. It takes approximately 27 minutes for a pile of rocks to be loaded into the truck and for the truck to drive to the processing plant, unload, and return to the loading area. The actual time to do these things altogether is modeled well as being normally distributed, with mean 27 minutes and standard deviation 12 minutes.

When the truck returns to the loading area, it will load and transport another pile if one is waiting to be loaded; otherwise, it stays idle until another pile is ready. For safety reasons, no loading of the truck occurs until a complete pile is waiting.

The quarry operates in this manner for an 8-hour day. We are interested in estimating the utilization of the trucks and the expected number of piles waiting to be transported if an additiona truck is purchased.

  1. Big Bruin, Inc. plans to open a small grocery store in Juneberry, NC. They expect to have two checkout lanes, with one lane being reserved for customers paying with cash. The question they want to answer is: How many grocery carts do they need?

During business hours (6 A.M.–8 P.M.), cash-paying customers are expected to arrive at 8 per hour. All other customers are expected to arrive at 9 per hour. The time between arrivals of each type can be modeled as exponentially distributed random variables.

The time spent shopping is modeled as normally distributed, with mean 40 minutes and standard deviation 10 minutes. The time required to check out after shopping can be modeled as lognormally distributed, with (a) mean 4 minutes and standard deviation 1 minute for cash-paying customers; (b) mean 6 minutes and standard deviation 1 minute for all other customers.

We will assume that every customer uses a shopping cart and that a customer who finishes shopping leaves the cart in the store so that it is available immediately for another customer. We will also assume that any customer who cannot obtain a cart immediately leaves the store, disgusted.

The primary performance measures of interest to Big Bruin are the expected number of shopping carts in use and the expected number of customers lost per day. Recommend a number of carts for the store, remembering that carts are expensive, but so are lost customers.

  1. Develop a simulation model of the total time in the system for an M/M/1 queue with service rate μ=1;\mu = 1 ; therefore, the traffic intensity is ρ=λ/μ=λ\rho = \lambda / \mu = \lambda, the arrival rate. Use the simulation, in conjunction with the technique of plotting ensemble averages, to study the effect of traffic intensity on initialization bias when the queue starts empty. Specifically, see how the initialization phase T0T_{0} changes for ρ=0.5,0.7,0.8,0.9,0.95\rho = 0 . 5 , 0 . 7 , 0 . 8 , 0 . 9 , 0 . 9521. Many simulation-software tools come with built-in support for output analysis. Use the web to research the features of one of these products.

List of Materials Available on www.bcnn.net

SimulationTools.xls