Login  Register

Re: Variance Swap test

Posted by ziegele on Mar 01, 2017; 3:02am
URL: http://quantlib.414.s1.nabble.com/Variance-Swap-test-tp18059p18127.html

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



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

Unfortunately, the calculation result didn't match with expectation:



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!