Path: blob/master/3.1 Merton jump-diffusion, PIDE method.ipynb
1675 views
The Merton Partial Integro-Differential Equation
Contents
The notebook 2.1 is a prerequisites for understanding this notebook. If you don't know the Merton model, have a look at the notebook A.3.
In this notebook we only consider the problem of solving the Merton PIDE. Let us recall that, this is the pricing PIDE associated to the process:
where is a Poisson random variable representing the number of jumps of up to time , and is the size of each jump. (more details in A.3)
This is an incomplete model. It means that the risk neutral measure is not unique (for more information see Section 3 of A.3 or the wiki page). We are not considering any change of measure here. Rather, we are going to consider all parameters as risk neutral parameters i.e. obtained from the options market through a calibration process (see Notebook 4.2). The risk neutral process has drift:
with risk free interest rate, and defined below.
Closed formula
Just for information, there exists a closed formula for pricing European call/put options under the Merton model. This formula was presented by Merton in [2]. We just report it without derivation.
with , and is the Black-Scholes closed formula.
The Merton PIDE
In this notebook I want to show how to solve the Merton PIDE:
with
The Lévy measure is:
The Lévy measure is a scaled Normal distribution, such that .
For more information on the derivation of this PIDE, have a look at the document A.3. It includes a short introduction to general pricing PIDEs and the description of the Merton model.
This equation is an "extension" of the Black-Scholes equation. It coincides with the BS equation for .
Let us first introduce the discretization method, and then write everything in python!
Discretization
The discretization of this equation is quite similar to the discretization of the BS equation. However, here there is an additional integral term!!
We will adopt the Implicit-Explicit (IMEX) scheme proposed by Cont-Voltchkova [1]. The differential part is discretized by an implicit scheme (the same approach used for the BS equation). The integral part in instead discretized by an explicit scheme. The reason of the explicit choice, is that it avoids the inversion of the dense "jump" matrix (below we will construct the jump matrix).
The integral part is computed using fourier methods (it is a convolution integral) in order to increasing the efficiency.
Since we have to restrict the problem to a bounded region, we consider the equation:
with
and
For we choose such that , and is the space step.
The computational domain of interest becomes , where in the regions and we need to define the boundary conditions.
Let us discretize the integral as follows:
where
We have that . For large values of and , the parameter is a good approximation for , since
The discretized equation using the IMEX scheme becomes:
Rearranging the terms:
We can rename the coefficients:
and solve the system for , for every :
where is the tridiagonal matrix formed by the coefficients , and with boundary terms .
Introducing the jump matrix , the system becomes:
However, we will see that it is better to avoid to use this matrix, and solve the integral by fft methods.
What I did was:
define tha parameters. I called muJ and sigJ the mean and standard deviation of the (normal) jump random variables. They correspond to and .
obtain the boundary values: A1 and A2. And the space step dx and time step dt. The variable
x
takes values in the extended computational domain .compute the standard deviation of the jump component (at ). Let us recall the variance formula for the compound Poisson process (obtained from the formula of conditional variance):
compute the extra points extraP indicating the number of points to use as extra bounday conditions. The extra points are the points in the regions and .
Why did I choose the extra points in that way?
The idea is that we want to cover at least 3 standard deviations of the domain of the Lévy measure. The choice of 3 is arbitrary. The higher is the better. The important fact to remember, is that the smaller is , the higher is extraP.
In the previous cell we created the grid for . The time grows from left to right. The stock price grows from up to down.
The first 2 rows, and the last 2, are the extra boundary conditions. (In agreement with extraP)
The third row and the seventh row are the usual boudary conditions.
The last column corresponds to the terminal boundary condition.
Let us create the vector :
The integral: can be computed using two methods:
or using the scipy function
quad
or using the discretization:
These two methods are equivalent. We show both in the next cell. Of course the values are different because is quite big now.
In the previous cell we created the "diffusion" matrix, in the same way we did for the Black-Scholes equation in the notebook 2.1.
In the next cell we create the "jump" matrix . As you can see, it is a dense matrix!
We have all the ingredients to solve the backward in time algorithm:
Is the previous method efficient?
Well NO!
Since the integral we are considering is a convolution integral, we should take advantage of the convolution theorem.
We can use two python functions:
fftconvolve Convolves two arrays using FFT.
convolve Convolves two arrays. The user can specify the method. If the length of the array is smaller than 500 it is better to use the definition of convolution, otherwise it is better to use the FFT (and it calls fftconvolve).
Let us check that the output is the same:
Comparison with other numerical methods
In the class Merton_pricer
I made the following choice for the parameters:
and
The reason is that I want the parameters , , , to be as large as possible.
In the backward iteration I used the FFT approach:
The correct code to use is nu[::-1]
.
This is because our convolution has the form , but the convolution in the numpy.convolve function is defined as . Therefore it is necessary to invert the vector!
(In the code above, I did not invert nu
for clarity. The code worked because the considered nu
was symmetric).
Let us compare the solution of the Merton PIDE with other numerical methods:
PIDE price:
Closed formula:
Fourier inversion:
Monte Carlo method gives the value: (the output includes the price, the standard error and the execution time)
Plot of the call:
Plot of the put:
OK cool! It works!
But what happens if we select some "strange" set of parameters? Let's try.
What happened? Three methods... three different outputs. This is not good.
Do not worry. The model is fine. And the algorithms are fine too. The last set of parameters is the problem. To be precise, the model is fine under a certain set of parameters. Let us investigate this feature.
Model limitations
Let us inspect the behavior of the pricing function (Merton closed formula) under different values of lam
and sigJ
.
In the plot we can see the curves obtained for different values of lam
.
The model works properly for sigJ
smaller than a certain level dependent on lam
.
For sigJ
too big, the price drops to zero. However, even at the peak of the curve, the three different numerical algorithms can give different outputs.
Under several numerical tests, I found that the model works properly for all values sigJ
on the left side of the peak of the curve (but not too close to the peak).
As you can see, for high values of sigJ
, the calculations produce overflows and NaNs.
Now let us compare the Merton curve with the Black Scholes curve, for a European call option. The volatility of the BS model is chosen equal to the standard deviation of the Merton process.
Looking at the plot we can see the different shape of the two curves.
References
[1] Cont-Voltchkova (2005), "Integro-differential equations for option prices in exponential Lévy models", Finance and Stochastics, 9, 299--325.
[2] Merton, R. (1976). "Option pricing when underlying stock returns are discontinuous", Journal of Financial Economics, 3, 125--144.