Activity: The Distribution App
KSL Applications Activities
Work in pairs. Each question asks you to predict before you act; write the prediction down, then check it.
The question. In the earlier activities, the drive-through pharmacy assumed that cars arrive as a Poisson process at 1 per minute and that service times are exponential. Nobody checked. The pharmacy has now collected data: 200 service times, in minutes, and the number of cars that arrived in each of 100 five-minute intervals. Do the data support the assumptions, and does it matter if they do not?
Setup. Get the two data files from the data/ folder beside this activity: pharmacy-service-times.csv and pharmacy-arrivals.csv. Start KSL Distribution.
1. Load and look
On the Data tab, choose Delimited File under Add datasets from:, pick
pharmacy-service-times.csv, mark it Continuous, and add it. Then addpharmacy-arrivals.csvand mark it Discrete. Why does the app need to know which is which?On the Analysis tab, look at the service times. Before you look at the histogram, sketch the shape you expect for service times at a pharmacy window. Then compare with the histogram.
Write down the sample mean and standard deviation of the service times. For an exponential distribution, the standard deviation equals the mean. What is the ratio of the standard deviation to the mean (the coefficient of variation) here, and what does it suggest before you fit anything?
Look at the autocorrelation plot. Are the service times independent of each other? Why must you check this before fitting a distribution at all?
2. Fit the service times
Predict which distribution will rank first. Then, on the Fitting tab, click Fit and read the ranking. Which family is recommended, and which come next?
Where does the exponential distribution rank? Look at its goodness-of-fit tests. Is the exponential assumption from the earlier activities plausible for these data?
The recommended distribution includes a shift: a constant added to every value. What is it, where does that number come from, and does it make physical sense for a service time?
On the Reports tab, open the report for the recommended distribution and find the Q-Q and P-P plots. What should the points look like for a good fit? Where, if anywhere, do they stray?
Your instructor generated these service times from a known distribution. Before you run the Bootstrap tab, predict: if you resample the data and refit many times, how often will the recommended family win? Run it with 100 bootstrap samples. Then ask your instructor which distribution generated the data. How often did the bootstrap pick it, and what does that teach you about “the best fit”?
3. Fit the arrivals
If cars arrive as a Poisson process at 1 per minute, what distribution should the number of cars in a five-minute interval follow, and with what mean?
Fit the arrival counts. Which distribution does the app recommend, with what parameter? Does the chi-squared goodness-of-fit test reject the Poisson distribution? What arrival rate per minute do the data suggest, and is it consistent with the model?
4. Does the input model matter?
The busy-pharmacy runs assumed exponential service with a mean of 0.8 minutes and one pharmacist. Use the M/G/1 results (Appendix C, the section Non-Markovian Queues and Approximations), with an arrival rate of 1 per minute, to compute the expected time in the system for each case:
- exponential service with a mean of 0.8 minutes;
- a mean of 0.8 minutes, with the standard deviation of your data;
- the mean and the standard deviation of your data.
Predict first: which matters more for the waiting time, the shape of the distribution or its mean? Then compute the three cases. Were you right?
What would you tell the pharmacy manager about the earlier staffing study?
In the Single-Model and Scenario apps, the RV Overrides can change the mean of the service time, but not its distribution family. What would you have to change to simulate the pharmacy with your fitted distribution?