#142 Code error in fdmblackscholesmesher.cpp

open
nobody
None
5
2012-01-19
2012-01-19
Simon
No

Line 68 currently reads
" std::pair<Real,Real>(std::log(cPoint.first),cPoint.second)));"
it should read
" std::pair<Real,Real>(std::log(cPoint.first),std::log(cPoint.second))));

Discussion

  • Hi Simon

    the first parameter must be given in log(cPoint.first) because the mesher is in log(S). The second parameter controls the number of grid points x_i that lie in the neighborhood of log(K). Therefore it is not a bug but a question of the convention we want to use to specify this density parameter.

    In the the past I've used the currently implemented convention that follows e.g. the Tavella book. If you want to change it we'll have to change the value of the density parameter in fdblackscholesvanillaengine.cpp etc from 0.1 to exp(0.1)~1.1. Because the implemented behavior should remain as it is.