Serving the Quantitative Finance Community

 
User avatar
TimeTraveler
Topic Author
Posts: 0
Joined: July 3rd, 2008, 10:12 pm

Complex logarithm in Heston model

August 6th, 2008, 10:38 am

Hi guys,when implementing the Heston model, or Shobel-Zhu model, a problem is that the complex logarithm has a branch cut. This leads to irregular jumps, as these screenshots from my Matlab implementation show:(1,2,3... on the "pi-axis" are numbers, not multiples of pi, pi=3.14...)Now I spent some time searching for a solution to this. I found various discussions on the board, as well as a few papers, "Why the rotating algorithm works" and "The Little Heston trap" among them, however, I don't really see the solution to the problem. And I'm lost on how to implement the solution into Matlab.I think it all boils down to the wrong handling of the complex log in Matlab. Now let's say I have ln(z) where z is a complex number. What must I do exactly in Matlab to get some representation of ln(z) without the discontinuities?Or more specificly: If I try to calculate f2 from Shobel/Zhu [1999], and use the notation from this paper, then I have at some point C1 = log(dn); where dn is the denominator that is build from ch + g2.*sh;I somehow have to change C1 = log(dn) into a correct reprentation of the log.I tried C1 = log(abs(dn))+i*(abs(dn)+pi*2);as well asC1 = log(abs(dn))+i*angle(dn);but both does not work.I know that this problem has been discussed in a few threads here, so some of you guys must know the fix. Help much appreciated!
 
User avatar
AvH
Posts: 0
Joined: March 3rd, 2008, 11:45 am

Complex logarithm in Heston model

August 6th, 2008, 12:42 pm

The paper of Lord and Kahl or the paper of Schoutens might help.see http://ssrn.com/abstract=1105998 or http://perswww.kuleuven.be/~u0009713/HestonTrap.pdf
 
User avatar
GoGoFa
Posts: 0
Joined: March 3rd, 2005, 11:23 am

Complex logarithm in Heston model

August 8th, 2008, 6:19 am

Or use a formula which avoids difficulties, see http://ssrn.com/abstract=954785
 
User avatar
ASchmidt
Posts: 0
Joined: May 16th, 2007, 6:56 pm

Complex logarithm in Heston model

August 13th, 2008, 8:41 am

Hi,I have the solution to this. If you still need it, let me know and I can post some of my Matlab code.-A
 
User avatar
TimeTraveler
Topic Author
Posts: 0
Joined: July 3rd, 2008, 10:12 pm

Complex logarithm in Heston model

August 13th, 2008, 12:18 pm

just stop smoking!
 
User avatar
TraderJoe
Posts: 1
Joined: February 1st, 2005, 11:21 pm

Complex logarithm in Heston model

August 13th, 2008, 2:46 pm

.
 
User avatar
ASchmidt
Posts: 0
Joined: May 16th, 2007, 6:56 pm

Complex logarithm in Heston model

August 13th, 2008, 3:44 pm

Harassment!
 
User avatar
TraderJoe
Posts: 1
Joined: February 1st, 2005, 11:21 pm

Complex logarithm in Heston model

August 13th, 2008, 11:46 pm

.