Replicating the work from PCA: Invariant Risk Metrics and Representation of Residuals for Bond Returns SSRN Link
The paper which won the 2016 Risk.net buy-side quants of the year. The idea behind the paper is to develop a framework for finding sensitivities within the PCA-based space for interest rate derivatives. The main idea behind PCs is to find orthogonal vectors to the 2nd principal component for the local sensitivies. This codebase using data collected from Bloomberg with Treasury, Swaps, and ATM Swaption rates to find flylets. The flylets are unique to themselves and do not follow the 1x2x1 standard weighting.
First begin with the data. I was not able to find more historical Swaption data available on Bloomberg. Then we can construct the various curves for each type
In this case I've calculated flylet weight by finding orthogonal vectors in the L2 norm for specific tenors. Knowing that of the vectors of tenors per each PC will be zeroed when calculating hte flylet we can essentially cross the first two PCs of 3 dimensions with the respective tenors. I've doubled check that the flylets are orthogonal to the PCs and in the L2 norm. Of course I do not expect exact orthogonality when constructing these vectors but the results are enough for me be sure that these vectors are orthogonal. Although I'd admit the weighting that I found for these vectors are less (in absolute) terms than what the authors had found which I am a bit concerned with. Below are the weights of specific flylets
Although these flylet rates look a bit probablamtic I've sourced the problem which arises from the use of shorter term tenors. The various swaption tenors that I'd pulled from Bloomberg were very short term and they followed the step-like function of the Fed Funds Rate. I compared those flylets rate to the standard 1x2x1 weighting and examined similar behavior. Picking longer dated tenors allowed for better flylet rates. In this case I'm using the swaption rate. And with a quick rolling-mean replacemenet by z-score cleaned the data.
Throughout the majority of the repo I decided to use differenced yields rather than percent change of yields due to dividing by a small number which would create spikes within the data. The same approach was necessary when calculating volatility.