Serving the Quantitative Finance Community

 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Lewis Formula

July 6th, 2021, 3:20 pm

Let me add on the Feller condition.
 With the sqrt model, there are 3 boundary regimes, which are the following (Feller scheme) classifications for the boundary of the V-process at V=0:

1. exit: [$] \omega \le 0[$]
2. regular: [$] 0 < \omega < \xi^2/2[$]
3. entrance: [$]\omega \ge \xi^2/2[$]

The posted code is valid for both regular and entrance regimes, while the Feller condition forces you to stay in the entrance regime. In the regular case, the interpretation of the solution is that it describes a V-particle which sometimes hits the origin and just reflects back to positive values. The posted code solution smoothly transitions from the unique solution in the entrance regime to its natural partner (reflecting) solution in the regular regime. There is lots more discussion in `A Closer Look at the Square-root and 3/2 model', which is Chapt . 7 in "Option Valuation under Stochastic Volatility II".
 
krs
Topic Author
Posts: 38
Joined: August 20th, 2019, 12:40 pm

Re: Lewis Formula

July 9th, 2021, 4:57 pm

>> It's also good practice to visually examine your integrand for smoothness along the contour.

K: I am trying to visualize the integrand, to see if the integral is not smooth when Im(z) is between 0 and 1. For a given set of model parameters, I generated a contour map. I don't get the feeling why it is not smooth between 0 and 1. Please see the figure below. The real and imaginary parts of the complex number are between [0,2].
Image
 
krs
Topic Author
Posts: 38
Joined: August 20th, 2019, 12:40 pm

Re: Lewis Formula

July 9th, 2021, 5:13 pm

>> If you include shorter-dated, well out of the money options, such as those available with SPX, a calibration will often
violate the Feller condition in order to achieve a "best fit". I have seen it happen often, although I typically don't use MSE on prices as the objective function. In any event, it's harmless and there's no reason not to improve a fit by accepting a Feller condition violation.
Are there any criteria to choose an objective function? I have implemented, RMSE, maximum absolute relative error (MARE) and average absolute relative error (AARE). Heston model captures the long-dated options perfectly. There are issues with short-dated options. Is it okay if we consider a weighted combination of RMSE and MARE to model different regions of the vol surface? 

I also observed that Feller conditions are violated for the short-maturity options. Quadratic-exponential (Anderes 2007) can simulate prices and variance process even when the Feller condition is not satisfied. However, QE doesn't seem to be a nice scheme to calculate greeks using AAD. 

PS: in one of my previous comments I talked about an article with a missing 2 in the denominator and different integral limits in the Heston pricing formula. It is correct and is consistent with the code shared by Alan. The missing 2 is due to the use of inversion lemma.   
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Lewis Formula

July 9th, 2021, 5:27 pm

>> It's also good practice to visually examine your integrand for smoothness along the contour.

K: I am trying to visualize the integrand, 
Just plot your (real) integrand vs. x for x=0 to xmax. Should be a smooth function -- ultimately very small near xmax. 
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Lewis Formula

July 9th, 2021, 5:32 pm

>> If you include shorter-dated, well out of the money options, such as those available with SPX, a calibration will often
violate the Feller condition in order to achieve a "best fit". I have seen it happen often, although I typically don't use MSE on prices as the objective function. In any event, it's harmless and there's no reason not to improve a fit by accepting a Feller condition violation.
Are there any criteria to choose an objective function? I have implemented, RMSE, maximum absolute relative error (MARE) and average absolute relative error (AARE). Heston model captures the long-dated options perfectly. There are issues with short-dated options. Is it okay if we consider a weighted combination of RMSE and MARE to model different regions of the vol surface? 
It is a subjective choice. Personally, I like the weighting in Sec. 4.2 here

p.s. In my experience, stay away from absolute errors. Because those are non-smooth functions of the price, this easily makes for trouble with (some) optimizers.
 
krs
Topic Author
Posts: 38
Joined: August 20th, 2019, 12:40 pm

Re: Lewis Formula

July 9th, 2021, 8:29 pm

>> It's also good practice to visually examine your integrand for smoothness along the contour.

K: I am trying to visualize the integrand, 
Just plot your (real) integrand vs. x for x=0 to xmax. Should be a smooth function -- ultimately very small near xmax. 
Yes, it converges to 0. At xmax = 25 it is 0.0005 and xmax = 50 it is of order -5 and order -7 at xmax=100 

thank you :)
Image
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Lewis Formula

July 10th, 2021, 6:43 pm

Well, OK, that doesn't show us the smoothness. Why don't you post a plot from x=0 to x=25? 
 
krs
Topic Author
Posts: 38
Joined: August 20th, 2019, 12:40 pm

Re: Lewis Formula

July 12th, 2021, 8:54 am

Here it is...

Image
 
krs
Topic Author
Posts: 38
Joined: August 20th, 2019, 12:40 pm

Re: Lewis Formula

July 12th, 2021, 9:12 am

Hi Alan, What about calibration in the volatility space? I mean can I consider an objective function where I minimize the squared distance between market vol and the Heston implied vol? Are there any limitations of such a calibration methodology?

And how about calibration via Monte Carlo simulation? Do we run a grid search in the MC calibration case? It would be very slow for the models with a high number of parameters. I just want to compare results using different techniques and I think I can also use the MC calibration technique for the class of models where there is no analytical solution available to price derivatives (for instance, 2-factor Black-Karasinski model to price swaptions) 

Thanks,
K
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Lewis Formula

July 12th, 2021, 2:56 pm

Thanks for the chart -- looks good.

Yes, minimizing the RMSE in the implied vol (IV) is a decent calibration strategy, esp if you want to see how different models are capable, or not, of matching far otm behavior. You need to have a very robust implied vol function and need to choose your minimum strike carefully. The VIX white paper has a good method for ensuring the market implied vol is smooth as you transition the IV from puts to calls. Also, visually make sure the IV curve, for all the option strikes present in the calibration, looks reasonably smooth. The tricky market feature for equity models to match (talking about SPX here), is the slight up-turn in the market IV's at the highest available strikes with call bids > 0.  

I wouldn't advise using MC. (If there's no quasi-analytic solution, try a pde or discrete markov process approximation). In general, just develop a good local optimizer and occasionally test its results against a (pseudo) global optimizer, say using differential evolution. Also, you can test the local optimizer at different starting parameter values. After you've run enough calibrations with these for a particular model, you'll get a feel for whether or not you've settled at a global minimum or not.
 
krs
Topic Author
Posts: 38
Joined: August 20th, 2019, 12:40 pm

Re: Lewis Formula

July 12th, 2021, 10:28 pm

Thanks for the chart -- looks good.

Yes, minimizing the RMSE in the implied vol (IV) is a decent calibration strategy, esp if you want to see how different models are capable, or not, of matching far otm behavior. You need to have a very robust implied vol function and need to choose your minimum strike carefully. The VIX white paper has a good method for ensuring the market implied vol is smooth as you transition the IV from puts to calls. Also, visually make sure the IV curve, for all the option strikes present in the calibration, looks reasonably smooth. The tricky market feature for equity models to match (talking about SPX here), is the slight up-turn in the market IV's at the highest available strikes with call bids > 0.  

I wouldn't advise using MC. (If there's no quasi-analytic solution, try a pde or discrete markov process approximation). In general, just develop a good local optimizer and occasionally test its results against a (pseudo) global optimizer, say using differential evolution. Also, you can test the local optimizer at different starting parameter values. After you've run enough calibrations with these for a particular model, you'll get a feel for whether or not you've settled at a global minimum or not.
Thank you, Alan. Calibrating it in the vol space to see far OTM behaviour. 
 
krs
Topic Author
Posts: 38
Joined: August 20th, 2019, 12:40 pm

Re: Lewis Formula

July 14th, 2021, 10:50 am

Hi, is it a good practice to smooth out the volatility surface before calibrating a model? There could be a significant loss of information, especially when fitting a model to away-from-the money options.

Thanks, 
K
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Lewis Formula

July 14th, 2021, 1:46 pm

With SPX, there's little need. For some other underlying, if there are gross arbitrage violations at some mid-quotes, could be worth it. Or, you could just drop the offending quotes from the calibration.    

In the end, the model does the smoothing and fixes the arb-violations, so it seems like overkill to do that twice.  
 
User avatar
Cuchulainn
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Lewis Formula

July 14th, 2021, 8:34 pm

QE doesn't seem to be a nice scheme to calculate greeks using AAD.

Glasserman 2004 page 397 allows one to differentiate SDE to get SDE for greeks. (Kunita).

and Lykke Rasmussan'S PhD thesis discusses this as well, including AD and Complex Step Method.
 
krs
Topic Author
Posts: 38
Joined: August 20th, 2019, 12:40 pm

Re: Lewis Formula

July 15th, 2021, 8:13 am

With SPX, there's little need. For some other underlying, if there are gross arbitrage violations at some mid-quotes, could be worth it. Or, you could just drop the offending quotes from the calibration.    

In the end, the model does the smoothing and fixes the arb-violations, so it seems like overkill to do that twice.  
Thank you, I consider dropping some points on the vol surface based on the bid-ask spread criterion.