June 26th, 2008, 12:23 pm
Has anyone implemented a generic perturbation engine for their valuation library to compute all the greeks reported by the library in a uniform and generic way?After seeing in multiple valuation libraries how greeks might be inconsistently reported as a result of valuation run it occured to me that its best that greek calculations to be taken care of generically by a Perturbation engine which will calculate sensitivities numerically by shocking various static and market data and revalue the instrument a couple of times.Of course it would be nice to calculate greeks analytically but for most non-trivial models its either not possible or impractical to do so. For the cases where we have analytical greeks the models are usually are very fast and it is perfectly fine to compute greeks numerically by shocking the parameters and running valuation a couple of times. And for MC valuations you have no other option but to do it numericallySo my first question is why this idea is not very prevalent in valuation libraries?I have worked on 4-5 valuation libraries so far and none of them had a very genericgreek computation engine. A common theme is each model calculates/reportsgreeks sepately/independently.Is it just ignorance on the part of library designers or there might be some technical issues I might be ignoring?I have implemented a proof of concept implementation of my initial ideas in python.It works fine and I am going to redesign/implement it in C++ so that I can make a it a central/architectural piece of the valuation library I am working onI am happy to post the code here to let people to see/play with it if there is any interestcheers,