Grow your YouTube channel like a PRO with a free tool
Get Free YouTube Subscribers, Views and Likes

You've been using the Wrong Random Numbers! - Monte Carlo Simulations

Follow
QuantPy

In this tutorial we discuss Monte Carlo convergence and the difference between Pseudorandom numbers and Quasirandom numbers. In previous tutorials will discusses the benefits of combining Monte Carlo Variance Reduction techniques such as antithetic and control variate methods to reduce the standard error of our simulation.

We demonstrate the effectiveness of using quasirandom numbers by compaing the convergence on a pricing a European Call Option by monte carlo simulation using difference methods for creating pseudo and quasirandom variables.

Pseudorandom number generation:
add 12 uniform variables
BoxMuller
Polar Rejection
Inverse transform sampling (like Numpy)

Quasirandom number generation:
Halton
Sobol

Turns out, pseudo random numbers are a bad choice for Monte Carlo simulation. Let's consider pairs of independent uniformally distributed random numbers. Since numbers are independent and uniformly distributed, every point on the graph is equally likely. However we observe clumps and empty spaces. Eventually if we sampled enough points, the initial clumps and empty spaces would be swamped by the large number of points spread evenly.

Unfortunately, with Monte Carlo simulation, the aim is to often reduce the number of samples to decrease computation time (as has been the aim of Variance Reduction Techniques).
Pseudorandom numbers introduce bias through the clumpiness!

In contrast, Quasirandom numbers or lowdiscrepency sequences are designed to appear random but not clumpy. Quasirandom samples are not independent from the previous one, it 'remembers' the previous samples and attempts to position itself away from other samples. The behaviour is ideal for obtaining fast convergence in a Monte Carlo simulation. We show Halton and Sobol, because these are implemented in Scipy!

★ ★ Code Available on GitHub ★ ★
GitHub: https://github.com/TheQuantPy
Specific Tutorial Link: https://github.com/TheQuantPy/youtube...

★ ★ QuantPy GitHub ★ ★
Collection of resources used on QuantPy YouTube channel. https://github.com/thequantpy

★ ★ Discord Community ★ ★
Join a small niche community of likeminded quants on discord.   / discord  

★ ★ Support our Patreon Community ★ ★
Get access to Jupyter Notebooks that can run in the browser without downloading python.
  / quantpy  

★ ★ ThetaData API ★ ★
ThetaData's API provides both realtime and historical options data for endofday, and intraday trades and quotes. Use coupon 'QPY1' to receive 20% off on your first month.
https://www.thetadata.net/

★ ★ Online Quant Tutorials ★ ★
WEBSITE: https://quantpy.com.au

★ ★ Contact Us ★ ★
EMAIL: [email protected]

Disclaimer: All ideas, opinions, recommendations and/or forecasts, expressed or implied in this content, are for informational and educational purposes only and should not be construed as financial product advice or an inducement or instruction to invest, trade, and/or speculate in the markets. Any action or refraining from action; investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied in this content, are committed at your own risk an consequence, financial or otherwise. As an affiliate of ThetaData, QuantPy Pty Ltd is compensated for any purchases made through the link provided in this description.

posted by Ottolinqx