Skip to content

diegodalvarez/PCAFlylet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

PCA Flylets: Invariant Risk Metrics

Replicating the work from PCA: Invariant Risk Metrics and Representation of Residuals for Bond Returns SSRN Link

Background

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.

Data

First begin with the data. I was not able to find more historical Swaption data available on Bloomberg. image Then we can construct the various curves for each type image

Calculating Flylet Weight

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

Initial Flylets Rate

image 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. image And with a quick rolling-mean replacemenet by z-score cleaned the data. image

Calculating Flylet Volatility

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

About

Yield Curve Flylets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published