Chapter Seven

Output Analysis

There are several reasons why we should carefully check the output of a Monte Carlo simulation:

1. Model validation, i.e., check that the model makes economic and/or financial sense, possibly with respect to empirical evidence.
2. Model verification, i.e., check that the computer code we have written implements the model, right or wrong, that we had in mind.
3. Statistical inference, i.e., check the accuracy of the estimates that we obtain by running the model implemented in the code.

In this chapter we deal with the last point. To motivate the development below, let us refer back to the queueing example that we introduced in Section 1.3.3.1, where Lindley’s recursion is used to estimate the average waiting time in an M/M/1 queue, i.e., a queue where the distributions of interarrival and service times are both memoryless, i.e., exponential.1 For the sake of convenience, we report the R code in Fig. 7.1; the function has been slightly modified, in order to return the whole vector of recorded waiting times, rather than just its mean.

FIGURE 7.1 Function to simulate a simple M/M/1 queue.

With the default input arguments, the average server utilization is

equation

and 10,000 customers are simulated. Is this sample size enough for practical purposes? The following ...

Get Handbook in Monte Carlo Simulation: Applications in Financial Engineering, Risk Management, and Economics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.