Serving the Quantitative Finance Community

 
User avatar
summer5e
Topic Author
Posts: 0
Joined: March 9th, 2006, 6:30 pm

A small question about matlab

March 10th, 2006, 11:26 am

I am implementing Berndt, Douglas, Duffie, Ferguson and Schranz (2003) framwork to price CDS using matlab.I can get quite reasonable implied suvival probability and implied credit spread. However, when I try to calibrate the market data, there is always a warning.I use the fsolve funtion in matlab and the result and warning information is as follows, Norm of First-order Trust-region Iteration Func-count f(x) step optimality radius 0 2 7.27479e-005 422 1 1 3 7.27479e-005 1.72366e-007 422 1 2 4 7.27479e-005 4.30916e-008 422 4.31e-008 3 6 8.68031e-006 1.07729e-008 224 1.08e-008 4 7 8.68031e-006 2.69322e-008 224 2.69e-008 5 8 8.68031e-006 6.73306e-009 224 6.73e-009 6 9 8.68031e-006 1.68327e-009 224 1.68e-009 7 10 8.68031e-006 4.20816e-010 224 4.21e-010 8 12 4.99746e-007 1.05204e-010 41.8 1.05e-010 9 13 4.99746e-007 2.6301e-010 41.8 2.63e-010 10 14 4.99746e-007 6.57526e-011 41.8 6.58e-011 11 15 4.99746e-007 1.64381e-011 41.8 1.64e-011 12 17 3.83025e-007 4.10954e-012 104 4.11e-012Optimization terminated: norm of relative change in X is less than max(options.TolX^2,eps) and sum-of-squares of function values is less than sqrt(options.TolFun).ans = -6.9000-6.9 is the initial value I gave the parameter. I changed a lot of initial values but it doesn't work.I am a beginner in matlab. Maybe this is a stupid question but I really don't know what is the reason. Could anybody tell me? Thanks a lot.
 
User avatar
eymen
Posts: 1
Joined: November 5th, 2004, 2:20 am

A small question about matlab

March 10th, 2006, 1:46 pm

Berndt has her code for that paper on her website at cmu.Check thatEymen
 
User avatar
matthewcroberts
Posts: 1
Joined: October 18th, 2001, 7:52 pm

A small question about matlab

March 17th, 2006, 3:33 pm

Something is wrong w/ your objective f'n. Basically, the message is saying that its not getting any variation as it perturbs your parameter. There is no easy diagnosis for this. Try creating a vector of params:p=-5:.01:-9;then compute the objective function at each value of p. Plot these series and see if it appears as it should.Matt.