Presentation on theme: "Charles Yoe, Ph.D. College of Notre Dame of Maryland"— Presentation transcript:
1Charles Yoe, Ph.D. College of Notre Dame of Maryland Monte Carlo ProcessCharles Yoe, Ph.D.College of Notre Dame of MarylandMany risk assessment tools are probabilistic. Several of these make extensive use of the Monte Carlo process. This on-line course will introduce you to the workings of the Monte Carlo process through a very simple example.
2Analytical Solution Solution meets all criteria of problem 2 + x = 4 x = 2 is a solution that worksSome problems have more than one analytical solutionx2 = 9Some problems have no analytical solutionIt is always better to get the answer to a problem when the answer exists. If we are trying to convert feet to inches we do not want to simulate the number of inches in a foot, although many models could do so quite precisely. There is no need to simulate when we can calculate the answer quite precisely.
3SimulationNumerical technique used to estimate analytical solutions to a problemNot an optimization technique, answers what-if questionsResults are not analytical solutionsAnalytical solutions are preferredThere are many simulation techniques, Monte Carlo is just one of them. If you have ever seen a video game flight simulator you can easily appreciate the range in simulation techniques that are available.
4Monte Carlo ProcessCode name for simulations relating to development of atomic bombApplied to wide variety of complex problems involving random behaviorProcedure that generates values of a random variable based on one or more probability distributionsNot simulation method per seIt may be an apocryphal story, but it is too good not to repeat. One story goes that during the development of the atomic bomb the assembled scientists had pretty much convinced themselves that if they initiated the atom splitting process they could contain it. Because that had not yet been done no one could be absolutely certain. It was all theory up to that point. Because the stakes of being wrong were reasonably high they felt they needed to consider as many scenarios as possible. The Monte Carlo process was either invented then or put to good use, depending on the version of the story, in order to explore the possible scenarios that could be encountered in the process of splitting the atom and containing that process.The name is a clear allusion to the gaming tables of Monaco.
5Suppose . . . You have a variable that varies between 10 and 50 All you know is theoretical maximum and minimum, any number between is equally likelySuppose you are trying to describe a quantity whose value can vary in an uncertain fashion. It might be the time it takes to complete a process, the time to component failure, the weight of an animal or a commodity, an average or any other continuous random variable. Further suppose you know only that it has a theoretical or practical minimum of 10 and a maximum of 50. Any number between these two is as likely as any other. That is all you know.
6Monte Carlo ProcessIs a process that can generate numbers within that rangeAccording to the rules you specifyIn this case a min and a maxAny number as likely as any other numberWe’re using a simple example to keep the arithmetic easy. The Monte Carlo process works with any distribution you can specify mathematically. The rules for which values get selected with what frequencies are embedded in the math of the distribution you specify.
7Monte Carlo Process Two steps Generate a simple random number Transform it into a useful value using a specific probability distributionThe first step is to come up with a number between zero and one in a random fashion. But because we need a number between 10 and 50, this value will not be immediately useful for our problem. It must be transformed to a value between 10 and 50 to be useful to us.
8Random Number Generation Pseudorandom Numbers [0,1]Seed = 6721 (any number)Mid-square Method (John von Neumann)(6721)2 = ; r1=(1718)2 = ; r2=(5152)2 = ; r3=etc.More sophisticated methods now usedWe’ll demonstrate step one with a random number generator that was used early in the history of this process and that was abandoned almost as early for reasons that will become apparent.It is not hard to see some problems with this method. Suppose you had a large simulation model and needed 100,00 random values for your variable. What is the largest number of values theoretically possible when you use a mid-square of four digits? There are only 10,000 values and that is not enough. So why not square a larger number and use a larger mid square? That may or may not work. Suppose your initial seed is Try it. The sequence yields one “random” number. Other seeds cause a loop after a limited number of values are generated. Because this method was not adequate for many purposes it was quickly abandoned. It is used here because it is very easy to understand, it is part of the random number history, and it illustrates a potential problem with random number generators. Much more efficient algorithms are used today.The example starts with any 4-digit number. Square it and take the middle four numbers. If there is an uneven number of digits simply follow a predetermined rule for the “middle” four. Divide these four digits, the “mid square” by 10,000 to get a random number between 0 and 1.
9Transformation (1)Assume Uniform Distribution, U(a,b) where a = 10 and b = 50To obtain a value, x, we use x = a + (b - a)uIn this case, x = uThis is the “rule” we’ll use for transforming random numbers into useful numbers.
10Transformation (2) Generate U~U(0,1), say u = 0.1718 then x = 10 +( ) = 16.9x = 10 +( ) = 30.6x = 10 +( ) = 31.7, etc.Other distributions are similar but more complex transformationsBy substituting random numbers for u we can transform numbers on a [0,1} to random numbers from a uniform distribution over [10,50].
11This slide shows you another simple example This slide shows you another simple example. This is a normal distribution with a mean of 35 and a standard deviation of 5. Commercially available software (Palisade has been used to reproduce the Monte Carlo process for this distribution. The cells of the spreadsheet display values sampled from this distribution in a process similar to that just shown. The math is messier with a normal distribution and the mid square method is no longer used, but the two stage process is the same.
12Some LanguageIteration--one recalculation of the model during a simulation. Uncertain variables are sampled once during each iteration according to their probability distributionsSimulation--technique for calculating a model output value many times with different input values. Purpose is to get complete range of all possible scenariosThe Monte Carlo process is often used in a simulation. A single simulation is composed of many iterations.
13Monte Carlo Simulation Simulation model that uses the Monte Carlo processDeterministic values in models replaced by distributionsValues randomly generated for each probabilistic variable in model and calculations are completedProcess repeated desired # timesNot all simulations use a Monte Carlo process. Those that do are often called Monte Carlo simulations. The key point is that deterministic values are replaced by distributions.
14Monte Carlo Simulation X=Here is a simple picture of a Monte Carlo simulation model. It shows two random variables being multiplied together. One is a discrete variable the other is continuous. Together they yield the continuous distribution of outputs shown at the bottom.The top left distribution is the number of people who will take a group trip. The top right distribution is the cost per person. Multiply these two values together and you obtain the bottom distribution, the total cost of the trip.Risk assessment addresses the variation in model inputs (top two distributions). Risk management addresses the variation in outputs (bottom distribution).
15How Many Iterations? Means often stabilize quickly--few hundred Estimating probabilities of outcomes takes moreDefining tails of output distribution takes many more iterationsIf extreme events are important it make take many many moreSome analysts have estimated that the expected values of output simulations converge after a few hundred iterations. The additional iterations are most useful in providing information about the remainder of the distribution. It takes more iterations to define the output distributions’ tails and more still to identify the extreme events in those tails. When the tails and extreme events are important, you need more iterations than when only expected values matter.
16Some ExamplesThe Monte Carlo process is used for several risk assessments linked to the ClearinghouseSalmonellaAntimicrobial Resistant CampylobacterThe Monte Carlo process has been used extensively in risk assessment. You can see how the process has been used in practice by examining some of the risk assessments linked to this Clearinghouse. The Campylobacter model is the simpler of the two models.