Login  Register

Re: Variance Swap test

Posted by Luigi Ballabio on Apr 06, 2017; 8:20am
URL: http://quantlib.414.s1.nabble.com/Variance-Swap-test-tp18059p18175.html

The difference might be that in the flat forward case your curve starts at today's date, while in the interpolated case it starts at February 24th and the discount factors used in the calculation will change accordingly.  You should try using today as the first date in the vector instead.

Luigi


On Wed, Mar 1, 2017 at 4:04 AM ziegele <[hidden email]> wrote:
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

------------------------------------------------------------------------------
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