Serving the Quantitative Finance Community

 
User avatar
monraf
Topic Author
Posts: 1
Joined: September 25th, 2011, 8:34 am

Help with Heston Finite Difference

May 19th, 2013, 11:53 pm

Hi Guys,I'm trying to implement some code to solve the Heston PDE for European options using the ADI method. I've worked through the thesis by Lin, and gotten similar results to that thesis but when I run a Monte Carlo simulation, or compare it to the option city or kluge calculator my results are way off. Could someone please look through my code to see any glaring mistakes I may have missed? The parameters I am using are r=0.03,S=100,s0=0,V=1,lambda=0,T=1,K=50,rho=0.8,kappa=2,eta=0.2,sigma=0.3,theta=0.5,nv=20;ns=40;nt=100.Thanks for any help
Attachments
hestonFD.zip
(1.26 KiB) Downloaded 93 times
 
User avatar
Cuchulainn
Posts: 22933
Joined: July 16th, 2004, 7:38 am

Help with Heston Finite Difference

May 20th, 2013, 8:09 am

It is not necessarily the code that is to blame (but it could be). Your (undocumented) ADI approach may be the issue. Which source are you working from?Here is a thesis on HestonAre you all using the same parameters?? And did you compare <Lin + monraf> versus <optionCity> versus <Kluge> for other sets of parameters? // I don't have matlab, cannot open .m
Last edited by Cuchulainn on May 19th, 2013, 10:00 pm, edited 1 time in total.
 
User avatar
Tene
Posts: 1
Joined: August 30th, 2005, 2:30 am

Help with Heston Finite Difference

May 20th, 2013, 6:31 pm

Without knowing which ADI you refer to, it is difficult to say much. A more precise reference would be helpful.I am not sure how to understand your parameters. Is S = Smax? If so then it migth be a bit small with your S = 2K.To what rho, kappa, eta, sigma, and theta refer to? The notations for these vary in the literature.In any case, I would start by implementing the Crank-Nicolson (or implicit Euler) method and use LU decompositionto solve the resulting systems of linear equations. This is easy with Matlab. Only after getting right results with sucha simpler implementation, I would try to use more advanced method like ADI.
 
User avatar
monraf
Topic Author
Posts: 1
Joined: September 25th, 2011, 8:34 am

Help with Heston Finite Difference

May 20th, 2013, 9:20 pm

Hi Tene and Cuchulainn,Im using the douglas method. Im looking at this thesis for help nulllin thesis. I have compared my results with a couple different parameters across the board, but im gonna go through that again with the parameters from your link Cuchulainn. S is Smax Tene sorry about that. Theta is the weighting for the crank-nicholson scheme, and for the rest im working with the model[$]dS/S=(r-l\ambda)dt+\sqrt{v}dX_1 \\dv=\kappa(\eta-v)dt+\sigma \sqrt{v}dX_2 \\E[dX_1,sX_2]= \rho dt[$]So rho is the correlation of the processes, kappa is the reversion rate, eta is long term vol, sigma is vol of vol.Thanks for your help so far guys, its really appreciated.
 
User avatar
Alan
Posts: 3050
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Help with Heston Finite Difference

May 21st, 2013, 2:11 am

Don't compare vs the OptionCity calculator -- compare vs the quasi-analytic Fourier method.
 
User avatar
Cuchulainn
Posts: 22933
Joined: July 16th, 2004, 7:38 am

Help with Heston Finite Difference

May 21st, 2013, 2:24 am

QuoteOriginally posted by: monrafHi Tene and Cuchulainn,Im using the douglas method. Im looking at this thesis for help nulllin thesis. I have compared my results with a couple different parameters across the board, but im gonna go through that again with the parameters from your link Cuchulainn. S is Smax Tene sorry about that. Theta is the weighting for the crank-nicholson scheme, and for the rest im working with the model[$]dS/S=(r-l\ambda)dt+\sqrt{v}dX_1 \\dv=\kappa(\eta-v)dt+\sigma \sqrt{v}dX_2 \\E[dX_1,sX_2]= \rho dt[$]So rho is the correlation of the processes, kappa is the reversion rate, eta is long term vol, sigma is vol of vol.Thanks for your help so far guys, its really appreciated.The link is broken.I don't think I have seen the schemes of Jim Douglas Jnr. in a long time. I would say that you should have a look at more recent developments in this area.
Last edited by Cuchulainn on May 20th, 2013, 10:00 pm, edited 1 time in total.
 
User avatar
Tene
Posts: 1
Joined: August 30th, 2005, 2:30 am

Help with Heston Finite Difference

May 21st, 2013, 3:49 am

The link http://eprints.maths.ox.ac.uk/718/1/Sen ... thesis.pdf seems to work.Monraf,Have you tried to the explicit finite difference method defined by (3.4) in the thesis?I would first make sure that this simpler method gives right results.If you post some prices with given (S,V) pairs then I could possibly try to compute the same prices with my code.Are you sure that you enter the parameters correctly to Kluge's pricer? Some parameters are given to itin a bit non standard form.
 
User avatar
Cuchulainn
Posts: 22933
Joined: July 16th, 2004, 7:38 am

Help with Heston Finite Difference

May 21st, 2013, 6:08 am

QuoteAre you sure that you enter the parameters correctly to Kluge's pricer? Some parameters are given to itin a bit non standard form.I remember this causing a helluva lot of confusion, indeed.
 
User avatar
monraf
Topic Author
Posts: 1
Joined: September 25th, 2011, 8:34 am

Help with Heston Finite Difference

May 22nd, 2013, 8:30 am

Hey Guys,Tene I ended up just extending my smax up to about 8K and I got a pretty nice solution, thanks for the help. Cuchulainn thanks for the advice about new schemes, I figured I would use the douglas scheme as a jumping off point then move on to some of the more modern schemes. Thanks heaps Cuchulainn and Tene you were both a lot of help. Monraf
 
User avatar
Cuchulainn
Posts: 22933
Joined: July 16th, 2004, 7:38 am

Help with Heston Finite Difference

May 22nd, 2013, 2:49 pm

Another option is ADE with domain transformation ADE is stable and explicit independently of delta_t.
Last edited by Cuchulainn on May 21st, 2013, 10:00 pm, edited 1 time in total.
 
User avatar
caopuzheng
Posts: 4
Joined: August 31st, 2013, 3:04 pm

Help with Heston Finite Difference

September 1st, 2013, 4:47 pm

Hello!Now I am also studying Lin's paper but find his original code doesn't give me the result he showed.Could you share your code so I could compare with Lin's to have a further understanding about the ADI method?Thanks a lot.