How to Cause Diffusion

You now have an overview of how to build Brownian motion, Geometric Brownian motion, and Jump Diffusion. This section will show you how to get random numbers for the stochastic part of the simulation, and how to draw pictures in C++.

Small Random Steps, dW

C++ introduced a random number library from C++11, with a variety of statistical distributions including the Gaussian and Poisson flavors you need. You will therefore have this avaiable, without needing to install a library, if you use a current compiler—for example, anything from GCC4.8.1.[37] You can use the older rand C call instead, but this is error prone and you will likely need to resort to some tricks to get the distributions you need. The new standard C++ library ...

Get Genetic Algorithms and Machine Learning for Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.