Credit Spread Prediction Using Compressed Sensing
Total Page:16
File Type:pdf, Size:1020Kb
CREDIT SPREAD PREDICTION USING COMPRESSED SENSING Graham L. Giller Data Science Research, Equity Division April 2017 What is Compressed Sensing? Parameter estimation technology developed by Tao, Candès, Donoho. When estimating coefficients of sparse linear systems, minimizing 퐿1 norms dominates traditional “least squares” analysis in accuracy. Only requires 표 푘푆 data points for perfect reconstruction of a noiseless 푆-sparse system of 푁 ≫ 푆 data points. 푘 ≈ 4, 12, ln 푁 … (depending on proof) Nyquist-Shannon sampling theorem says 2푁 ≫ 푘푆 Results are extendable to noisy systems. Applications: MRI Images, Radar Images, Factor Models! Why does it Work? (This due to Tao, who is very much smarter than me!) 2 2 Minimize 푥1 + 푥2 Minimize 푥1 + 푥2 Such that 푎푥1 + 푏푥2 = 푐 (푎, 푏, 푐 are random) Such that 푎푥1 + 푏푥2 = 푐 푥 푥 And 1 is sparse (lies on axis). And 1 is sparse. 푥2 푥2 Probability of sparse solution: Probability of sparse solution: 4 ∞ i.e. almost never. 4 4 i.e. almost always. Interpolating Polynomials Joseph Louis Lagrange, 1795 푁 10 푖−1 푝푁 푥 = 휃푖푥 푖=1 8 6 4 2 0 푁 -2 For any set of 푁 pairs 푦푖, 푥푖 푖=1 I can create a polynomial of order 푁 − 1, 푝푁 푥 -4 such that 푦푖 ≡ 푝푁 푥푖 ∀ 푖 i.e. The polynomial reproduces the observed data with zero error! -6 0 1 2 3 4 5 6 7 Sparse Interpolating Polynomials 10 5 0 -5 -10 If 푦푖 = 푝푆 푥푖 ∀ 푖 and 휽 0 = 푆 ≪ 푁 we have a sparse interpolating polynomial. -15 From an estimation point-of-view, this is a linear system since the polynomial is linear in the 2 푁−1 푇 -20 parameters vector: 푝푁 푥 = 1 푥 푥 ⋯ 푥 휽 Thus this problem is amenable to compressed sensing. -25 0 1 2 3 4 5 6 7 Minimizers and Medians It is well known that the solution to It is a little less well known that the solution to 푁 푁 2 휇 = arg min 푥푖 − 휇 휇 = arg min 푥푖 − 휇 휇 휇 푖=1 푖=1 Is the arithmetic mean Is the median 푁 휇 = median 푥푖 1 푖 휇 = 푥 푁 푖 푖=1 Minimizers and Weighted Medians It’s a pretty obscure piece of information that The weighted median of a set of ranked pairs the solution to 푁 푁 푓 = arg min 푥푖 − 훽푖푓 푥푖, 푤푖 푖=1 where 푥푖 ≤ 푥푗 ∀ 푖 < 푗 푓 푖=1 + and 푤푖 ∈ ℝ ∀ 푖 is the “weighted median” 푥푖 is the arithmetic mean of the values 푥+ and 푥− 푓 = wgt med , 훽푖 푖 훽푖 which are chosen such that 푗 푥− = 푥푗 where 푗 = arg max 푖=1 푤푖 푗 1 such that 푗 푤 ≤ 푁 푤 푖=1 푗 2 푖=1 푗 and 푁 푥+ = 푥푗 where 푗 = arg min 푖=푗 푤푖 푗 1 such that 푁 푤 ≤ 푁 푤 푖=푗 푗 2 푖=1 푗 Structural Model for Credit Spreads Assume piecewise linear evolution of latent company specific credit spread process. Credit spread rates are constant for random intervals and have random values. Actual bond trades are observed at random times and relative spreads (premia). A given bond has a quasi-constant idiosyncratic premium. Method for Solution Compressed Sensing? This model is a piecewise linear factor model. Within intervals it is a 1-sparse polynomial in time. So compressed sensing should work… 1. Cross-Sectional Sessionization Find a set of intervals such that at least 푚 = 푘푆 related bonds have traded at least 2 times within each interval. Estimate of common spread rate for that interval as the weighted median of the individual bond spread rates. The weights are the time intervals between the first trade and the last trade for each bond. I used 푘 = 12 so 푚 = 12 + − 퐶푗 푡푖푗 − 퐶푗 푡푖푗 + − 푔 푇푖 = wgt med푗 + − , 푡푖푗 − 푡푖푗 푡푖푗 − 푡푖푗 2. Factor Intercept Extraction + + 푆 푇푖 = median 퐶푗 푡푖푗 − 푔 푇푖 × 푡푖푗 − 푇푖 푗 3. Longitudenal Sessionization Find a set of intervals for each bond such that the bond has traded at least 푘푆 = 12 times within the interval. These are different intervals to those used in step 1. 훼 푗 = median 퐶푗 푡푗푘 − 푔 푇푖 × 푡푗푘 − 푇푖 − 푆 푇푖 푘 So let’s do it… Common Credit Spread Factor for 22 IBM Bonds Source data is yield spread to benchmark bond, with trade data from TRACE Spread Reconstructions for 3 Specific IBM Bonds Ex Ante Pricing Errors for 459200HG9 Process Dealer Buys, Dealer Sells and Dealer-Dealer trades separately 퐸푇푖+1퐶푗 푡 = 훼 푗 + 푆 푇푖 + 푔 푇푖 × 푡 − 푇푖 for 푡 > 푇푖+1 Pricing errors for the other IBM bonds? Overall: mean error = 0.333 bp, r.m.s. error = 15.2 bp, algorithm tuning done: none Need to take better account of deal size….