SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
ckarakus
Topic Author
Posts: 474
Joined: October 28th, 2004, 8:05 am

Perturbation Engine for greek calculations

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,
 
User avatar
Siberian
Posts: 298
Joined: June 25th, 2003, 8:56 pm

Perturbation Engine for greek calculations

June 27th, 2008, 12:30 pm

I would be very interested, i was just beginning to build one!Much appreciated,Siberian
 
User avatar
wynand494
Posts: 65
Joined: February 20th, 2004, 5:22 am

Perturbation Engine for greek calculations

June 28th, 2008, 9:51 am

 
User avatar
wynand494
Posts: 65
Joined: February 20th, 2004, 5:22 am

Perturbation Engine for greek calculations

June 28th, 2008, 10:06 am

Even I am very curious why generic risktools are not implemented. Basically, one needs to be able give a vector of perturbables. A matrix of different states where each column represents the extent of bump required each for each the perturbables from the base state and get the output vector of PV(or Greeks) corresponding to each state.I see the following advantages with such a generic risktool.1) Would be a very powerful tool for any trading desk. I suppose the only issue is speed but I would anyday not mind having a overnight (maybe even overweek if needed !) batch run the tool for all the states that I want. 2) An excellent valdation tool for any quant team implementing an product/trade specific analytical greek in order to speed things. Loads of times analytical greeks do not match the numerical greeks for some products and only the numerical greeks actually matter for a trading desk.Would be great to know if the geneic risk tool is actually used by a lot of people?
 
User avatar
untwigged
Posts: 262
Joined: January 14th, 2006, 3:21 pm

Perturbation Engine for greek calculations

June 29th, 2008, 1:22 pm

This type of generic risk pertubation is very common in overnight batch runs at the investment banks I've worked at. Oddly though as ckarakus says valuation libraries seldom do it.
 
User avatar
ckarakus
Topic Author
Posts: 474
Joined: October 28th, 2004, 8:05 am

Perturbation Engine for greek calculations

June 30th, 2008, 3:37 pm

Here is the code for the python implementation (I am sending the whole workspace so that you can run it yourself hopefully)This is just a prototype implementation Though I found it promising so that I will proceed with a C++ design/implementationIn a bigger library framework you have to make sure that models can in some way collaborate with perturbation engine to do things like- grid geometry preservation in finite difference models to prevent numerical anomalies- pathwise integration in monte carlo greek calculations ...
Attachments
pertubation-sensitivity-framework.zip
(38.46 KiB) Downloaded 17 times
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On