The Monte Carlo method

The Monte Carlo method is used to sample numerical integration using random numbers and to study the mean value of a large number of samples. The Monte Carlo method is especially useful when there is no closed form solution available.

In this section, we'll look at the simplest case, where we have path-dependent European options. We are going to sample numerical integration using a random drifting parameter. This will lead to various average values for the stochastic process, which makes up the movement of the underlying asset. We'll do this using 1,000 and 1,000,000 samples respectively and compare the results. Let's dig into the following code:

/// Monte Carlo implementation /// Convert the nr of days to years let days_to_years ...

Get F# for Quantitative Finance 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.