I am looking into a 2s5s10s swaps idea using a 50-50 weighting scheme, where it's 2 times the 5 year minus the 2 year and 10 year. However, there is a correlation between the butterfly spread and the slope of the curve (2s10s) and also with the 5 year. I want to adjust the weights of my butterfly to remove the directionality such that I still want the body to have a weight of 2.

Essentially, I think it should be X : 2 : Y but I am having a hard time.

  • $\begingroup$ Hi - just to understand, are you saying that you want your butterfly to be flat/hedged to 2s10s steepening/flattening given the 5y correl you observe to 2s10s? $\endgroup$ – Mehness Jun 28 '18 at 11:35
  • $\begingroup$ basically would be good to know how you want to make money in the trade and what you want to hedge out. Eg are you hedging a 2s10s slope Or do you want to make money on 2s10s steepening/flattening whilee being overall dv01 neutral given what you expect to happen to 5y etc.. $\endgroup$ – Mehness Jun 28 '18 at 11:39
  • $\begingroup$ I think it may more simpler than that. Spoke to a trader, they said if you regress the 2s5s10s with the 2s10s and 5y as the independent variable, you'll get coefficient of b1 for the 2s10s slope and b2 for 5y. Then this is where I get lost: the weight would be 1 - b1 for the 2y, 2 for the 5y, etc... Why is the weight 1- b1 $\endgroup$ – VanillaCall Jun 28 '18 at 23:29

I think he's saying that if

$$ Fly=b_1(2s-10s) + b_2(5s) + error $$

But $$ Fly= 2s-2(5s)+10s $$

Then doing some algebra ,

$$ (1-b_1)2s -(2-b_2)5s + (1+b_1)10s = error $$

Hence the weights of the fly that give pure noise , un correlated to curve and rate , are as given above. If you want 2 in the middle , you have to rescale.

  • $\begingroup$ Thanks, this makes intuitive sense. So the second equation is your original fly and you subtract the first equation which results in the weights such that your neutralizing curve and rate components so you're trading based on the error term. $\endgroup$ – VanillaCall Jun 29 '18 at 3:15
  • $\begingroup$ Follow up question, I've tested this on one fly and notice that even the error term has directionality with the curve and rate. Could something else in the error term still be directional with the curve and rate? $\endgroup$ – VanillaCall Jul 18 '18 at 0:44

Method 1: PCA directionality hedged

Here is one way to do it using PCA and hedging the directionality implied by the first principal component.

Since you have quoted 3 effective instruments; 2s5s10s, 2s10s and 5Y you will observe that you can derive these instruments from the underlying 2Y, 5Y, and 10Y. That is;

$$ \begin{bmatrix} 5Y \\\ 2s10s \\\ 2s5s10s \\ \end{bmatrix} = \begin{bmatrix} 0 & 1 & 0 \\\ -1 & 0 & 1 \\\ -1 & 2 & -1 \end{bmatrix} \begin{bmatrix} 2Y \\\ 5Y \\\ 10Y \end{bmatrix} , \quad or \quad P_2 = A P_1$$ where $P_1$ and $P_2$ are your set of prices in the different basis systems.

You can also observe that if you have the covariance matrix of the instruments in $P_1$, say $Q(P_1)$, then the covariance of the instruments of basis $P_2$ can be obtained with: $$Q(P_2) = A Q(P_1) A^T \quad \implies \quad Q(P_1) = A^{-1}Q(P_2)A^{-T}$$ So you can work in both basis systems but I'm going to focus on the default $P_1$ system.

If you now derive your eigenvalues and eigenvectors of $Q(P_1)$ take the eigenvector corresponding to the highest eigenvalue - this is the first principal component (PC1). In order to hedge this component so that you have no risk exposure to it, take your underlying trade proposition and divide it by the elements of PC1:

$$ \begin{bmatrix} 2Y: -1 \\\ 5Y: +2 \\\ 10Y: -1 \end{bmatrix} \div \begin{bmatrix} PC1_{2Y} : 0.660 \\\ PC1_{5Y} : 0.604 \\\ PC1_{10Y} : 0.447 \end{bmatrix} = \begin{bmatrix} -1.51 \\\ 3.31 \\\ -2.24 \end{bmatrix} \propto \begin{bmatrix} -0.91 \\\ 2.00 \\\ -1.35 \end{bmatrix} $$

Method 2: Minimising VaR approach

A second considered way would be to suppose you trade 5Y and seek the combination of 2Y and 10Y positions to minimise your VaR. This allows you then maximise the absolute 5Y size relative to your target VaR of the trade.

Suppose you have the following risk:

$$S = \begin{bmatrix} 2Y: 0 \\\ 5Y: 2 \\\ 10Y: 0 \end{bmatrix} $$ and now you evaluate what positions in 2Y and 10Y give the smallest VaR. For the same covariance matrix as I used above to derive the PCA the answer is:

$$ S^* = \begin{bmatrix} 2Y: -1.48 \\\ 5Y: 2.00 \\\ 10Y: -0.38 \end{bmatrix} $$

This is an optimisation problem solvable with a numeric solver or more simply actually with analytic calculus but I'm not going to cover that here, the link below has it.

These methods are obviously fundamentally different but each has merit against a specific view, you are more likely in your position to favour the first. The differences here are such that the 2Y has a much higher correlation with 5Y directly so it is a better hedge to reduce VaR by overweighting it, whereas with PCA the 10Y moves less so you need more risk it in to have a directionality hedge.

Note if you want to try this yourself you can use the $Q(C)$ covariance matrix values for the 2Y, 5Y, and 10Y trades in this link: http://www.tradinginterestrates.com/revised/PCA.xlsb Note that all of this material I got from Darbyshire Pricing and Trading Interest Rate Derivatives.


Method 3: Multivariable Least Squares Regression

If we include the third method from @dm63 of multivariable regression of the form:

$$ \mathbf{y} - \mathbf{\beta x} = \mathbf{\epsilon} $$

then your optimal estimators for $\mathbf{\beta}$ are given by,

$$ \mathbf{\hat{\beta}} = \mathbf{(x^Tx)^{-1}x^T y} $$

and as he states the trade weights are given as $(-(1-\beta_1), 2-\beta_2, -(1+\beta_1))$


As an example I tried all three of these methods out on some EUR swap sample data from 2016. From Jan-1 to Jun-30 is my sample data and from Jul-1 to Dec-22 is my out of sample back test. Below I have plotted the results. The interesting thing is that the multivariable regression is actually has smallest volatility in this out-of-sample data, but the minimum var has almost the same volatility. And of course min Var will have the lowest volatility over the sample data from which it was derived by definition. enter image description here enter image description here

If you are interested in the code...

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

df_hist = pd.read_csv('historical_daily_changes.csv', index_col='DATE', parse_dates=True)
df_fore = pd.read_csv('forecast_daily_absolues.csv', index_col='DATE', parse_dates=True)
z = df_fore[['2Y', '5Y', '10Y']].values

# Method 1: PCA directionality weighted trade
x = df_hist[['2Y', '5Y', '10Y']].values
Q = np.cov(x.T)
eval, evec = np.linalg.eig(Q)
w = np.array([-1 / evec[0, 0], 2 / evec[1, 0], -1 / evec[2, 0]])
print('Weights for trade using PCA are:', 2*w[0]/w[1], 2, 2*w[2]/w[1])
df_fore['PCA'] = 100 * (w[0]*z[:, 0] + w[1]*z[:, 1] + w[2]*z[:, 2]) * 2/w[1]

# Method 2: Minimum Variance approach
Q = np.cov(x.T)
Q_hat = Q[[0, 2], :]
Q_dhat = Q_hat[:, [0, 2]]
w[[0, 2]] = -np.einsum('ij,jk,k->i', np.linalg.inv(Q_dhat), Q_hat, np.array([0,2,0]))
w[1] = 2
print('Weights for trade using min VaR are:', 2*w[0]/w[1], w[1], 2*w[2]/w[1])
df_fore['Min VaR'] = 100 * (w[0]*z[:, 0] + w[1]*z[:, 1] + w[2]*z[:, 2]) * 2/w[1]

# Method 3: Multivariable least square regression
x = df_hist[['2Y10Y', '5Y']].values
y = df_hist[['2Y5Y10Y']].values
beta = np.matmul(np.linalg.pinv(x), y)
w = np.array([-(1-beta[0]), 2-beta[1], -(1+beta[0])])
print('Weights for trade using MVLSR are:', 2*w[0]/w[1], 2, 2*w[2]/w[1])
df_fore['MVLSR'] = 100 * (w[0]*z[:, 0] + w[1]*z[:, 1] + w[2]*z[:, 2]) * 2/w[1]

# Plot an out of sample forecast
fig, ax = plt.subplots(1,1)
ax.plot_date(df_fore.index, df_fore['2Y5Y10Y'] + 36, 'k-', label='2Y5Y10Y')
ax.plot_date(df_fore.index, df_fore['MVLSR'] + 6.7, 'r-', label='MVLSR weights')
ax.plot_date(df_fore.index, df_fore['PCA'] - 2.3, 'g-', label='PCA Weights')
ax.plot_date(df_fore.index, df_fore['Min VaR'] + 14.9, 'b-', label='Min VaR weights')

print(df_fore[['2Y5Y10Y', 'MVLSR', 'PCA', 'Min VaR']].diff().describe())
  • $\begingroup$ +1, was made to learn PCA pretty much first day on a swaptions desk eons back, ubiquitous and used heavily in rates, funny how never really taken up as much elsewhere, defo has its place... $\endgroup$ – Mehness Jun 28 '18 at 17:47
  • 1
    $\begingroup$ This is such a great answer that if I could upvote it multiple times I would =) The only thing I'd add is that quantitative methods won't also be sufficient to neutralize level/slope exposures. For example, for quite a few years before the Fed started hiking again, 2y rates barely moved. In those years, it doesn't matter how much structuring you do – your 2s/x/y fly will behave like an x/y curve... $\endgroup$ – Helin Jun 29 '18 at 0:13
  • $\begingroup$ @Helin - I guess that's the thing abt PCA, components (and eigenvalues/importance) change with regimes, you could never expect your timeseries and derived components/importance to be stable... but it does have its uses but only if you have a good feel for the regime you're in, so like all things, needs a bit of 'nous' in application :) $\endgroup$ – Mehness Jun 29 '18 at 0:53
  • $\begingroup$ Are you sure that the minimum variance approach the multi-variate regression approach aren't doing the same thing? $\endgroup$ – Jared Aug 15 '18 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.