HestonDAXCalibration with dividends

Posted by nabbleuser2008 on
URL: http://quantlib.414.s1.nabble.com/HestonDAXCalibration-with-dividends-tp6414.html

Hi,
 I've modified parts of the test-suite/hestonmodel.cpp to incorporate dividends. Specifically, I've changed the testDAXCalibration method to include some descrete divident values (paid at the same dates in the program) as follows (full source code attached):

vector<Real> dividends;

for (i = 0; i < 8; ++i) {

        dates.push_back(settlementDate + t[i]);

        rates.push_back(r[i]);

        dividends.push_back(0.1);

}


 Handle<YieldTermStructure> dividendTS(
     boost::shared_ptr<YieldTermStructure>(
     new ZeroCurve(dates, dividends, dayCounter)));


When I run the program, it aborts. On Linux, I get the following trace using gdb.
Continuing.
Testing Heston model calibration using DAX volatility data...

Program received signal SIGABRT, Aborted.
0x0000002a9643f479 in raise () from /lib64/tls/libc.so.6
(gdb) where
#0  0x0000002a9643f479 in raise () from /lib64/tls/libc.so.6
#1  0x0000002a96440abf in abort () from /lib64/tls/libc.so.6
#2  0x0000002a9606fca6 in __cxxabiv1::__terminate ()
   from /usr/lib64/libstdc++.so.5
#3  0x0000002a9606fcd3 in std::terminate () from /usr/lib64/libstdc++.so.5
#4  0x0000002a9606fdc3 in __cxa_throw () from /usr/lib64/libstdc++.so.5
#5  0x0000000000489b6e in InterpolatedZeroCurve (this=<value optimized out>,
    dates=<value optimized out>, yields=<value optimized out>,
    dayCounter=<value optimized out>, interpolator=<value optimized out>)
    at /QuantLib-0.8.1/ql/termstructures/yieldcurves/zerocurve.hpp:150
#6  0x000000000043d370 in main (argc=<value optimized out>,
    argv=<value optimized out>) at HestonDAXCalibration.cpp:73


Could someone point out what I'm doing wrong. Thank you very much.


HestonDAXCalibration.cpp