Book Image

Python for Finance

By : Yuxing Yan
Book Image

Python for Finance

By: Yuxing Yan

Overview of this book

Table of Contents (20 chapters)
Python for Finance
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Using the Sobol sequence to improve the efficiency


When applying the Monte Carlo simulation to solve various finance related problems, we need to generate a certain number of random numbers. When the accuracy is very high, we have to draw a huge amount of such random numbers. For example, when pricing options, we use very small interval or a large number of steps to increase the number of decimal places of our final option prices. Thus, the efficiency of our Monte Carlo simulation would be a vital issue in terms of computational time and costs. This is especially true if we have a thousand options to price. One way to increase the efficiency is to apply a correct or better algorithm, that is, optimize our code. Another way is to use some special types of random number generators, such as the Sobol sequence.

Sobol sequences belong to the so-called low-discrepancy sequences, which satisfy the properties of random numbers but are distributed more evenly. Thus, they are usually called quasi random...