The Monte Carlo Simulation is a stochastic method that relies on random sampling to solve problems that might be deterministic in nature. Here we use the Monte Carlo Method to price options of a financial instrument by simulating various future paths and averaging the discounted payoff. This is useful when pricing complex derivatives where close-formed solutions are not available.
The goal of this research is to distribute
We define variables:
First, we introduce the notion for the Geometric Brownian Motion widely used for modeling the assets price path over the simulation. We start the simulation at the stocks current price point, and observe how it changes as the number of steps increases. We sample a random gaussian variable
where
We are interested in observing the payoff of the stock over the time interval as the assets price changes over the number of steps.
We then introduce the Black Scholes Model widely used for pricing stocks based on their volatility and time with respect to calculating the theoretical options price.
Where ( N ) is the Gaussian CDF, and cost represents the theoretical option price.
So, let us define:
$$ d_2 = d_1 - \sigma\sqrt{T} $$
where
We then calculate the error to view how accurate our simulation was. We take the absolute difference between the GBM price and the Black Scholes price to approximate the theoretical value. Ideally, we are looking for the error to be small, meaning our simulation is producing results close to the expected theoretical price. The error indicates to us whether the GBM converges to the Black Scholes model as we increase the number of simulations.
We hosted 10 VM's in digital oceans ecosystem, where 1 is the Master Node, 8 are worker nodes, and 1 is the scheduler. We then distributed 10,000 simulations across the 8 worker nodes and found that as our simulation converged
The math behind this project is bundled into a package on Pypi and installation instructions can be found here
Try out our application here