MONTE CARLO SIMULATION

Monte Carlo simulation is a widely used tool in countless branches of physics, engineering, economics, finance, and business in general. Roughly speaking, the aim is to simulate a system on a computer, in order to evaluate its performance under random scenarios. The name was actually invented by physicists and aptly reflects the role of randomness. Indeed, Monte Carlo simulation is one of the more successful, as well as potentially dangerous, application areas of probability and statistics. While “Monte Carlo” is typically associated with “simulation,” a more in-depth view highlights two sides of the coin:

  • Monte Carlo sampling refers to a mathematical method that may be used, e.g., to discretize a continuous representation of uncertainty in order to generate a set of scenarios. For instance, we may consider a normal distribution and generate a sample of observations that are supposed to approximate the original continuous distribution. Monte Carlo sampling is also a numerical method to evaluate challenging multidimensional integrals.
  • Monte Carlo simulation relies on Monte Carlo sampling, and it is used to predict the performance of a system in which uncertainty and dynamic interactions of system components preclude the application of analytical modeling techniques. In other words, it is impossible to build a mathematical model giving us a clue of how well a system will work, and we are forced to rely on empirical experimentation with a simulated model of reality.

Whereas Monte Carlo sampling is more of a statistical tool, Monte Carlo simulation may also involve nontrivial modeling of complex systems by special purpose software environments and programming languages.

Example 9.25 (Monte Carlo sampling as a numerical integration tool) Imagine that we need the value of the following integral:

images

From Section 2.13 we know that we should find the antiderivative of function g, but this is sometimes impossible to do. A seemingly weird way of tackling the problem is obtained if we rewrite the integral in probabilistic terms:

images

What we have done is consider the harmless factor 1 as the PDF of a uniform random variable U ∼ u(0, 1). Then, the integral can be regarded as the expected value of a function of a random variable. Furthermore, if we were able to draw a sample of independent random observations U1U2,…, Un from the uniform distribution, we could apply the arsenal of statistical inference to the estimator

images

If the sample is large enough, this sample mean should converge to the true value of the integral above, and we may also check whether the sample is indeed large enough by evaluating a confidence interval.

Actually, there are numerical integration methods that are faster and more accurate than Monte Carlo sampling, when we have to integrate a function of one variable. But consider the expected value of a function of a vector X of random variables taking values in images, with a possibly complicated joint PDF as follows:

images

This may be an integral in a very high-dimensional space, over a domain images that is the support of the distribution. Standard numerical methods are not applicable when m is even moderately large, whereas Monte Carlo sampling requires only to generate random variables with a given probability distribution and calculate a sample mean.

The basic ingredient of Monte Carlo sampling is the generation of observations of random variables on a computer. Conceptually, this is an impossible task, since there is no randomness in a computer algorithm; however, using methods outlined in Section 9.7.2, we are able to generate pseudorandom variables that are practically satisfactory. Monte Carlo sampling can be used for scenario generation21 in many risk management applications. Prom a practical perspective, the required machinery of Monte Carlo sampling can be conceptually challenging, but it is easy to implement, quite often in spread-sheet form. On the contrary, Monte Carlo simulation of complex dynamic systems may require nontrivial programming skills.

Example 9.26 (Monte Carlo simulation of an inventory control policy) We must control the inventory of an item subject to random demand. Daily demand dt, t = 1,2,3,…, can be just a sequence of i.i.d. variables, or a very complicated process subject to intertemporal dependence and seasonal patterns.22 We consider a simple control policy, which is widely known as (s, S) policy:

  • Every T days we check the inventory level; if it is below a threshold level s, we order enough items to bring inventory back to a target level S, where S ≥ s; more precisely, we order S − It items, where It is the current inventory level when it is reviewed; items are received after a delivery lead time LT.
  • If the inventory level is above the threshold s, we do nothing.

The role of the threshold level s is to avoid ordering too often, since we would incur large fixed ordering and transportation costs. The policy parameters s and S should be set in order to find a satisfactory balance between inventory holding costs, ordering costs, and penalties due to stockouts. The reader should compare this approach with the economic order model that we introduced in Section 2.1. Since we check inventory with a review period T, the (s, S) policy is called periodic review; on the contrary, the (Q, R) policy, based on a fixed order quantity Q and a reorder level R, is a continuous review policy, since we should check inventory level whenever we draw an item from inventory. A possible advantage of periodic review policies is that, by choosing a common ordering period, we may synchronize and aggregate orders for different items with a common supplier, resulting in a reduction in transportation costs.

In very simple cases, mathematical models can be devised to predict the average cost as a function of the control parameters s and S; then, we may tune them in the best way. Unfortunately, many complicating factors may preclude this approach:

  • The demand process can be difficult to deal with analytically, because of correlation over time and other nontrivial patterns.
  • Items may be perishable and have limited shelf life.
  • Delivery lead time LT may be uncertain; note that if LT is deterministic and smaller than the review period T, the issued order will be received before the next inventory review; however, in general, we should take the queue of incoming deliveries into account. Indeed, inventory control does not rely on physical, on-hand inventory; rather, we should consider the inventory position, which includes both on-hand and on-order inventory, as well as possible backlog associated with customers that we have not yet satisfied because of a stockout.
  • The customer behavior when a stockout occurs may be nontrivial; some customers will wait for delivery, possibly reneging if the waiting time is too large; other customers may be lost; sometimes, they will switch to a substitute item.
  • There could be an interaction between different items held in stock.
  • There could be an interaction between our and suppliers’ inventories.

In these cases, we should resort to performance evaluation by Monte Carlo simulation.

The reader should appreciate the difference between the two examples. On a conceptual level, the simulation of a complex supply chain to estimate its average cost is just the estimation of an expected value. We are just integrating a complicated function that cannot be represented by a formula. However, from a practical perspective, the second example requires considerable modeling skills and cannot be tackled by plain spreadsheets. The dynamic interaction of components and actors calls for much more. We will not consider implementation issues at all, but we should mention that a massive array of software environments and languages is available to tackle huge simulation models. They are also equipped with graphical animation tools that are way beyond. What is relevant, from our point of view, is the fundamental role that probability and statistics play in a proper simulation study. Too often, users fascinated by flashy computer graphics forget this point.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *