From: Gary K. <gar...@gm...> - 2005-06-26 09:58:53
|
I have seen automatic differentiation used once an analytic library to avoid the tedious derivation of the barrier greeks by hand, and managing the resulting code. I thought it quite elegant, but care needed to be taken to avoid roundoff errors and also performance problems when too many objects were instantiated. Gary On 6/24/05, Luigi Ballabio <lui...@gm...> wrote: >=20 > On 06/23/2005 06:55:26 PM, Daniel J. Duffy wrote: > > Maybe you could modify Quantlib FDM schemes to handle greeks. It's > > fairly easy. Just take divided diference of price to get delta. I > > have done it and its OK. >=20 > That is a possibility---and indeed, delta and gamma are calculated in > this way in all finite-difference engines---but one would have to write > a FD engine for Barrier options first, which is missing at this time. >=20 > As to the current analytic engine, one could write down the implemented > formula and derive it; it's a bit of tedious work, but possible. After > one's done that, one'd just assign the corresponding variable, as in: >=20 > results_.value =3D C(1,1) + E(1); // an existing switch case > results_.delta =3D (the expression one found); >=20 > in every switch and if clause. >=20 > Alternatively, a numerical estimate can be obtained by calculating the > analytic prices P1 and P2 for underlying prices (u0 - du) and (u0 + > du), respectively, where du is a small increment and approximate delta > as (P2-P1)/(2*du). (Daniel, was this what you were suggesting?) >=20 > Later, > Luigi >=20 > ---------------------------------------- >=20 > Prediction is very difficult, especially if it's about the future. > -- Niels Bohr >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick > _______________________________________________ > Quantlib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |