Serving the Quantitative Finance Community

 
User avatar
ChrisJones16
Topic Author
Posts: 0
Joined: November 12th, 2008, 7:54 pm

Two-factor CIR model - Chen & Scott

September 27th, 2010, 5:27 pm

Hi AllI am trying to price a European option on a pure discount bond where the short rate is modeled using a two-factor CIR model. I am using Chen and Scott's paper to adjust the multivariate integral to a univariate integral and am loosely following their approach to evaluate such an integral.I am having difficulty with the standard non-central chi-squared density function on page 9. This formula appears fairly simple to calculate, except for evaluating the modified Bessel function of the first kind.Although I have used a different algorithm from that suggested in the paper to calculate the bessel function, my bessel function appears to be coded correctly - I have compared answers with those on the wolfram site (http://functions.wolfram.com/webMathema ... me=BesselI).The parameters inputted into this equation also appear correct.Currently the integral is evaluated using Simpson's rule whereby the x increases incrementally from 0 to L2 (or L2Star).Has anyone implemented this function? If so, can you provide any advice (or be willing to look at my VBA code)? There is something obvious that I am missing however I can't find my mistake.Many thanks
 
User avatar
srioae
Posts: 0
Joined: January 19th, 2005, 2:21 pm

Two-factor CIR model - Chen & Scott

November 5th, 2010, 12:07 pm

I've not got time to look at this at the moment but I've looked at this in the past and a few points I'd make:1. for very short dt you are likely to get numerical overflow/underflow in the CIR pdf (and in the bessel function). THis I'd say watch out for. Look at Abramowitz & stegun's approximation2. How are you doing the multivariate integral? If have say \int \int f(x,y) dx dy should define some inner integral I = \int f(x,y,) dx and then evaluate \int I dy
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

Two-factor CIR model - Chen & Scott

November 5th, 2010, 1:49 pm

Do you have a link to C&S article.Anyway, I suspect it is similar to Longstaff&Schwartz method which does produe a 2d integral in the pdfs but is a 1d integral in pdf and cdf. You will need to use midpoint rule and see if you still get the same as Simpson. etc.If you are using C++, you call Bessel, NCCHi^2 from the Boost library directly and you are finished.It is possible to call C++ from VBA, but that is another issue. Is Bessel in VBA is becoming very heavyweight. Don't rule out typo in formuae. edit: maybe post your VBA code to do a code review; I could maybe adapt it to call my C++ code. Here is code for calling NCCHi^2 from C# which is not a million miles from what you want in VBA.http://www.datasimfinancial.com/forum/v ... .php?t=111 (Aug 22 2009)
Last edited by Cuchulainn on November 4th, 2010, 11:00 pm, edited 1 time in total.