Comprehensive Guide to Simulation Modeling, Analysis, and Statistical Validation

Foundations of Systems Modeling and Simulation Taxonomy studying, analyzing, and predicting system behavior.

  • An effective model abstracts non-essential operational details while retaining the key mechanisms and dependencies governing performance.

  • As formulated by George E. P. Box (1987): "All models are wrong, but some are useful."

  • Classification Dimensions of Simulation Models:

    • Representation of Time:

    • Static Models: Represent a system at a single, fixed point in time, entirely omitting a time axis (e.g., Monte Carlo sampling of static probability distributions).

    • Dynamic Models: Represent systems that evolve, transition, and change state over a continuous or discrete interval of time.

    • Representation of Randomness:

    • Deterministic Models: Contain zero random variables or stochastic components. Given an identical set of initial states and parameters, the system outputs are uniquely and precisely determined.

    • Stochastic Models: Incorporate one or more random variables as inputs. Outputs are inherently random variables and require statistical estimation.

    • Representation of State Changes:

    • Discrete Models: The state variables change instantaneously only at discrete points in time when specific events take place (e.g., number of customers in a queueing system).

    • Continuous Models: The state variables vary smoothly and continuously over time, typically modeled via systems of differential equations (e.g., head of water behind a reservoir dam, chemical reaction kinetics).

  • Primary Simulation Paradigms:

    • Monte Carlo Simulation: Static, stochastic models utilizing pseudorandom numbers to evaluate probabilistic outcomes or evaluate intractable deterministic mathematical expressions.

    • Continuous Simulation: Dynamic models characterized by continuous state variables governed by algebraic differential equations, solved numerically via tools such as Simulink or MATLAB.

    • Discrete-Event Simulation (DES): Dynamic, stochastic, discrete models tracking state transitions driven exclusively by chronologically scheduled events occurring at distinct points in time.

    • Hybrid (Combined/Mixed) Simulation Models: Systems incorporating both discrete events and continuous state trajectories concurrently. An example includes hospital operational modeling, where individual patient arrivals, room assignments, and surgical scheduling follow discrete events, while patient physiological disease progression and vital signs evolve continuously over time.

Monte Carlo Simulation and Static Systems Analysis

  • Core Concept and Historical Foundations:

    • Monte Carlo simulation operates by generating repeated random observations from specified probability distributions to numerically estimate unknown parameters, probabilities, or expected values.

    • The method relies on the Law of Large Numbers (LLN): as the number of independent replications nn approaches infinity, the sample mean converges in probability to the theoretical expectation:     1n∑i=1nYi→μas n→∞\frac{1}{n}\sum_{i=1}^n Y_i \rightarrow \mu \quad \text{as } n \rightarrow \infty

    • Buffon's Needle Experiment (Georges-Louis Leclerc, Comte de Buffon, 1733):

    • Regarded as the earliest formal Monte Carlo experiment.

    • Involves dropping a needle of length ll onto a horizontal plane marked with parallel lines spaced at uniform distances tt apart, where l≤tl \le t.

    • The theoretical probability pp that the needle crosses any line is given by:       p=2lπtp = \frac{2l}{\pi t}

    • By estimating the empirical proportion of crossing events p^=crossingsn\hat{p} = \frac{\text{crossings}}{n}, one estimates π\pi numerically via:       π≈2lp^t\pi \approx \frac{2l}{\hat{p}t}

The Buffon Needle Problem
  • The Fallacy of the Expected-Value Approach:

    • In decision analysis under uncertainty, a common and flawed heuristic is to substitute random variables with their expected values and calculate deterministic outcomes.

    • In general, for a non-linear performance function f(D)f(D) evaluated over a random variable DD:     E[f(D)]≠f(E[D])E[f(D)] \neq f(E[D])

    • Average inputs do not yield average outputs because non-linear operational constraints (such as capacity bounds, inventory limits, and queues) distort the propagation of variance throughout the system.

  • Comprehensive Case Study: Rupert's Newspaper Problem:

    • Business Parameters:

    • Unit selling price = $1.00

    • Unit purchase cost = $0.80

    • Daily demand DD is uncertain, distributed as D∼DiscreteUniform(1500,2500)D \sim \text{DiscreteUniform}(1500, 2500)

    • Theoretical expected demand: E[D]=2000 newspapersE[D] = 2000\,\text{newspapers}

    • Deterministic Planning Flaw:

    • If Rupert orders q=2000 newspapersq = 2000\,\text{newspapers} based on average demand, deterministic calculations assume:       Sales=2000\text{Sales} = 2000       Revenue=2000×$1.00=$2000.00\text{Revenue} = 2000 \times \$1.00 = \$2000.00       Investment Cost=2000×$0.80=$1600.00\text{Investment Cost} = 2000 \times \$0.80 = \$1600.00       Deterministic Profit=$2000.00−$1600.00=$400.00\text{Deterministic Profit} = \$2000.00 - \$1600.00 = \$400.00

    • In reality, $400.00 is the absolute maximum possible profit Rupert can achieve, occurring only when D≥2000D \ge 2000. For every realization where D<2000D < 2000, unsold papers generate zero salvage value, incurring an inventory loss of $0.80 per unsold unit.

    • Stochastic Mathematical Formulation:

    • Realized Sales = min⁡(D,2000)\min(D, 2000)

    • Realized Profit W=1.00×min⁡(D,2000)−1600.00W = 1.00 \times \min(D, 2000) - 1600.00

    • Simulation Execution and Results:

    • Over 100 simulation replications, sample performance yields:       Sample Mean Profit Wˉ=$290.00\text{Sample Mean Profit } \bar{W} = \$290.00       Sample Standard Deviation s=$161.00\text{Sample Standard Deviation } s = \$161.00       95% Confidence Interval for Expected Profit: [$258.00,$322.00]\text{95\% Confidence Interval for Expected Profit: } [\$258.00, \$322.00]

    • For estimating the probability that daily profit meets or exceeds $300.00:       p=P(W≥$300.00)p = P(W \ge \$300.00)

      • Define an indicator random variable Y=1Y = 1 if W≥300W \ge 300, and Y=0Y = 0 otherwise, so that E[Y]=pE[Y] = p.

  • The Four-Step Monte Carlo Simulation Framework:

    • Step 1: Model Construction: Define all input random variables, output metrics, and deterministic transformation relationships.

    • Step 2: Input Specification: Characterize the probability distributions and parameter values for each uncertain input.

    • Step 3: Trial Simulation: Generate pseudorandom draws from the specified input distributions and compute the corresponding outputs.

    • Step 4: Statistical Analysis: Repeat the simulation across nn independent trials and compute sample statistics, confidence intervals, and risk profiles.

  • Spreadsheet Implementation Mechanics:

    • RAND(): Generates an independent, uniformly distributed continuous pseudo-random number on the open interval [0,1)[0, 1).

    • RANDBETWEEN(a, b): Generates an integer uniformly distributed across the inclusive interval [a,b][a, b].

    • Setting workbook calculations to Manual avoids recalculating stochastic draws upon every user keystroke, utilizing F9 to trigger batch replications.

Statistical Foundations and Sampling Theory in Simulation

  • Probability Foundations:

    • An experiment is an observational process with uncertain outcomes.

    • The sample space (SS) is the comprehensive set of all mutually exclusive possible outcomes.

    • An event (EE) is any subset of the sample space (E⊆SE \subseteq S), possessing probability 0≤P(E)≤10 \le P(E) \le 1.

    • A random variable (XX) is a real-valued mapping function from the sample space to the real line: X:S→RX: S \rightarrow \mathbb{R}.

  • Probability Distributions and Characterizations:

    • Discrete Random Variables:

    • Characterized by a Probability Mass Function (PMF): p(xi)=P(X=xi)p(x_i) = P(X = x_i) such that ∑ip(xi)=1\sum_i p(x_i) = 1.

    • Cumulative Distribution Function (CDF):       F(x)=P(X≤x)=∑xi≤xp(xi)F(x) = P(X \le x) = \sum_{x_i \le x} p(x_i)

    • Coupon Giveaway Example: Retail promotion offering a $1 coupon with probability 0.80 and a $6 coupon with probability 0.20.

      • Expected Value: E[X]=(1)(0.80)+(6)(0.20)=0.80+1.20=2.00E[X] = (1)(0.80) + (6)(0.20) = 0.80 + 1.20 = 2.00

      • Variance: E[X2]=(12)(0.80)+(62)(0.20)=0.80+7.20=8.00E[X^2] = (1^2)(0.80) + (6^2)(0.20) = 0.80 + 7.20 = 8.00

      • Var(X)=E[X2]−(E[X])2=8.00−(2.00)2=4.00Var(X) = E[X^2] - (E[X])^2 = 8.00 - (2.00)^2 = 4.00

      • Standard Deviation: σ=4.00=2.00\sigma = \sqrt{4.00} = 2.00

    • Continuous Random Variables:

    • Characterized by a Probability Density Function (PDF) f(x)f(x) where f(x)≥0f(x) \ge 0 and ∫−∞∞f(x) dx=1\int_{-\infty}^{\infty} f(x)\,dx = 1.

    • The point probability is identically zero: P(X=x)=0P(X = x) = 0.

    • Probabilities correspond to interval areas:       P(a≤X≤b)=∫abf(x) dxP(a \le X \le b) = \int_a^b f(x)\,dx

    • Cumulative Distribution Function (CDF):       F(x)=P(X≤x)=∫−∞xf(t) dtF(x) = P(X \le x) = \int_{-\infty}^x f(t)\,dt

    • By the Fundamental Theorem of Calculus, the PDF is the derivative of the CDF:       f(x)=F′(x)f(x) = F'(x)

  • Mathematical Properties of Moments:

    • Expectation:     E[c⋅X]=c⋅E[X]E[c \cdot X] = c \cdot E[X]     E[X+Y]=E[X]+E[Y]E[X + Y] = E[X] + E[Y]

    • Variance and Covariance:     Var(c⋅X)=c2Var(X)Var(c \cdot X) = c^2 Var(X)     Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y)Var(X + Y) = Var(X) + Var(Y) + 2Cov(X, Y)

    • If XX and YY are independent, Cov(X,Y)=0Cov(X, Y) = 0, yielding Var(X+Y)=Var(X)+Var(Y)Var(X + Y) = Var(X) + Var(Y).

    • Covariance and Correlation Coefficients:     Cov(X1,X2)=E[(X1−E[X1])(X2−E[X2])]Cov(X_1, X_2) = E[(X_1 - E[X_1])(X_2 - E[X_2])]     Cor(X1,X2)=Cov(X1,X2)σX1σX2,−1≤Cor(X1,X2)≤1Cor(X_1, X_2) = \frac{Cov(X_1, X_2)}{\sigma_{X_1} \sigma_{X_2}}, \quad -1 \le Cor(X_1, X_2) \le 1

  • Sampling Theory and Estimators:

    • A random sample of size nn consists of independent and identically distributed (i.i.d.) random variables X1,X2,…,Xn∼XX_1, X_2, \dots, X_n \sim X.

    • Population Parameters vs. Sample Statistics:

    • Population Mean: μ=1N∑i=1Nxi\mu = \frac{1}{N}\sum_{i=1}^N x_i

    • Sample Mean: Xˉn=1n∑i=1nXi\bar{X}_n = \frac{1}{n}\sum_{i=1}^n X_i

    • Population Variance: σ2=1N∑i=1N(xi−μ)2\sigma^2 = \frac{1}{N}\sum_{i=1}^N (x_i - \mu)^2

    • Sample Variance: s2=1n−1∑i=1n(Xi−Xˉn)2s^2 = \frac{1}{n-1}\sum_{i=1}^n (X_i - \bar{X}_n)^2

    • Dividing by n−1n-1 provides degrees of freedom correction, establishing s2s^2 as an unbiased estimator of σ2\sigma^2 (E[s2]=σ2E[s^2] = \sigma^2).

    • Sampling Distribution of the Sample Mean:

    • Expected Value: E[Xˉn]=μE[\bar{X}_n] = \mu (unbiased).

    • Variance: Var(Xˉn)=σ2nVar(\bar{X}_n) = \frac{\sigma^2}{n}.

    • Standard Error: σ(Xˉn)=σn\sigma(\bar{X}_n) = \frac{\sigma}{\sqrt{n}}.

    • As n→∞n \rightarrow \infty, Var(Xˉn)→0Var(\bar{X}_n) \rightarrow 0, demonstrating that averaging progressively dampens experimental variation at a rate proportional to 1n\frac{1}{\sqrt{n}}.

    • Central Limit Theorem (CLT):

    • For any population distribution having finite mean μ\mu and finite variance σ2\sigma^2, as sample size nn becomes large:       Xˉn−μσ/n→dN(0,1)\frac{\bar{X}_n - \mu}{\sigma / \sqrt{n}} \xrightarrow{d} N(0, 1)       Xˉn≈N(μ,σ2n)\bar{X}_n \approx N\left(\mu, \frac{\sigma^2}{n}\right)

  • Confidence Intervals:

    • Case 1: Known Population Standard Deviation (σ\sigma):

    • A 100(1−α)%100(1 - \alpha)\% confidence interval for μ\mu is:       [Xˉn−zα/2σn,  Xˉn+zα/2σn]\left[ \bar{X}_n - z_{\alpha/2}\frac{\sigma}{\sqrt{n}}, \; \bar{X}_n + z_{\alpha/2}\frac{\sigma}{\sqrt{n}} \right]

    • Half-width (Margin of Error): H=zα/2σnH = z_{\alpha/2}\frac{\sigma}{\sqrt{n}}

    • Case 2: Unknown Population Standard Deviation (σ\sigma):

    • Replaces σ\sigma with sample standard deviation ss, utilizing the Student's tt-distribution with n−1n-1 degrees of freedom:       Xˉn±tα/2,n−1sn\bar{X}_n \pm t_{\alpha/2, n-1} \frac{s}{\sqrt{n}}

    • For large samples (n>120n > 120), tα/2,n−1≈zα/2t_{\alpha/2, n-1} \approx z_{\alpha/2}.

    • Strict Frequentist Interpretation:

    • A calculated confidence interval [a,b][a, b] is non-stochastic; the fixed parameter μ\mu either lies within the interval or does not.

    • The valid interpretation states: "If this experimental sampling procedure is repeated independently across many samples, approximately 100(1−α)%100(1 - \alpha)\% of the resulting confidence intervals will encompass the true population parameter μ\mu."

  • Sample Size Determination:

    • Absolute Precision Requirement: Specifying that the margin of error HH must not exceed a predefined threshold ϵ\epsilon (H≤ϵH \le \epsilon):     n≥(zα/2⋅σϵ)2n \ge \left( \frac{z_{\alpha/2} \cdot \sigma}{\epsilon} \right)^2

    • Relative Precision Requirement: Specifying that the proportional error relative to the mean must not exceed δ\delta (HXˉ≤δ\frac{H}{\bar{X}} \le \delta):  

  • System and Model Definitions:

    • A system is defined as a collection of interacting components, entities, or subsystems acting together toward a common objective within an environment.

    • A model is an abstract, logical, mathematical, or physical representation of a system constructed for the purpose of    n≥(zα/2⋅σδ⋅Xˉ)2n \ge \left( \frac{z_{\alpha/2} \cdot \sigma}{\delta \cdot \bar{X}} \right)^2

    • Pilot Run Procedure for Unknown σ\sigma:

    • Execute an initial pilot simulation of kk replications (typically k=20 to 50k = 20\text{ to }50).

    • Calculate the pilot sample standard deviation s′s'.

    • Substitute s′s' in place of σ\sigma to solve for total required sample size nn.

    • Rupert Pilot Run Example: A pilot run of k=25k = 25 yields s′=166.40s' = 166.40. To achieve a 95% confidence interval (z0.025=1.96z_{0.025} = 1.96) with an absolute precision margin of error ϵ=$20.00\epsilon = \$20.00:       n≥(1.96×166.4020)2=(16.3072)2≈265.93  ⟹  n=266n \ge \left( \frac{1.96 \times 166.40}{20} \right)^2 = (16.3072)^2 \approx 265.93 \implies n = 266

    • Executing the remaining 266−25=241266 - 25 = 241 replications yields final summary statistics: mean profit = $282.00, standard deviation = $162.51, half-width = $19.53, producing a 95% confidence interval of [$262.19, $301.24].

Discrete-Event Simulation (DES): Architecture and Core Mechanics

  • Defining Characteristics of DES:

    • Dynamic: State variables evolve explicitly along a simulation timeline.

    • Discrete: Transitions occur exclusively at discrete, irregular points in time when specific events are processed.

    • Stochastic: Driving elements (interarrival times, service durations) are defined by probability distributions.

  • Fundamental Building Blocks:

    • System: The integrated collection of entities, resources, and processes defined within a modeled boundary.

    • Entities: Dynamic objects flowing through the network that request services and trigger events (e.g., customers, orders, parts). Entities possess local attributes (e.g., arrival timestamp, priority level).

    • Resources: Service mechanisms of constrained capacity seized by entities. An entity undergoes a Delay during service and Releases the resource upon completion.

    • Queues: Ordered holding locations where entities wait when requested resources are unavailable at capacity.

    • System State: The minimal set of state variables required to completely describe the condition of the system at any time epoch tt (e.g., number in queue LQ(t)LQ(t), server status LS(t)LS(t)).

    • Event: An instantaneous operational change that alters the system state variables.

    • Simulation Clock: Tracks the passage of simulated time (designated as TNOW in Arena).

    • Future Event List (FEL): A prioritized queue storing all scheduled future event records, structured as records containing (Event Type, Scheduled Time) sorted in chronological order.

  • Next-Event Time-Advance Mechanism:

    • Instead of advancing time in fixed increments (Δt\Delta t), a DES engine jumps directly from the timestamp of the current event to the occurrence time of the imminent event in the FEL.

    • The system state remains strictly invariant during the intervals between adjacent events.

  • The Event-Scheduling Algorithm:

    1. Initialization: Set simulation clock = 0; initialize system state variables, statistical accumulators, and populate the FEL with initial event notices (e.g., first customer arrival, run termination event).

    2. Timing: Identify the imminent event record at the head of the FEL; advance the simulation clock to its scheduled occurrence time.

    3. Event Execution: Remove the imminent event from the FEL, update state variables, update entity attributes, schedule any newly triggered future events into the FEL in chronological sequence, and update cumulative statistics.

    4. Condition Check: Check if the termination condition has been satisfied. If yes, proceed to Reporting; if no, loop back to Timing.

    5. Reporting: Calculate summary statistics and generate performance measure reports.

Overall DES Algorithm Flowchart
  • The Snapshot View of DES:

    • At any arbitrary simulation time tt, the complete system status is defined by a triplet snapshot: [Clock Time t, Current System State, Future Event List].

    • This snapshot provides sufficient information to determine the future trajectory of the system without relying on historical states.

  • Manual DES Case Study: Single-Server Ice Cream Truck Queue:

    • Queueing Model Characterization:

    • Calling population: infinite.

    • Queue discipline: First-Come, First-Served (FCFS); infinite capacity.

    • Interarrival distribution: X∼DiscreteUniform{1,2,…,8} minutesX \sim \text{DiscreteUniform}\{1, 2, \dots, 8\}\,\text{minutes}.

    • Service duration distribution SS:

      • S=1 minS = 1\,\text{min}, p=0.10p = 0.10, F(S)=0.10F(S) = 0.10

      • S=2 minS = 2\,\text{min}, p=0.20p = 0.20, F(S)=0.30F(S) = 0.30

      • S=3 minS = 3\,\text{min}, p=0.30p = 0.30, F(S)=0.60F(S) = 0.60

      • S=4 minS = 4\,\text{min}, p=0.25p = 0.25, F(S)=0.85F(S) = 0.85

      • S=5 minS = 5\,\text{min}, p=0.10p = 0.10, F(S)=0.95F(S) = 0.95

      • S=6 minS = 6\,\text{min}, p=0.05p = 0.05, F(S)=1.00F(S) = 1.00

Queueing Model Schematic
  • Customer Event Data Table (Replication Trace):

    • Customer 1: Interarrival = -; Arrival Time = 0; Service Time = 2; Service Begins = 0; Queue Wait = 0; Service Ends = 2; Time in System = 2; Server Idle Time = 0

    • Customer 2: Interarrival = 6; Arrival Time = 6; Service Time = 2; Service Begins = 6; Queue Wait = 0; Service Ends = 8; Time in System = 2; Server Idle Time = 4

    • Customer 3: Interarrival = 6; Arrival Time = 12; Service Time = 3; Service Begins = 12; Queue Wait = 0; Service Ends = 15; Time in System = 3; Server Idle Time = 4

    • Customer 4: Interarrival = 4; Arrival Time = 16; Service Time = 3; Service Begins = 16; Queue Wait = 0; Service Ends = 19; Time in System = 3; Server Idle Time = 1

    • Customer 5: Interarrival = 8; Arrival Time = 24; Service Time = 2; Service Begins = 24; Queue Wait = 0; Service Ends = 26; Time in System = 2; Server Idle Time = 5

    • Customer 6: Interarrival = 4; Arrival Time = 28; Service Time = 5; Service Begins = 28; Queue Wait = 0; Service Ends = 33; Time in System = 5; Server Idle Time = 2

    • Customer 7: Interarrival = 2; Arrival Time = 30; Service Time = 1; Service Begins = 33; Queue Wait = 3; Service Ends = 34; Time in System = 4; Server Idle Time = 0

    • Customer 8: Interarrival = 5; Arrival Time = 35; Service Time = 2; Service Begins = 35; Queue Wait = 0; Service Ends = 37; Time in System = 2; Server Idle Time = 1

  • Event-Scheduling Algorithm Simulation Table (Terminating at Clock = 35):

    • Tracking state variables: LQ(t)LQ(t) = Number in Queue, LS(t)LS(t) = Server Status (0 = Idle, 1 = Busy).

    • Cumulative statistical accumulators: Total Server Busy Time (BB), Maximum Queue Length (MQMQ), Total Cumulative Area under L(t)L(t) (S(t)S(t)).

    • Event Notation: Arrival = AA, Departure = DD, End Simulation = EE.

    • Clock = 0: LQ(0)=0LQ(0)=0, LS(0)=1LS(0)=1, FEL: {(D, 2), (A, 6), (E, 35)}. Event: Arrival of Customer 1 (S1=2S_1=2, X2=6X_2=6). Stats: B=0B=0, MQ=0MQ=0, S(0)=0S(0)=0.

    • Clock = 2: LQ(2)=0LQ(2)=0, LS(2)=0LS(2)=0, FEL: {(A, 6), (E, 35)}. Event: Departure of Customer 1. Stats: B=2B=2, MQ=0MQ=0, S(2)=2S(2)=2.

    • Clock = 6: LQ(6)=0LQ(6)=0, LS(6)=1LS(6)=1, FEL: {(D, 8), (A, 12), (E, 35)}. Event: Arrival of Customer 2 (S2=2S_2=2, X3=6X_3=6). Stats: B=2B=2, MQ=0MQ=0, S(6)=2S(6)=2.

    • Clock = 8: LQ(8)=0LQ(8)=0, LS(8)=0LS(8)=0, FEL: {(A, 12), (E, 35)}. Event: Departure of Customer 2. Stats: B=4B=4, MQ=0MQ=0, S(8)=4S(8)=4.

    • Clock = 12: LQ(12)=0LQ(12)=0, LS(12)=1LS(12)=1, FEL: {(D, 15), (A, 16), (E, 35)}. Event: Arrival of Customer 3 (S3=3S_3=3, X4=4X_4=4). Stats: B=4B=4, MQ=0MQ=0, S(12)=4S(12)=4.

    • Clock = 15: LQ(15)=0LQ(15)=0, LS(15)=0LS(15)=0, FEL: {(A, 16), (E, 35)}. Event: Departure of Customer 3. Stats: B=7B=7, MQ=0MQ=0, S(15)=7S(15)=7.

    • Clock = 16: LQ(16)=0LQ(16)=0, LS(16)=1LS(16)=1, FEL: {(D, 19), (A, 24), (E, 35)}. Event: Arrival of Customer 4 (S4=3S_4=3, X5=8X_5=8). Stats: B=7B=7, MQ=0MQ=0, S(16)=7S(16)=7.

    • Clock = 19: LQ(19)=0LQ(19)=0, LS(19)=0LS(19)=0, FEL: {(A, 24), (E, 35)}. Event: Departure of Customer 4. Stats: B=10B=10, MQ=0MQ=0, S(19)=10S(19)=10.

    • Clock = 24: LQ(24)=0LQ(24)=0, LS(24)=1LS(24)=1, FEL: {(D, 26), (A, 28), (E, 35)}. Event: Arrival of Customer 5 (S5=2S_5=2, X6=4X_6=4). Stats: B=10B=10, MQ=0MQ=0, S(24)=10S(24)=10.

    • Clock = 26: LQ(26)=0LQ(26)=0, LS(26)=0LS(26)=0, FEL: {(A, 28), (E, 35)}. Event: Departure of Customer 5. Stats: B=12B=12, MQ=0MQ=0, S(26)=12S(26)=12.

    • Clock = 28: LQ(28)=0LQ(28)=0, LS(28)=1LS(28)=1, FEL: {(A, 30), (D, 33), (E, 35)}. Event: Arrival of Customer 6 (S6=5S_6=5, X7=2X_7=2). Stats: B=12B=12, MQ=0MQ=0, S(28)=12S(28)=12.

    • Clock = 30: LQ(30)=1LQ(30)=1, LS(30)=1LS(30)=1, FEL: {(D, 33), (A, 35), (E, 35)}. Event: Arrival of Customer 7 (X8=5X_8=5). Server busy, customer queues. Stats: B=14B=14, MQ=1MQ=1, S(30)=14S(30)=14.

    • Clock = 33: LQ(33)=0LQ(33)=0, LS(33)=1LS(33)=1, FEL: {(D, 34), (A, 35), (E, 35)}. Event: Departure of Customer 6; Customer 7 begins service (S7=1S_7=1). Stats: B=17B=17, MQ=1MQ=1, S(33)=20S(33)=20.

    • Clock = 34: LQ(34)=0LQ(34)=0, LS(34)=0LS(34)=0, FEL: {(A, 35), (E, 35)}. Event: Departure of Customer 7. Stats: B=18B=18, MQ=1MQ=1, S(34)=21S(34)=21.

    • Clock = 35: LQ(35)=0LQ(35)=0, LS(35)=0LS(35)=0, FEL: {(E, 35), (D, 37), (A, 42)}. Event: Arrival of Customer 8 (S8=2S_8=2, X9=7X_9=7). Concurrent with End Simulation Event. Stats: B=18B=18, MQ=1MQ=1, S(35)=21S(35)=21.

    • Clock = 35: Final execution of End Event terminates simulation; final accumulators are B=18 minsB = 18\,\text{mins}, MQ=1MQ = 1, S(35)=21 customer-minsS(35) = 21\,\text{customer-mins}.

    • Spreadsheet Simulation Logic for Queueing Systems:

  • Arrival Time of Customer ii: Arrival[i] = Arrival[i-1] + Interarrival[i]

  • Service Begins: ServiceBegins[i] = MAX(ServiceEnds[i-1], Arrival[i])

  • Service Ends: ServiceEnds[i] = ServiceBegins[i] + ServiceTime[i]

  • Waiting Time in Queue: WaitQueue[i] = ServiceBegins[i] - Arrival[i]

  • Time in System: TimeSystem[i] = ServiceEnds[i] - Arrival[i]

  • Server Idle Time: IdleTime[i] = IF(Arrival[i] > ServiceEnds[i-1], Arrival[i] - ServiceEnds[i-1], 0)

    • Inventory Simulation in Spreadsheets:

  • Modeled under a Periodic Review (M,N)(M, N) Policy:

    • Inventory position is inspected every NN time intervals.

    • An order is placed to bring the inventory level up to maximum target capacity MM.

    • Replenishment order quantities arrive after a stochastic lead time LL.

    • Order quantity: Q=M−Ending Inventory+Shortage QuantityQ = M - \text{Ending Inventory} + \text{Shortage Quantity}.

  • Refrigerator Inventory Simulation Example (M=11M=11, N=5 daysN=5\,\text{days}):

    • Daily Demand PMF: 0 (0.10), 1 (0.25), 2 (0.35), 3 (0.21), 4 (0.09).

    • Replenishment Lead Time PMF: 1 day (0.60), 2 days (0.30), 3 days (0.10).

    • System state tracked daily over multiple 5-day cycles: Beginning Inventory, Daily Demand, Ending Inventory, Shortage Quantity, Pending Orders, Days until Order Arrival.

    • A 100-trial simulation (each of 25 days duration) yields an average daily ending inventory distribution with mean = 3.01, median = 3.00, minimum = 1.40, and maximum = 4.64.

  • Limitations of Spreadsheets for DES:

    • Manual spreadsheet models require dedicating an entire worksheet per replication, making multi-trial replication cumbersome.

    • They cannot scale to complex queueing disciplines, multiple resource pools, routing logic, or non-stationary networks without custom VBA programming.

    • World Views in DES Software:

  • Event-Scheduling World View: Focuses on distinct event types and explicitly programs the state change routines executed when each event occurs. Used in raw programming languages (C++, Java, Python).

  • Process-Interaction World View: Focuses on the life cycle of an entity as it navigates through a hierarchical flowchart network of processing modules (e.g., Create →\rightarrow Process [Seize-Delay-Release] →\rightarrow Dispose). This architecture is utilized by Arena.

  • Under the hood, process-interaction simulation engines translate flowchart modules into an internal event-scheduling engine governed by a Future Event List.

Analysis of Discrete-Event Simulation Outputs

  • Stochastic Nature of DES Output Data:

    • Because stochastic inputs (interarrival intervals, service delays) drive the system, the simulation's output performance measures are themselves random variables.

    • A single simulation run represents only a single random realization from an underlying output distribution, providing no measure of variability.

    • Physician Office Example: With arrival rate λ=6 patients/hr\lambda = 6\,\text{patients/hr} and service times distributed as N(9.3,5) minsN(9.3, 5)\,\text{mins}, 4 independent 8-hour replications yield mean customer waiting times of 18.88, 9.09, 24.13, and 21.32 minutes, illustrating significant run-to-run variation under identical parameters.

  • Taxonomy of Output Statistics:

    • Tally (Discrete-Time) Statistics:

    • Calculated from a discrete sequence of observations collected from entities exiting or transitioning across the system.

    • Examples: waiting time in queue (WiW_i), total flow time in system (TiT_i).

    • Theoretical measure of interest: θ=E[1N∑i=1NWi]\theta = E\left[ \frac{1}{N}\sum_{i=1}^N W_i \right]

    • Accumulation method: Whenever customer ii completes an event, their metric WiW_i is added to cumulative register WW, the observation counter NN is incremented, and tally mean Wˉ=WN\bar{W} = \frac{W}{N} is updated.

    • Time-Persistent (Continuous-Time) Statistics:

    • Summarizes state variables that exist continuously over simulation time TT.

    • Examples: number of entities in system (L(t)L(t)), queue length (LQ(t)LQ(t)), server utilization (LS(t)LS(t)).

    • Theoretical measure of interest: ϕ=E[1T∫0TY(t) dt]\phi = E\left[ \frac{1}{T}\int_0^T Y(t)\,dt \right]

    • Integration algorithm: Accumulate rectangular area under the state curve across adjacent discrete event transitions. At event timestamp ti+1t_{i+1}, the state from the previous event epoch tit_i has persisted for duration Δt=ti+1−ti\Delta t = t_{i+1} - t_i. Cumulative area accumulator S(t)S(t) is updated:       S←S+L(ti)ΔtS \leftarrow S + L(t_i)\Delta t

    • At simulation termination time TT, the time-weighted average is:       L^=S(T)T=1T∑i=0ki⋅Ti\hat{L} = \frac{S(T)}{T} = \frac{1}{T}\sum_{i=0}^k i \cdot T_i       where TiT_i represents the total duration the system spent in state ii.

Time-Persistent Statistics Area Accumulation
  • The Autocorrelation Problem in Within-Replication Data:

    • Observations generated sequentially within a single simulation run violate the fundamental i.i.d. assumption.

    • Adjacent waiting times WiW_i and Wi+1W_{i+1} exhibit strong positive autocorrelation: if customer ii experiences an extended queue delay, customer i+1i+1 arriving immediately behind will almost certainly experience a comparable delay.

    • Computing sample variance s2s^2 directly on within-replication observations drastically underestimates true variance, producing overly narrow, invalid confidence intervals.

Within-Replication Waiting Times Scatter Plot
  • Across-Replication Confidence Interval Methodology:

    • To obtain valid, statistically independent samples, simulation analysts perform multiple independent replications of the simulation model.

    • Replication Independence: Guaranteed by driving each replication with independent random number streams.

    • Identical Distribution: Guaranteed by re-initializing each replication with identical starting conditions.

    • Let Yˉr\bar{Y}_r denote the summary statistic (e.g., average waiting time) computed from replication rr (r=1,2,…,Rr = 1, 2, \dots, R). The replication averages Yˉ1,Yˉ2,…,YˉR\bar{Y}_1, \bar{Y}_2, \dots, \bar{Y}_R constitute an i.i.d. sample.

    • Overall Point Estimator:     Yˉˉ=1R∑r=1RYˉr\bar{\bar{Y}} = \frac{1}{R}\sum_{r=1}^R \bar{Y}_r

    • Sample Variance Across Replications:     s2=1R−1∑r=1R(Yˉr−Yˉˉ)2s^2 = \frac{1}{R-1}\sum_{r=1}^R (\bar{Y}_r - \bar{\bar{Y}})^2

    • Replication Half-Width and CI:     H=tα/2,R−1sRH = t_{\alpha/2, R-1} \frac{s}{\sqrt{R}}     Confidence Interval: Yˉˉ±H\text{Confidence Interval: } \bar{\bar{Y}} \pm H

    • Call Center Output Analysis Example: 10 independent replications evaluate operational operating costs:

    • Sample Mean Yˉˉ=$21,547.82\bar{\bar{Y}} = \$21,547.82

    • Sample Standard Deviation s=$2,243.38s = \$2,243.38

    • Student's tt critical value (α=0.05\alpha = 0.05, DoF = 9): t0.025,9=2.26t_{0.025, 9} = 2.26

    • Half-width H=2.26×2243.3810=$1,603.29H = 2.26 \times \frac{2243.38}{\sqrt{10}} = \$1,603.29

    • 95% Confidence Interval: [$19,944.53, $23,151.10]

  • Arena Output Reporting Infrastructure:

    • Setup parameters are configured via Run > Setup > Replication Parameters (Replication Length, Number of Replications, Warm-Up Period, Base Time Units).

    • Categorization of operational times:

    • Value Added (VA) Time: Duration an entity spends receiving value-generating processing (drilling, assembling, medical exam).

    • Non-Value Added (NVA) Time: Operational process time that does not add product value.

    • Wait Time: Duration an entity spends idling in queues.

    • Transfer Time: Material transport and conveyor travel times.

    • Output results export automatically to project_rpt.xlsm, structured across standard tabs:

    • ProjectInformation: Model metadata, run timestamps, analyst name.

    • AcrossReplicationSummary: Grand means, half-widths, minima, and maxima across all replications.

    • DiscreteTimeStatsByRep: Tally statistics parsed per individual replication.

    • ContinuousTimeStatsByRep: Time-persistent state integrals parsed per replication.

    • CounterStatsByRep: Cumulative counts (throughput totals, scrap counts).

    • OutputStatsByRep: Custom user-defined expressions.

Simulation Project Life Cycle and Input Modeling Workflow

  • The Five Phases of a Simulation Study:

    • Phase 1: Problem Definition:

    • Formulate system boundaries, operational scopes, objectives, and decision criteria.

    • Formalize a Team Charter documenting project milestones, timing, budgets, licensing fees, team responsibilities, and primary objectives.

    • Drilling Machine Project Charter Example: John Doe (lead on reporting), Li Wang (lead on model building), Mary Smith (lead on data collection); Timing: final report 6 weeks from kickoff; Direct costs: $100 stopwatches for timing, $5,000 simulation software license fee; Objective: evaluate waiting time as a function of the number of drilling machines.

    • Phase 2: Input Analysis:

    • Structural Modeling (Conceptualization): Construct logical flowcharts mapping entity lifecycles, routing conditions, process blocks, and resource allocations.

    • Quantitative Modeling (Input Modeling): Collect empirical data, assess independence, identify distribution families, estimate parameters, and validate goodness of fit.

    • Phase 3: Simulation Development:

    • Code or build the model in simulation software (e.g., Arena).

    • Conduct model verification (ensuring the conceptual model is programmed accurately) and validation (ensuring the model accurately reflects the real system).

    • Phase 4: Output Analysis:

    • Execute experimental designs, determine replication sample size, compute across-replication confidence intervals, and evaluate alternative configurations.

    • Phase 5: Decision Support:

    • Present findings, document trade-offs, and deliver actionable operational recommendations.

  • The GIGO Principle (Garbage-In, Garbage-Out):

    • Even if a simulation model's internal structural logic is valid, unrepresentative input data and poorly selected distributions will inevitably generate flawed outputs and invalid operational conclusions.

  • Input Modeling: The Three-Step Process:

    • Step 1: Data Collection: Identify critical input variables, establish observational protocols, and collect field samples.

    • Step 2: Distribution Identification and Parameter Estimation: Screen for dependence, plot empirical histograms, choose candidate distribution families, and calculate parameters via MoM or MLE.

    • Step 3: Goodness-of-Fit (GoF) Testing: Apply visual comparisons and formal statistical hypothesis testing (Chi-Square, Kolmogorov-Smirnov) to validate distributional adequacy.

  • Methods of Utilizing Data in Simulation Models:

    • Trace-Driven (Direct Historical Data):

    • Input records directly feed the simulation engine row-by-row.

    • Advantages: Values are guaranteed to be realistic, legal historical representations.

    • Disadvantages: Cannot model outcomes outside historical bounds (cannot predict extreme tail risks), limited by sample size, and computationally slow due to disk I/O.

    • Theoretical Probability Distribution Fitting:

    • Sample data fit continuous/discrete distributions from which pseudo-random draws are generated.

    • Advantages: Generates unobserved outcomes, models distributional tails, provides compact analytical representation, and facilitates sensitivity testing by altering parameters.

    • Disadvantages: Risk of model misspecification.

  • Data Collection Guidelines and Practical Rules of Thumb:

    • Plan early; input analysis is frequently the most time-consuming phase of a project.

    • Analyze data iteratively during collection to identify uninformative or inadequate collection activities early.

    • Match model level-of-detail to data quality; complex logic driven by speculative input data produces misleading results.

    • Perform sensitivity analysis: if varying an input across its plausible range produces negligible changes in output metrics, fine-grained data collection is unnecessary; if highly sensitive, invest heavily in accurate field data.

    • Data Censoring: Account for unobserved completion or start times (e.g., jobs already in progress before the measurement window begins, or lingering past the observation cutoff).

    • Standard Sample Size Benchmarks ("Magic Numbers"):

    • Minimum n=20n = 20 observations: standard threshold for initial rough estimation of process activity durations.

    • Minimum n=25n = 25 observations: benchmark standard in Statistical Process Control (SPC) for baseline system parameter characterization.

Distribution Identification and Parameter Estimation

  • Screening for Observational Independence:

    • Classical input modeling requires observations to be independent and identically distributed (i.i.d.).

    • Scatter Diagram of Adjacent Values: Plot consecutive observation pairs (Xi,Xi+1)(X_i, X_{i+1}) on a Cartesian grid.

    • A random cloud pattern indicates absence of linear correlation, supporting the independence assumption.

    • Distinct linear or curvilinear clustering indicates serial autocorrelation, violating i.i.d. assumptions.

    • Additional formal screening procedures include sample autocorrelation function analysis and the Wald-Wolfowitz runs test.

Scatter Diagram of Adjacent Values for Voter Data
  • Histogram Construction and Binning Guidelines:

    • A histogram visualizes data density; its profile approximates the underlying PMF for discrete variables or PDF for continuous variables.

    • Number of Bins (kk):

    • Too many bins: Intervals become excessively narrow, bins become empty or sparsely populated, and the histogram appears jagged and uninformative.

    • Too few bins: Bins are overly wide, oversmoothing the distribution and masking multimodality, skewness, and tail behavior.

    • Square-Root Rule of Thumb: k=⌈n⌉k = \lceil \sqrt{n} \rceil

    • Sturges' Rule: k=⌈1+log⁡2(n)⌉k = \lceil 1 + \log_2(n) \rceil

  • Distribution Selection by Physical Basis:

    • Uniform Distribution: Bounded on both sides [a,b][a, b]. Used when only minimum and maximum operational limits are known and all intermediate values are equally likely.

    • Triangular Distribution: Bounded on both sides [a,b][a, b] with a defined mode cc. Used when engineering estimates or expert opinions provide minimum, maximum, and most likely values in the absence of raw empirical data.

    • Exponential Distribution: Continuous, strictly positive, memoryless distribution (f(x)=λe−λxf(x) = \lambda e^{-\lambda x}). Models times between independent random events (Poisson process arrivals) and component lifetimes under constant failure rates.

    • Gamma and Erlang Distributions: Strictly positive, right-skewed distributions. An Erlang distribution represents the sum of kk independent, identically distributed exponential random variables. Gamma generalizes this to non-integer shape parameters, frequently modeling task completion times (e.g., machine maintenance, repair durations).

    • Weibull Distribution: Two-parameter continuous distribution widely utilized in reliability engineering to model component time-to-failure (TTF) under variable failure rates (burn-in infant mortality, wear-out aging).

    • Normal Distribution: Symmetric, unbounded distribution (−∞<X<∞-\infty < X < \infty). Supported by the Central Limit Theorem to model variables representing the additive sum of multiple independent factors.

    • Lognormal Distribution: Strictly positive, right-skewed distribution where ln⁡(X)∼N(μ,σ2)\ln(X) \sim N(\mu, \sigma^2). Models quantities governed by the multiplicative product of multiple independent factors.

    • Poisson Distribution: Discrete distribution modeling the count of independent event occurrences within a fixed time interval or spatial unit (p(k)=λke−λk!p(k) = \frac{\lambda^k e^{-\lambda}}{k!}).

  • Method of Moments (MoM) Estimation:

    • Matches the first mm theoretical moments μk(θ)=E[Xk]\mu_k(\theta) = E[X^k] to the corresponding empirical sample moments μ^k=1n∑i=1nXik\hat{\mu}_k = \frac{1}{n}\sum_{i=1}^n X_i^k for k=1,…,mk = 1, \dots, m, solving the resulting system of equations for the mm unknown parameters.

    • Example 1: Exponential Distribution (X∼Exp(λ)X \sim \text{Exp}(\lambda)):

    • Theoretical mean: E[X]=1λE[X] = \frac{1}{\lambda}

    • Sample mean: Xˉn=1n∑i=1nXi\bar{X}_n = \frac{1}{n}\sum_{i=1}^n X_i

    • Equating moments: 1λ=Xˉn  ⟹  λ^MoM=1Xˉn\frac{1}{\lambda} = \bar{X}_n \implies \hat{\lambda}_{MoM} = \frac{1}{\bar{X}_n}

    • Example 2: Normal Distribution (X∼N(μ,σ2)X \sim N(\mu, \sigma^2)):

    • Equating first and second moments:       E[X]=μ=Xˉn  ⟹  μ^=XˉnE[X] = \mu = \bar{X}_n \implies \hat{\mu} = \bar{X}_n       E[X2]=μ2+σ2=1n∑i=1nXi2E[X^2] = \mu^2 + \sigma^2 = \frac{1}{n}\sum_{i=1}^n X_i^2       σ^MoM2=1n∑i=1nXi2−(Xˉn)2=n−1nsn2\hat{\sigma}^2_{MoM} = \frac{1}{n}\sum_{i=1}^n X_i^2 - (\bar{X}_n)^2 = \frac{n-1}{n}s_n^2

    • Strengths and Limitations: Highly intuitive, computationally simple, often yields closed-form solutions; however, it can be statistically inefficient relative to MLE, higher-order moments exhibit substantial sampling variance, and estimates can occasionally fall outside valid parameter spaces.

  • Maximum Likelihood Estimation (MLE):

    • Identifies the parameter values that maximize the probability (likelihood) of observing the empirical sample data.

    • For an i.i.d. sample x1,x2,…,xnx_1, x_2, \dots, x_n, the Likelihood function is:     L(θ)=∏i=1nf(xi;θ)L(\theta) = \prod_{i=1}^n f(x_i; \theta)

    • Maximizing the log-likelihood l(θ)=ln⁡L(θ)l(\theta) = \ln L(\theta):     θ^MLE=arg⁡max⁡θl(θ)\hat{\theta}_{MLE} = \arg\max_\theta l(\theta)

    • Properties: Under regularity conditions, MLEs are consistent (θ^n→pθ\hat{\theta}_n \xrightarrow{p} \theta as n→∞n \rightarrow \infty), asymptotically normal, and asymptotically efficient (attaining the Cramér-Rao lower bound for large samples). They may, however, exhibit small-sample bias.

    • Example 1: Exponential Distribution (X∼Exp(λ)X \sim \text{Exp}(\lambda)):     L(λ)=∏i=1nλe−λxi=λne−λ∑i=1nxiL(\lambda) = \prod_{i=1}^n \lambda e^{-\lambda x_i} = \lambda^n e^{-\lambda \sum_{i=1}^n x_i}     l(λ)=nln⁡(λ)−λ∑i=1nxil(\lambda) = n \ln(\lambda) - \lambda \sum_{i=1}^n x_i     dl(λ)dλ=nλ−∑i=1nxi=0  ⟹  λ^MLE=1Xˉn\frac{dl(\lambda)}{d\lambda} = \frac{n}{\lambda} - \sum_{i=1}^n x_i = 0 \implies \hat{\lambda}_{MLE} = \frac{1}{\bar{X}_n}

  • Summary of Standard Distribution Estimators:

    • Poisson (α\alpha): α^=Xˉ\hat{\alpha} = \bar{X}

    • Exponential (λ\lambda): λ^=1Xˉ\hat{\lambda} = \frac{1}{\bar{X}}

    • Gamma (β,θ\beta, \theta): θ^=1Xˉ\hat{\theta} = \frac{1}{\bar{X}}; β^\hat{\beta} obtained numerically via nonlinear equations.

    • Normal (μ,σ2\mu, \sigma^2): μ^=Xˉ\hat{\mu} = \bar{X}, σ^2=s2\hat{\sigma}^2 = s^2 (unbiased sample variance).

    • Lognormal (μ,σ2\mu, \sigma^2): Let Y=ln⁡(X)Y = \ln(X), then μ^=Yˉ\hat{\mu} = \bar{Y}, σ^2=sY2\hat{\sigma}^2 = s_Y^2.

Goodness-of-Fit (GoF) Testing and Model Validation

  • Visual Diagnostics:

    • Visual comparison serves as an initial, subjective check of distribution fit.

    • Conway and McClain aphorism: "If you can't see it with the naked eye and need statistics to believe it, forget it."

    • Discrete Frequency Comparison: Plots the empirical observed proportions hjh_j against theoretical fitted probabilities rj=p^(xj)r_j = \hat{p}(x_j) across discrete values xjx_j.

Frequency Comparison for Discrete Data
  • Density-Histogram Overlays (Continuous Data): Plots the scaled fitted theoretical density Δb⋅f^(x)\Delta b \cdot \hat{f}(x) directly over the empirical histogram frequencies h(x)h(x), where Δb\Delta b represents uniform bin width.

Density-Histogram Plot for Continuous Data
  • Quantile-Quantile (Q-Q) Plots:

    • Plots sample empirical quantiles against theoretical quantiles of the fitted distribution.

    • An adequate fit produces points aligned along a straight 45-degree reference line.

    • Curvature indicates systematic differences in skewness or dispersion; deviations at the ends highlight heavy or light distributional tails.

Quantile-Quantile Plot
  • Formal Statistical Hypothesis Testing Framework:

    • Hypothesis Formulation:

    • Null Hypothesis (H0H_0): The empirical data are consistent with the specified fitted distribution F(x)F(x).

    • Alternative Hypothesis (H1H_1): The empirical data are not consistent with the specified distribution F(x)F(x).

    • Interpretation of Test Decisions:

    • Reject H0H_0: Sufficient statistical evidence exists at significance level α\alpha to conclude that the fitted distribution does not adequately represent the data.

    • Fail to Reject H0H_0: Insufficient evidence exists to conclude that the fitted distribution is inadequate. Failing to reject does not prove that H0H_0 is the true distribution.

    • Type I Error (α\alpha): The probability of falsely rejecting H0H_0 when H0H_0 is true.

    • Decision Criteria:

    • Critical Value / Rejection Region Approach: Compute test statistic DD. Reject H0H_0 if D>CαD > C_\alpha.

    • pp-Value Approach: The pp-value is the probability, assuming H0H_0 is true, of observing a test statistic at least as extreme as the computed statistic DD. Decision rule: If p<αp < \alpha, reject H0H_0; if p≥αp \ge \alpha, fail to reject H0H_0. Memory aid: "If pp is low, H0H_0 must go; if pp is high, H0H_0 can fly."

  • Pearson Chi-Square (χ2\chi^2) Goodness-of-Fit Test:

    • Applicable to both discrete and continuous probability distributions.

    • Procedure:

    1. Partition the sample data into kk adjacent, non-overlapping bins Ii=[ai−1,ai)I_i = [a_{i-1}, a_i).

    2. Count the observed frequency OiO_i of data points falling within each bin ii.

    3. Calculate the theoretical expected frequency EiE_i using the fitted CDF F^(x)\hat{F}(x):        pi=P(ai−1≤X<ai)=F^(ai)−F^(ai−1)p_i = P(a_{i-1} \le X < a_i) = \hat{F}(a_i) - \hat{F}(a_{i-1})        Ei=n⋅piE_i = n \cdot p_i

    4. Compute the Pearson Chi-Square test statistic:        χ02=∑i=1k(Oi−Ei)2Ei\chi_0^2 = \sum_{i=1}^k \frac{(O_i - E_i)^2}{E_i}

    5. Determine degrees of freedom: DoF=k−s−1\text{DoF} = k - s - 1, where kk is the number of bins and ss is the number of distribution parameters estimated directly from the empirical sample.

    6. Reject H0H_0 at significance level α\alpha if χ02>χα,k−s−12\chi_0^2 > \chi^2_{\alpha, k-s-1}.

    • Operational Rules and Constraints:

    • Requires a minimum sample size of n≥30n \ge 30.

    • Every bin must satisfy Ei≥5E_i \ge 5. If any bin exhibits Ei<5E_i < 5, it must be merged with an adjacent bin, which decreases the bin count kk and reduces the degrees of freedom accordingly.

    • The test has maximum statistical power when bins are chosen to be equiprobable (pi=1/kp_i = 1/k).

    • Circuit Board Defect Case Study (Illustrating Binning Sensitivity):

    • A sample of n=59n = 59 circuit boards records defects per board, fitted to a Poisson(λ=0.63)\text{Poisson}(\lambda = 0.63) distribution (s=1s = 1 parameter estimated, α=0.05\alpha = 0.05).

    • Unmerged Four-Bin Evaluation:

      • Bins: 0 defects (O1=36O_1 = 36, p1=0.5341p_1 = 0.5341, E1=31.51E_1 = 31.51

      • 1 defect (O2=12O_2 = 12, p2=0.3350p_2 = 0.3350, E2=19.76E_2 = 19.76

      • 2 defects (O3=8O_3 = 8, p3=0.1050p_3 = 0.1050, E3=6.20E_3 = 6.20

      • ≥3\ge 3 defects (O4=3O_4 = 3, p4=0.0259p_4 = 0.0259, E4=1.53E_4 = 1.53

      • Computing statistic: χ02=0.64+3.05+0.52+1.42=5.63\chi_0^2 = 0.64 + 3.05 + 0.52 + 1.42 = 5.63

      • Degrees of freedom: DoF=4−1−1=2\text{DoF} = 4 - 1 - 1 = 2. Critical value χ0.05,22=5.99\chi^2_{0.05, 2} = 5.99.

      • Since 5.63<5.995.63 < 5.99, this test fails to reject H0H_0.

    • Merged Three-Bin Evaluation (Enforcing Ei≥5E_i \ge 5):

      • Because E4=1.53<5E_4 = 1.53 < 5, the last two bins are pooled into a single category: ≥2\ge 2 defects.

      • Pooled Bin (≥2\ge 2): O3=11O_3 = 11, p3=0.1309p_3 = 0.1309, E3=7.72E_3 = 7.72

      • Computing statistic: χ02=0.64+3.05+1.39=5.08\chi_0^2 = 0.64 + 3.05 + 1.39 = 5.08

      • Degrees of freedom: DoF=3−1−1=1\text{DoF} = 3 - 1 - 1 = 1. Critical value χ0.05,12=3.84\chi^2_{0.05, 1} = 3.84.

      • Since 5.08>3.845.08 > 3.84, the null hypothesis is rejected at α=0.05\alpha = 0.05.

      • This demonstrates that altering binning thresholds can reverse test conclusions.

    • Franklin County Voter Interarrival Case Study (Chi-Square):

    • A sample of n=229n = 229 voters arrives over a 90-minute window (Xˉ=0.394 mins\bar{X} = 0.394\,\text{mins}, fitted to Exp(λ=2.538)\text{Exp}(\lambda = 2.538)).

    • Setup with k=15k = 15 equiprobable bins (pi=1/15=0.067p_i = 1/15 = 0.067, expected counts Ei=229×0.067=15.267E_i = 229 \times 0.067 = 15.267).

    • Bin boundary calculation using the inverse CDF:       xi=F−1(ik)=−1λln⁡(1−ik)x_i = F^{-1}\left(\frac{i}{k}\right) = -\frac{1}{\lambda}\ln\left(1 - \frac{i}{k}\right)

    • Degrees of freedom: DoF=15−1−1=13\text{DoF} = 15 - 1 - 1 = 13.

    • Computed test statistic: χ02=6.087\chi_0^2 = 6.087.

    • Critical value: χ0.05,132=22.4\chi^2_{0.05, 13} = 22.4.

    • Since 6.087<22.46.087 < 22.4, the test fails to reject H0H_0, providing no evidence against the fitted exponential distribution.

  • Kolmogorov-Smirnov (K-S) Goodness-of-Fit Test:

    • Restricted exclusively to continuous probability distributions.

    • Empirical Cumulative Distribution Function (E-CDF):

    • Given an ordered sample of observations X(1)≤X(2)≤⋯≤X(n)X_{(1)} \le X_{(2)} \le \dots \le X_{(n)}, the empirical CDF is defined as a step function:       Fˉn(x)={0,x<X(1)in,X(i)≤x<X(i+1),1≤i≤n−11,x≥X(n)\bar{F}_n(x) = \begin{cases} 0, & x < X_{(1)} \\ \frac{i}{n}, & X_{(i)} \le x < X_{(i+1)}, \quad 1 \le i \le n-1 \\ 1, & x \ge X_{(n)} \end{cases}

    • Test Statistic Formulation:

    • The K-S statistic DD measures the largest vertical gap between the empirical step function Fˉn(x)\bar{F}_n(x) and the fitted theoretical continuous CDF F(x)F(x):       D=sup⁡x∣F(x)−Fˉn(x)∣=max⁡(D+,D−)D = \sup_x |F(x) - \bar{F}_n(x)| = \max(D^+, D^-)       D+=max⁡1≤i≤n{in−F(X(i))}D^+ = \max_{1 \le i \le n} \left\{ \frac{i}{n} - F(X_{(i)}) \right\}       D−=max⁡1≤i≤n{F(X(i))−i−1n}D^- = \max_{1 \le i \le n} \left\{ F(X_{(i)}) - \frac{i-1}{n} \right\}

Empirical CDF vs Theoretical Continuous CDF Gap
  • Theoretical Distribution of DD:

    • Andrey Kolmogorov (1933) proved that under H0H_0, as n→∞n \rightarrow \infty:       nDn→dsup⁡t∈[0,1]∣B(t)∣\sqrt{n}D_n \xrightarrow{d} \sup_{t \in [0, 1]} |B(t)|       where B(t)B(t) represents a Brownian bridge process. The limiting Kolmogorov distribution is independent of the underlying continuous distribution F(x)F(x).

    • Critical values approximate dn,α≈Kαnd_{n, \alpha} \approx \frac{K_\alpha}{\sqrt{n}}.

    • Reject H0H_0 if D>dn,αD > d_{n, \alpha}.

  • Franklin County Voter Interarrival Case Study (K-S Test):

    • Sample size n=229n = 229, fitted to F(x)=1−e−2.538xF(x) = 1 - e^{-2.538x}.

    • Sorting and evaluating deviations across all 229 observations yields:       D+=0.029D^+ = 0.029       D−=0.032D^- = 0.032       Test Statistic D=max⁡(0.029,0.032)=0.032\text{Test Statistic } D = \max(0.029, 0.032) = 0.032

    • At α=0.05\alpha = 0.05, the critical value from the K-S distribution table is d229,0.05=0.090d_{229, 0.05} = 0.090.

    • Since D=0.032<0.090D = 0.032 < 0.090, the test fails to reject H0H_0.

    • Chi-Square Test vs. Kolmogorov-Smirnov Test Comparison:

  • Distribution Applicability: Chi-square applies to both discrete and continuous distributions; K-S applies strictly to continuous distributions.

  • Sample Size Sensitivity: Chi-square requires large samples (n≥30n \ge 30); K-S is valid across both small and large sample sizes.

  • Data Transformation: Chi-square requires grouping observations into discrete bins; K-S evaluates raw, ungrouped observations directly.

  • Subjectivity: Chi-square test outcomes depend on the bin count and interval widths chosen; K-S is exact, invariant to grouping, and generally has higher statistical power when evaluating continuous data.

    • Software Best-Fit Pitfalls and Modeling Judgment:

  • Software tools (Arena Input Analyzer, ExpertFit) use the Sum of Squared Errors (SSE) to automate "Fit All" rankings:     SSE=∑i=1k[h(xi)−f(xi)]2\text{SSE} = \sum_{i=1}^k [h(x_i) - f(x_i)]^2

  • A distribution with the lowest SSE or highest pp-value may still be structurally unsuited to the underlying real-world process.

  • Software algorithms cannot account for the physical context of the system (e.g., whether process boundaries are strictly finite, whether memoryless properties hold, or whether non-negative bounds apply).

  • Analysts must check the fitted distribution graphically—confirming that the main body and operational tails match expected physical behavior—and let domain knowledge override automated statistical rankings whenever they conflict.