Monte Carlo method in simulations

From Simulace.info
Revision as of 05:53, 24 January 2021 by Louis (talk | contribs) (Monte Carlo Set-Up for Simulations)
Jump to: navigation, search

Introduction

Monte Carlo simulation is a mathematical technique used to simulate the possible outcomes of an uncertain event. Instead of fixed inputs, a probability distribution is used as a parameter at at least one point. By generating random probabilities as an input, a set of different outcomes and the probability of this outcomes can be generated through repeated simulation. The generation of random numbers by computers plays an important role in this.

The first well-known experiment that used randomness to solve a problem was "Buffon's Needle". The French scientist Georges Louis LeClerc, Comte de Buffon asked in the 18th century the question with what probability a randomly thrown needle intersects a grid of parallel lines. Only a few years later he was able to prove that this probability is 2L/Dπ (D > L). Let L be the length of the needle and D the distance between the lines. In his first experiments, LeClerc allegedly threw baguettes over his shoulder onto a tiled floor. In 1812, the French scientist Pierre-Simon Laplace suggested that this experiment could be used to determine the number π. In 1901, the scientist Mario Lazzarini was able to determine the number π to 6 decimal places by throwing needles on a grid of parallel lines, and that after only 3408 throws. However, this result is also doubted by scientists or also described as a stroke of luck. This is because in order to determine the number π to 6 decimal places in a 95% confidence interval, one would theoretically have to throw at least 134 trillion needles. Nowadays, these experiments can be simulated much faster and more efficiently with the help of computers. This is explained in detail in the chapter "Monte Carlo Simulation and the Number Pi".

The previous example of "Buffon's Needle" is based on actual chance by throwing a needle. Moreover, this experiment explored a deterministic problem that had already been solved analytically. Today's Monte Carlo simulations, however, approach the process in reverse. They serve as a tool when complex problems cannot be solved analytically. In addition, the simulations use artificially or computer-generated randomness. This was first used by John von Neumann and Stanislaw Ulam to explore the properties of neutron travel through radiation shielding. In doing so, they contributed to the invention of the atomic bomb during the Manhattan Project. They also gave the name to the Monte Carlo simulation, named after the famous casino in Monaco. Most of the Monte Carlo principles used today were developed during research into nuclear weapons.

Applications of the Monte Carlo Simulation

A Monte Carlo simulation can be used practically everywhere where randomness plays a role. Thus, there are no limits to the applications of Monte Carlo simulation. Therefore, the application areas range from particle physics to engineering, finance and climate research.

In climate research, for example, these simulations are used to determine the health risk of smog in cities for humans. There are different stochastic variables. For example, smog levels vary in different neighbourhoods of a city and people spend different amounts of time outside. In the simulations, these different variables are then randomly combined millions of times.

But Monte Carlo simulation can also be used in video games. Here it can help to create artificial intelligence. Using Monte Carlo tree search, the artificial intelligence can simulate all or at least many next possible steps and their consequences based on the starting point and choose the most promising next step on this basis.

However, these are only a few examples; the list could go on endlessly.

Monte Carlo Set-Up for Simulations

Since the application areas of Monte Carlo simulation are so broad, it is difficult to find a generally valid framework for a Monte Carlo set-up. Nevertheless, the principle that at least the majority of simulations follow should be explained here. First of all, the process we are looking for must be described and formulated in a model. For this, the inputs and outputs must be defined. Usually, a random variable X is sought. For this variable, the cumulative distribution function F(x) must be determined, for which F(x) = p[X <= x]. p must lie between 0 and 1. This results in x = F^-1(p). The inverse cumulative distribution function is therefore needed to calculate x. This curve is given for the common distributions in Excel, for example. Among others, the function for the standard normal distribution (=NORMSINV(probability)), the normal distribution (=NORM.INV(probability,mean,standard_dev)) but also the log normal distribution (=LOGNORM.INV(probability, mean, standard_dev)) can be used.

After the inverse has been determined, the Monte Carlo simulation usually follows 3 steps.

First, a random number for p is determined. As already written, this should lie between 0 and 1. In Excel, the function =rand() can be used for this. This random number is used as the input for F^-1.

Depending on the value p generated in the first step, F^-1 is determined.

The last step is to repeat steps 1 and 2 again and again until the desired or defined number of simulations is reached. According to the law of large numbers, one should obtain a data set that approximately reflects the true mean and true standard deviation of the population.

Monte Carlo Simulation vs. Monte Carlo Sampling

Characteristics Of A High Quality Monte Carlo Simulation

Problems with Monte Carlo Simulations

Examples of Monte Carlo Simulations for Students