Refactoring of voltermstructure.hpp

Posted by Marco Marchioro-2 on
URL: http://quantlib.414.s1.nabble.com/fx-in-Quantlib-tp2306p2309.html

Hello everybody,
and happy thanksgiving to everybody!
I'm trying to refactor the file voltermstructure.hpp

First of all I'd like to add few methods to compute the derivatives
of BlackVolTermStructure. These are needed to implement the method
described in Rebonato(Vol and Cor.) at chapter 6.
The added methods are

virtual double timeDerivative(...)
virtual double strikeDerivative(...)
virtual double strikeSecondDerivative(...)

and they would be implemented as finite difference in the
BlackVolTermStructure class.

Also, I would like to move part of the code in a new file
voltermstructure.cpp

Lastly, I do not understand the interface of the class
LocalVolTermStructure, e.g.,
       public:
         double localVol(const Date& date1,
                         const Date& date2,
                         double underlyingLevel,
                         bool extrapolate = false) const;
and similarly for the others.

If the volatility is local, how come there are two dates?
Should not we have something like the following?
       public:
         double localVol(const Date& date,
                         double underlyingLevel,
                         bool extrapolate = false) const;
and similarly for the others.

Can I drop the extra parameter?

Marco Marchioro.