Fix variance swap fair strike with a dividend yield and reduced put grids - #282
Merged
Merged
Conversation
…rids EquityVarianceSwap.fair_strike had three defects: - The log-contract drift used r instead of r - q and the option portfolio was compounded by exp((r - q) T) instead of exp(r T). Under a flat volatility the fair variance strike was too high by about twice the dividend yield (0.128 instead of 0.090 for sigma = 30%, q = 2%). - When the requested put strikes reached below zero the strike list was truncated but the weight array and the pricing loop still used the requested count, raising IndexError. - The truncated grid could include a strike of exactly zero, where the log-contract weight is infinite. The existing test (q = 0) is unchanged. New tests check the fair strike against the squared flat volatility across rate and dividend combinations and with a put grid that reaches zero.
Owner
|
OK. Good find. Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EquityVarianceSwap.fair_strike(the Demeterfi, Derman, Kamal and Zhou replication) has three defects. Under a flat volatility the fair variance strike should be the squared volatility whatever the rate and dividend yield; currently:r * twhere the log-contract drift is(r - q) * t, and the option portfolio was compounded byg = exp((r - q) t)instead ofexp(r t)(DDKZ 1999, eq. 29, with the forwardF = S0 exp((r - q) t)). The error is about2 q, as the table shows.self.num_put_options, but allocates the weights and runs the pricing loop with the requested count, so it raisedIndexError(e.g. 140 puts with unit spacing from a forward near 103).-inf(ther == qrow above).Changes
(r - q)in the log-contract term andexp(r t)compounding of the option portfolio.self.num_put_options/self.num_call_optionsfor the weight arrays and the pricing loops.With the fix the fair strike is within 0.2% of the squared volatility for every combination above (the residual is the strike discretisation). The existing test uses
q = 0and is unchanged.Tests
Two new tests in
tests/unit/test_FinEquityVarianceSwap.py: a put grid that exceeds the positive strikes (no error, reduced count, fair strike within 2% of the flat volatility squared), and rate/yield combinations includingr == qwith a grid reaching zero (finite, within 1%). Full unit suite passes (1,060 tests).