Thanks Luigi!
I bypassed the problem by replacing flatRate() as defined in utilities.hpp
with the FlatForward class. As shown in the screenshot below, the
calculation matches with expected result very well. I also included the cpp
codes in attachment ( flat.cpp
<http://quantlib.10058.n7.nabble.com/file/n18127/flat.cpp> ).
<http://quantlib.10058.n7.nabble.com/file/n18127/match.jpg>
Naturally, the next step is to replace flat interest rate and dividend with
a term structure. So I tried the InterpolatedZeroCurve class. In order to
make sure that I get this class setup correctly, I defined a flat interest
rate terms structure, to compare with the FlatForward results. The code is
also attached ( termStructure.cpp
<http://quantlib.10058.n7.nabble.com/file/n18127/termStructure.cpp> ).
Unfortunately, the calculation result didn't match with expectation:
<http://quantlib.10058.n7.nabble.com/file/n18127/mismatch.jpg>
My guess is that, building flat forward curve from a flat interest rate term
structure should use some other functions. How should I correctly
interpolate the term structure, so that I can:
1) match with the constant div and r at the first step;
2) introduce non-flat interest rate and dividend term structure?
Thanks!
--
View this message in context: http://quantlib.10058.n7.nabble.com/Variance-Swap-test-tp18059p18127.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Free forum by Nabble | Disable Popup Ads | Edit this page |