This project is an options pricing tool, meant to provide visualizations and options pricing data through black scholes and other pricing models. To get stock time series data, the alpha vantage api is used, and for visualizations we use Matplotplusplus. Required External Libraries: [https://github.com/nlohmann/json], [https://github.com/alandefreitas/matplotplusplus], [https://github.com/libcpr/cpr]
Defined as
Here is a generated visualization for AAPL stock.
Numerical technique to approximate option price by simulating many possible stock paths. Unlike typical monte carlo methods which follow the geometric brownian motion, this model will sample from a user-defined probability distribution during the wiener process. This makes the model more generalizable and applicable to different market scenarios.
AAPL Monte Carlo paths with right skewed distribution sampling
Typically
Because we need to support a variety of probability distributions, we will be using accept-reject sampling.
Suppose we have an uknown distribution
The algorithm then follows
- Draw candidate
$z$ from$h(x)$ and$\mu$ from$U(0,1)$ - If
$\mu \leq \frac{f(z)}{ch(z)}$ than$z$ is a valid draw, otherwise go back to 1.
If you are on a system other than MacOS you may need to edit the MakeFile. To compile and run the script do
make
./run_script
To choose a probability distribution for monte carlo, edit the class "PDF" in helpers/math.cpp filling in the max_density on the PDF, min and max domains of the PDF, and the PDF function.