|
From: Klaus S. <kl...@sp...> - 2009-04-23 22:06:56
|
Hi Michael, you wrote > To be a bit more precise the problem lies in the second derivative of the > black variance with respect to the strike. Even if I take surfaces without > Smile/Skew, i.e. flat ones, I still get the problem there. This is because > (wp-2.0*w+wm) is not exactly zero but very very small. And this gets > devided by 0. 000000000001. To me the root of the problem was the line dy = ((y!=0.0) ? y*0.000001 : 0.000001); For ve y small y this code leads to unrealistic small dy and to numerical problems during the calculation of the difference quotient. Therfore I've changed it into dy = ((std::fabs(y) > 0.001) ? y*0.0001 : 0.000001); and at least for my tests the numerical problems with the difference quotient disappeared. (pls see the latest version of localvolsurface.cpp in the SVN repository). Could you test this fix using your test cases? regards Klaus |