Serving the Quantitative Finance Community

 
User avatar
badgerbadger
Topic Author
Posts: 0
Joined: November 9th, 2006, 9:44 pm

Bessel Function for Heston's model

November 10th, 2006, 4:25 pm

Hi all!Referring to Broadie&Kaya's "Exact Simulation of Stochastic volatility and Affine Jump Diffusion Processes"I'm trying to calculate a Modified Bessel Function of the First kind with real positive order and complex argument.I'm trying with C++ but I can't find the code (and to write it by myself isn't so easy!!!).What I find on the net is either for integer orders or for real arguments but not for both!!!Does anyone can help me, please
 
User avatar
INFIDEL
Posts: 0
Joined: November 29th, 2005, 4:17 pm

Bessel Function for Heston's model

November 11th, 2006, 1:33 pm

Quotebadgerbadger:I'm trying to calculate a Modified Bessel Function of the First kind with real positive order and complex argument.Why not try the series representation Eq. (3) in Modified Bessel Function of the First Kind .
 
User avatar
INFIDEL
Posts: 0
Joined: November 29th, 2005, 4:17 pm

Bessel Function for Heston's model

November 11th, 2006, 1:42 pm

Much better, just use your existing routine for J_nu(z):I_nu(z) = Exp(-i nu Pi/2) J_nu(z Exp(-i Pi/2)),as long as -Pi < arg z <= Pi/2.Edit: complex i's look better in lower case on this forum.
Last edited by INFIDEL on November 10th, 2006, 11:00 pm, edited 1 time in total.
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Bessel Function for Heston's model

November 11th, 2006, 1:42 pm

numerical recipes books are floating around free on the web: you'll have to type in the code yourself from the pdf file you view online.
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Bessel Function for Heston's model

November 11th, 2006, 2:47 pm

QuoteOriginally posted by: INFIDELEdit: complex i's look better in lower case on this forum.the more so when you're already using upper case "I" as the modified bessel function
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Bessel Function for Heston's model

November 11th, 2006, 2:48 pm

QuoteOriginally posted by: INFIDELMuch better, just use your existing routine for J_nu(z):I_nu(z) = Exp(-i nu Pi/2) J_nu(z Exp(-i Pi/2)),as long as -Pi < arg z <= Pi/2..as this implies, the real and complex bessel functions are the same provided you're in the appropriate region of the complex plane.You just need to make sure your code knows which variables are complex
 
User avatar
INFIDEL
Posts: 0
Joined: November 29th, 2005, 4:17 pm

Bessel Function for Heston's model

November 12th, 2006, 12:21 pm

QuoteOriginally posted by: ppauperQuoteOriginally posted by: INFIDELEdit: complex i's look better in lower case on this forum.the more so when you're already using upper case "I" as the modified bessel functionIt would have made an interesting implicit definition of a new unknown function I. The transmogrified Bessel function?
 
User avatar
badgerbadger
Topic Author
Posts: 0
Joined: November 9th, 2006, 9:44 pm

Bessel Function for Heston's model

November 13th, 2006, 7:45 am

Thanks INFIDEL and ppauper but using I_nu(z) = Exp(-i nu Pi/2) J_nu(z Exp(-i Pi/2)), as long as -Pi < arg z <= Pi/2.the problem still remains... the argument is still complex and I can't find any code for J_nu(z) as well...
 
User avatar
INFIDEL
Posts: 0
Joined: November 29th, 2005, 4:17 pm

Bessel Function for Heston's model

November 13th, 2006, 10:31 am

Get Press, Teukolsky et. al.
 
User avatar
badgerbadger
Topic Author
Posts: 0
Joined: November 9th, 2006, 9:44 pm

Bessel Function for Heston's model

November 13th, 2006, 12:33 pm

INFIDEL,the formula you posted maps the real axis in the imaginary one.What I need is the Modified Bessel Function of the First kind computed for an ARBITRARY COMPLEX ARGUMENT (not only a pure imaginary number). For instance, if I want the function I_nu(z) for z = 1+i how can I use your suggestion?
 
User avatar
badgerbadger
Topic Author
Posts: 0
Joined: November 9th, 2006, 9:44 pm

Bessel Function for Heston's model

November 13th, 2006, 12:42 pm

PPAUPER,I looked at the numerical recipes book but all I can find works only for REAL ARGUMENT. Is there any way of using those routines also for complex argument (not only of the form a*i of course)?Thanks
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Bessel Function for Heston's model

November 13th, 2006, 1:16 pm

QuoteOriginally posted by: badgerbadgerThanks INFIDEL and ppauper but using I_nu(z) = Exp(-i nu Pi/2) J_nu(z Exp(-i Pi/2)), as long as -Pi < arg z <= Pi/2.the problem still remains... the argument is still complex and I can't find any code for J_nu(z) as well... ?"argument" is being used in 2 senses here and we're talking at cross purposes.the "argument" of J_nu(z) is z.the "argument" of a complex number z, arg zis a number such that z= |z| exp(i arg z), so tan(arg z)=y/xWhat folks are telling you is the code for real z can also be used for complex z, provided that z is in the correct region of the complex plane.The only change you need to make is declare the variables as complex
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Bessel Function for Heston's model

November 13th, 2006, 2:00 pm

code in fortran for Bessel I with complex arguments taken care ofcbesi.fport it to c yourself
Last edited by ppauper on November 12th, 2006, 11:00 pm, edited 1 time in total.
 
User avatar
badgerbadger
Topic Author
Posts: 0
Joined: November 9th, 2006, 9:44 pm

Bessel Function for Heston's model

November 13th, 2006, 4:00 pm

PPAUPER! That's really a Great Idea!!!The code takes only about thousands lines...Hoped someone just did it before
 
User avatar
jfuqua
Posts: 6
Joined: July 26th, 2002, 11:41 am

Bessel Function for Heston's model

November 13th, 2006, 4:29 pm

I think there are still free-ware that converts Fortran to 'C.' One I last used---sorry don't recall the name---was very good but the C code won't be easy to understand. One someone else used made the 'C' code easy to follow.