Login  Register

Re: [Quantlib-dev] isTimeDependent ???

Posted by Luigi Ballabio on Sep 30, 2005; 9:35am
URL: http://quantlib.414.s1.nabble.com/isTimeDependent-tp4060p4067.html

On 09/30/2005 04:18:51 PM, Joseph Wang wrote:
> What do people think about adding an "isTimeDependent()" method to  
> things like TermStructure?  This would be defaulted to "true" as a  
> virtual function which subclasses could then set to false.
>
> The reason for this is that then the pricing engines could really  
> make use of this information to decide whether or not to optimize a  
> calculation.  For finite difference methods this could be a huge time  
> saver, and simplify the code considerably.

I would leave that to the user. Namely, I would rather add an  
isTimeDependent parameter to the engine constructor, defaulting to  
false. If enabled, the engine would optimize the calculation. It seems  
to me to have two advantages: 1) it doesn't try to be too smart, which  
is often more difficult that it's worth; 2) it makes it possible to  
optimize the calculation even when the term structures are not  
constant; a user could take a time-dependent term structure, and still  
decide that for a simple European option he can just use the zero-yield  
to maturity.

Luigi


----------------------------------------

Newton's Law of Gravitation:
        What goes up must come down.  But don't expect it to come down
        where you can find it.  Murphy's Law applies to Newton's.