Understand the Monte Carlo method and how to implement it in Python
In this post, I will introduce, explain and implement the Monte Carlo method to you. This method of simulation is one of my favourites because of its simplicity and yet it’s a refined method to resolve complex problems. It was invented by Stanislaw Ulam, a Polish mathematician in the 1940s. It was named after a gambling town in Monaco because the principles of randomness mimic a game of roulette. Monte Carlo simulations are a very common concept to quantify risk in various areas like stock prices, sales forecasting, predictive modelling, etc.
Monte Carlo simulations are a method of simulating statistical systems. The method uses randomness in a defined system to evolve and approximate quantities without the need to solve the system analytically. The main concept implied in this method is that a point in a moving system will eventually visit all parts of the space that the system moves in, in a uniform and random sense. This is known as ergodicity.
The model predicts by using a range of values in the domain of the problem rather than a specific input. This method leverages distributions of probability (normal, gaussian, uniform, etc.) for any…