finmath / finmath-lib

Mathematical Finance Library: Algorithms and methodologies related to mathematical finance.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Moment Explosions for stochastic volatility models.

AlessandroGnoatto opened this issue · comments

I have a concern regarding the present version of the implementation of both the Heston and Bates models. So far I was not complaining because we only had BlackScholes in the library and everything is fine in that case. Introducing more advanced models implies that one has to pay more attention.

Currently it is possible to choose quite freely the domain of integration, this implies that the characteristic function may explode in finite time, which results in non-sense option prices.
There is a vast literature on the topic. Prominent examples are given by Andersen and Piterbarg
https://link.springer.com/article/10.1007/s00780-006-0011-7
and Keller-Ressel
http://onlinelibrary.wiley.com/doi/10.1111/j.1467-9965.2010.00423.x/abstract

In concrete terms, to obtain a situation where you get in trouble with the current implementation try the following:
In net.finmath.fouriermethod.products.AbstractProductFourierTransform
Set some very nasty value in lineOfIntegration like
final double lineOfIntegration = 10.5 * getIntegrationDomainImagUpperBound()+getIntegrationDomainImagLowerBound();

and set the maturity of the option to 10 years. You should see option prices going to infinity.

To solve the issue without getting mad there is a trick: the use of the Cauchy residue theorem. To this you have to change the following lines in EuropeanOption
@OverRide
public double getIntegrationDomainImagLowerBound() {
return -1;
}

/* (non-Javadoc)
 * @see net.finmath.fouriermethod.products.AbstractProductFourierTransform#getDomainImagUpperBound()
 */
@Override
public double getIntegrationDomainImagUpperBound() {
	return 0;
}

But since we change the countour of integration, we have to add the residue term in front of the integral, so in AbstractProductFourierMethod you need to do something like

return residueTerm + integrator.integrate(integrand) / 2.0 / Math.PI;

and then you must provide in the interface a method getResidueTerm which provides the right residue (the residue depends on the contour you choose on the complex plane). In case we choose IntegrationDomainBound in (-1,0) the residue Term is simply the value of the asset today or, equivalently, the characteristic function of the asset computed at the point -1, which gives the martingale property of the asset.

Financially speaking, instead of transforming a call Option, you transform a covered call Position.

This is the best way to guarantee that your model does not become numerically unstable when you consider vanilla call/put options:
By definition of characteristic function you have that 0 and -1 are always good points: 0, by definition of characteristic function returns you 1 for the ch. Function while -1 is simply a statement of the martingale property of the (discounted) asset.

For more precise formulas please see the following paper by Roger Lee
https://www.math.uchicago.edu/~rl/dft.pdf

The FFT transfomer that implements the Carr-Madan methodology takes care of the change of contour proposed above.