Login  Register

Fwd: Marketmodel AbcdVol

Posted by Peter Caspers-2 on Aug 07, 2012; 6:38pm
URL: http://quantlib.414.s1.nabble.com/Marketmodel-AbcdVol-tp12030p12034.html

Did anyone have a chance to look into that possible bug?
Thank you very much
Peter

-------- Original-Nachricht --------
Betreff: [Quantlib-dev] Marketmodel AbcdVol
Datum: Sun, 27 May 2012 21:28:31 +0200
Von: Peter Caspers [hidden email]
An: [hidden email]


Hi Ferdinando, Mark, Klaus,

I am working in a project where we want to make use of the ql (1.1) implementation of the stochastic volatility libor forward model. The product we want to price is an exotic swap with payoff depending on Euribor6m and EUR CMS20y rates. The natural choice for the "rateTimes" therefore seems to be a 6m grid. The rates however are observed on a quarterly grid. My understanding is that I can choose the "evolutionTimes" possibly different from the rateTimes representing the needed fixing times. This is what I get from the description in evolutiondescription.hpp:

-# evolutionTimes = the times defining the rates that are to be evolved,
-# rateTimes = the times at which the rates need to be known,
-# relevanceRates = which rates need to be known at each time.
...


I believe the explanations for evolutionTimes and rateTimes are switched here.

The model I am using is AbcdVol(...). The observation is that the swaptions from the calibration basket are greatly overpriced in the simulation. I think this is due to the particular choice of the evolutionTimes grid being strictly finer than the rateTimes grid (which is equal to the correlation times grid coming from a TimeHomogeneousForwardCorrelation). This case is in my opinion not handled correctly when computing the covariance matrices for the evolution steps in the constructor of AbcdVol. To put it more precisely the underlying time intervals [effStartTime, effStopTime] are overlapping due to wrong left interval points then, thus leading to too high covariances (consistent with the observation of too high simulated swaption prices).

Here is my proposal to fix that in abcdvol.cpp

     AbcdVol::AbcdVol(
             Real a,
             Real b,
@@ -67,24 +69,25 @@ namespace QuantLib {
                    "number of factors (" << numberOfFactors <<
                    ") must be greater than zero");
 
         AbcdFunction abcd(a, b, c, d);
         Real covar;
-        Time effStartTime, effStopTime;
+        Time effStartTime, effStopTime=0;
         Real correlation;
         const std::vector<Time>& corrTimes = corr->times();
         const std::vector<Time>& evolTimes = evolution.evolutionTimes();
         for (Size k=0, kk=0; k<numberOfSteps_; ++k) {

             // one covariance per evolution step
             Matrix covariance(numberOfRates_, numberOfRates_, 0.0);
 
             // there might be more than one correlation matrix
             // in a single evolution step
             Matrix correlations;
 
             for (; corrTimes[kk]<evolTimes[k]; ++kk) {
-                effStartTime = kk==0 ? 0.0 : corrTimes[kk-1];
+                effStartTime = effStopTime;
                 effStopTime = corrTimes[kk];
                 correlations = corr->correlation(kk);
                 for (Size i=0; i<numberOfRates_; ++i) {
                     for (Size j=i; j<numberOfRates_; ++j) {
                         covar = ks[i] * ks[j] * abcd.covariance(effStartTime,
@@ -95,11 +98,11 @@ namespace QuantLib {
                         covariance[i][j] += covar * correlation;
                     }
                 }
             }
             // last part in the evolution step
-            effStartTime = kk==0 ? 0.0 : corrTimes[kk-1];
+            effStartTime = effStopTime;
             effStopTime = evolTimes[k];
             correlations = corr->correlation(kk);
             for (Size i=0; i<numberOfRates_; ++i) {
                 for (Size j=i; j<numberOfRates_; ++j) {
                     covar = ks[i] * ks[j] * abcd.covariance(effStartTime,



Do you think this is correct and complete? The testsuite shows no differences at least and results are much better after these changes.

Thanks a lot
Peter








 





------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

Nachrichtenteil als Anhang (402 bytes) Download Attachment
Nachrichtenteil als Anhang (173 bytes) Download Attachment