Monte Carlo Simulation Theory and Applications in Python
The Monte Carlo Simulation is a numerical analysis technique aimed at estimating the possible outcomes of a certain random event. It is a very powerful method of evaluating integrals where there are no known solutions.
The main idea behind this simulation is that the results are computed based on repeated random sampling and statistical analysis. The technique relies on random sampling, the Law of Large Numbers and the Central Limit Theorem.
1. Monte Carlo Approximation
Suppose we wanted to evaluate the integral:
over the domain set 𝐴
We can do so using two different points of view.
a. Using Expectation
We can express this integral as:
Where,
- 𝑋 is a random variable with a probability density function given by ℎ(𝑥)
- 𝐸[𝑔(𝑋);𝐴] represents the expected value of 𝑔(𝑥) over the set 𝐴
This means we can re-express the integral as an expectation of a function of a random variable over a given set
Suppose we have i.i.d. random variables 𝑋1,𝑋2,… with: