The example question for these solutions can be found on my website (click here).
6.1 Explicit Finite Difference For Option Pricing
In this example we are going to price a European call option with explicit finite difference.
The example question for these solutions can be found on my website (click here).
In this example we are going to price a European call option with explicit finite difference.
The example question for these solutions can be found on my website (click here).
The two most popular models for using binomial trees to price options are
thus
and so
We wish to generate a stock price tree, so denote the value of the underlying asset after timestep i and upstate j by Sij and we have that:
Now we are going to value an European call option using Monte-Carlo. The setup is very simple, we just need to sum up the payoffs from a bunch of sample paths and then take the average. First start with an empty program except for the random number generator, as follows
Calculate the expected hitting time E[t∗] for a Brownian motion X(t), where the process must hit either X(t∗) = 0 or X(t∗) = 1 for t∗ < T. If neither boundary is hit within the time T then t∗ = T.
Assume that the process X follows the SDE
The example question for these solutions can be found on my website (click here).
To use the new random number generator we need to include the random library, the cmath library for any calculations and also iostream to show results onscreen. We first create a new project with an empty program with the correct libraries, and then declare a variable of type mt19937. This declares a new random number generator, which generates pseudo random sequence of integers defined by the Mersenne Twister algorithm. A computer can only generate a random sequence of integers, but of course we can then take that sequence of integers and convert it to any required distribution. Some of the conversions are simple but others are more complex, luckily we now have inbuilt c++ conversion to all standard distributions (more on this later). This means you will always have to create a generator to pass as an argument to the probability distribution you want to generate.