Handbook in Monte Carlo Simulation: Applications in Financial Engineering, Risk Management, and Economics
by Paolo Brandimarte
Chapter Seven
Output Analysis
There are several reasons why we should carefully check the output of a Monte Carlo simulation:
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
![]()
and 10,000 customers are simulated. Is this sample size enough for practical purposes? The following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access