Forums > Pricing & Modelling > PCA and continuous futures time series

 Page 1 of 1
Display using:
 bullero Total Posts: 57 Joined: Feb 2018
 Posted: 2018-10-15 19:02 Brief background story: I had a discussion today with my colleague regarding PCA and how he uses the framework to study the interest rate markets. Inspired by this stuff we then tried to apply the same methodology to the the Treasury futures and came across with quite an arbitrary issue: How to concatenate the different treasury futures expiries together to create continuous time series s.t. the interpretation of the eigenvectors remain equivalent with those obtained when the decomposition is being applied to spot starting swap rates? I guess people here are aware of the fact that there are several approaches to handle the creation of continuous contracts. From purely technical perspective its only a mathematical exercise. One could for example transform the price series into returns and concatenate the different expiries in the return space. Or, one could think of holding a long position in the current active contract and then roll on to the next expiry near expiration and subsequently create PnL stream representing the contract. Or, one could adjust the series by the contango/backwardation value at the time of rolling. So there are several ways to do this none of which seem immediately "optimal".However, I am not quite sure if the results, or more concretely, if the eigenvectors are comparable between different rolling methodologies.Any thoughts and/or suggestions?
 nikol Total Posts: 854 Joined: Jun 2005
 Posted: 2018-10-15 20:04 Before doing any PCA I would recommend to go into the space of IBORs implied from futures and Swaps... and then you don't need 'continuous contracts' concept.
 ronin Total Posts: 515 Joined: May 2006
 Posted: 2018-10-17 14:56 This has nothing to do with PCA - it's just a question about yield curve interpolation.You do actually have the exact same issue with the swap curve. You interpolated the swaps in some way, you are just glossing over it.The answer is that you should consider how you would hedge a cashflow between two roll dates. If you hedge it with the next expiry contract, interpolate piecewise constant right. If you hedge it with the previous expiry, interpolate piecewise constant left. If you hedge it with a pro rata mix of two surrounding expiries, interpolate piecewise linear. Etc. "There is a SIX am?" -- Arthur
 bullero Total Posts: 57 Joined: Feb 2018
 Posted: 2018-10-17 19:45 Thanks for input guys. However, I think I was not clear enough when stating the problem. The end goal is to apply PCA to time series of futures prices.
 nikol Total Posts: 854 Joined: Jun 2005
 Posted: 2018-10-17 21:05 It's well understood... .Perhaps, you can spline term structure of curve of futures quotes to be able to apply PCA at points with fixed time-to-maturity, because quote's time-to-maturity is constantly decreasing. But still, in my opinion the main principle holds: "garbage in - garbage out"
 ronin Total Posts: 515 Joined: May 2006
 Posted: 2018-10-18 14:11 > The end goal is to apply PCA to time series of futures prices.Yes, been done. Many times. You will find three PCs - parallel shift, steepening and curvature. The rest is noise. "There is a SIX am?" -- Arthur
 deeds Total Posts: 459 Joined: Dec 2008
 Posted: 2018-10-18 16:02 I wonder if there aren't 'feints' or 'tells' prior to detectable shifts, butterflies, twists that are invariant and PCA detectable from the noise once the three top PCs are 'removed'...is that a crazy thought?From an 'engineering' point of view i'd expect something like that in a reasonably stable system.anybody know of any papers?
 EspressoLover Total Posts: 384 Joined: Jan 2015
 Posted: 2018-10-18 19:25 @deedsIn some sense On-The-Run/Off-The-Run spread kind of does what you're suggesting.The reason we only use a three-factor model, isn't because there's no additional structure outside those eigenvectors. It's because the PCA approach itself is not capable of recovering that additional structure. One reason is the random matrix noise is too large relative to the magnitude of the smaller eigenvalues. I'm pretty sure the 21 year coupon strip still co-moves with the 22 year coupon strip even after accounting for level/duration/skew. But the noise from the other 28 years washes it out.The second reason is if the structure itself does not conform to projection onto fixed maturities. OTR spread is a specific example. You can't just come up with a static weighting of spot rates. The components of the spread changes over time as individual bonds rotate out of on-the-run status. Another example would be an intra-curve momentum factor. Again the weights on this factor change dynamically over time, so PCA will never recover it.PCA is one tool in the toolbox. And its capabilities and limitations have been tested again and again in this context. It's not going to give you anything new and surprising that hasn't already been discovered a thousand times over the past three decades. But it is a very good way to build a starting framework in a way that streamlines more exotic analysis. Good questions outrank easy answers. -Paul Samuelson
 ronin Total Posts: 515 Joined: May 2006
 Posted: 2018-10-19 10:40 > The reason we only use a three-factor model (...) because the PCA approach itself is not capable of recovering that additional structureIt is even simpler than that. To leading order, you just happen to describe any curve quite well with height, steepness and curvature. Why do volatility surface models start with three parameters per maturity? Same reason - because three parameters describe most of what you need in a curve. Any curve.If you add extra degrees of freedom, you can calibrate it better but the model can go in more directions. That could be good, and it could be bad.> I wonder if there aren't 'feints' or 'tells' prior to detectable shifts@deeds, there are loads. Scalping the curve is a popular trade, and everybody who does it has their own angle. But afaik most of these angles come from understanding the dynamics of the underlying market, not from some black magic based on historical joint distributions of principal components. "There is a SIX am?" -- Arthur
 bullero Total Posts: 57 Joined: Feb 2018
 Posted: 2018-10-19 13:02 Thanks for input again. I still think some people here missed the point. I am not wondering what sort of results to expect from the analysis since that has been done, as ronin already mentioned, gazillion times in the past. My question was more about the "engineering" details regarding the data handling.
 deeds Total Posts: 459 Joined: Dec 2008
 Posted: 2018-10-19 13:17 Thanks, @R, @EL !
 Zer0Fit3 Total Posts: 1 Joined: Nov 2018
 Posted: 2018-11-26 22:30 Hey @bullero, I think this is what you are looking for:cntcontr.pdfI can't find the original post, but I've been digging into this topic for the past few days and stumbled across this.
 rickyvic Total Posts: 191 Joined: Jul 2013
 Posted: 2019-03-05 18:25 Cool... I think nobody bothered answering the question at the beginning as it is too boring.http://www.csidata.com/cgi-bin/getManualPage.pl?URL=backadjustedoverview.htmI am gonna add to the more interesting curve discussion.Certainly decomposing with pca relies on covariance or correlation estimation, you are decomposing that in the end.So I would be wary of the input you use to control that effect of noisy signals.Having said that it is also true that after you have used 3 factors on meaningful parts of the curve (say 2yr to 10yr, 1w to 12m, 10yr to 30yr+) then you are left with nearly no variance, certainly close to transaction costs magnitude.I would call that noise.One word of advise: identify the sources of risk you are trying to hedge or manage. "amicus Plato sed magis amica Veritas"
 Jurassic Total Posts: 277 Joined: Mar 2018
 Posted: 2019-03-05 21:29 > Certainly decomposing with pca relies on covariance or correlation estimation, you are decomposing that in the end.What do you mean exactly by this?> Having said that it is also true that after you have used 3 factors on meaningful parts of the curve (say 2yr to 10yr, 1w to 12m, 10yr to 30yr+) then you are left with nearly no varianceThis is also not all clear as to why there would be no variance left
 ronin Total Posts: 515 Joined: May 2006
 Posted: 2019-03-06 10:53 > Certainly decomposing with pca relies on covariance or correlation estimation, you are decomposing that in the end.Funnily enough, it doesn't have to. That's just the usual implementation of PCA.In the grand scheme of things, the PCA algo is something like this:1. Find the combination of unit weights that maximises the variance2. That's your next PC3. Project the remainder to be orthogonal to this PC4. If not finished, go to 1You can do it by solving for eigenvalues and eigenvectors of the covariance matrix, but that's just a computational method. That's not PCA. "There is a SIX am?" -- Arthur
 rickyvic Total Posts: 191 Joined: Jul 2013
 Posted: 2019-03-06 12:58 ...> Certainly decomposing with pca relies on covariance or correlation estimation, you are decomposing that in the end.What do you mean exactly by this?....I normally use the covariance decomposition, you can use other methods but then you don't have a lot of handle on the noise level you are capturing. In any case, and as far as I know, the covariance free methods try to extract the same information from the cross product by avoiding calculating the covariance matrix.I like to decompose covariance because then you can chose your favorite estimator but I am guessing it is not always feasible for large data problems.....> Having said that it is also true that after you have used 3 factors on meaningful parts of the curve (say 2yr to 10yr, 1w to 12m, 10yr to 30yr+) then you are left with nearly no varianceThis is also not all clear as to why there would be no variance left....Convexity is slow moving, not stationary in level, if you take anything after that it is stationary noise.It is hard to decide why, it is all driven by carry and basis of curve trades and in any case transaction costs.Obviously these things move as rates expectations move. "amicus Plato sed magis amica Veritas"
 Page 1 of 1