|
From: Joseph W. <jo...@co...> - 2005-10-05 03:29:30
|
Maybe the way to have both "smart libaries" and "smart users" is to have a singleton factory class which takes an instrument and then set it with the best guess pricing engine. For example PricingEngineHelper::setToFiniteDifference(instrument) setToBinomialTree setToMonteCarlo Luigi Ballabio wrote: > > On 10/01/2005 05:23:13 PM, Joseph Wang wrote: > >> I think this depends on user requirements. There is a trade-off >> between keeping track of these things so that the library figures >> out these things and letting the user use the library in ways that >> aren't mathematically correct but gets you a quick and dirty answer. >> >> Where this bothered me was if you use the analytic pricing engines >> against instruments with changing interest rates, you will get the >> wrong answer. > > > Not necessarily---for an European option, simply using the zero-yield > to maturity gives you the right price, not an approximation (the > actual shape of the yield term structure doesn't matter, only its > integral.) > > The principle I would stick to is that users know better. I'm afraid > that trying to have the library do what it thinks the Right Thing > might prevent users to do what they know to be the right thing. > > Later, > Luigi > > > ---------------------------------------- > > Hanlon's Razor: > Never attribute to malice that which is adequately explained > by stupidity. |