SlideShare a Scribd company logo
1 of 43
Download to read offline
Introduction to Algorithmic Trading Strategies
Lecture 7
Small Mean Reverting Portfolio
Haksun Li
haksun.li@numericalmethod.com
www.numericalmethod.com
References
 A d’Aspremont. Identifying Small Mean Reverting
Portfolios. Stanford University. 2008.
 Box, G. E. & Tiao, G. C. β€œA canonical analysis of
multiple time series”, Biometrika 64(2), 355. 1977.
 Dattorro, J. β€œExample 4.6.0.0.12, Semidefinite
programming," Convex Optimization & Euclidean
Distance Geometry. 2010.
 Efron, B., Hastie, T., Johnstone, I., Tibshirani, R. Least
Angle Regression. The annuals of Statistics, Vol. 32,
No. 2, 407-499. 2004.
2
Outline
 Why small portfolios?
3
Mean Reversion is Good
4
Construction Methods
5
 Distance method
 Cointegration
Shortcomings
6
 Dense
 Hard to execute; need to trade all assets all at the same
time.
 Big transaction costs.
 Hard to interpret the significance of the relationship.
 Cointegration
 It gives an β€˜Yes’/’No’ answer. Not sure what to do if the
cointegration relationship is not stable, especially after
entering a position.
As a Maximization Problem
7
 Find the portfolio weights π‘₯𝑖 such that the portfolio
𝑃𝑑 = βˆ‘ π‘₯𝑖 𝑆𝑑𝑖
𝑑
𝑖=1 is most mean reverting meaning that if
𝑑𝑃𝑑 = πœ† 𝑃� βˆ’ 𝑃𝑑 𝑑𝑑 + πœŽπœŽπ‘π‘‘ then πœ† is maximized.
 Sparsity: no more than π‘˜ non-zeros in x, trading at most k
assets.
 Note that unlike cointegration, this approach always
give you a mean reverting portfolio and tells how mean
reverting it is.
VAR(1)
8
 Assume that the prices follow a stationary VAR(1)
process.
 𝑆𝑑 = π‘†π‘‘βˆ’1 𝐹 + 𝑍𝑑
 𝑍𝑑 is 𝑁 0, Ξ£
 Canonical Analysis
 𝑛 = 1
 E 𝑆𝑑 = E π‘†π‘‘βˆ’1 𝐹 + E 𝑍𝑑
 πœŽπ‘‘
2
= πœŽπ‘‘βˆ’1
2
𝐹2 + Σ
Estimation of F
9
 Regress 𝑆𝑑 on π‘†π‘‘βˆ’1.
 𝐹� = π‘†π‘‘βˆ’1
β€²
π‘†π‘‘βˆ’1
βˆ’1
π‘†π‘‘βˆ’1
β€²
𝑆𝑑
 But this 𝐹� is dense. It does not highlight the dependence
relationship between 𝑆𝑑 and π‘†π‘‘βˆ’1.
 Sparse 𝐹�.
 Penalized Least Squares estimation, column by
column.
 𝑓𝑖 = argmin
π‘₯βˆˆπ‘… 𝑛
𝑆𝑖𝑖 βˆ’ π‘†π‘‘βˆ’1 π‘₯ 2 + 𝛾 π‘₯ 1
 𝛾 control the sparsity of π‘₯ and hence 𝑓𝑖 and hence 𝐹�.
Least Absolute Shrinkage and Selection Operator
(LASSO)
10
 It is an automatic model building problem, a factor/model
selection problem.
 minβˆ‘ π‘Œπ‘– βˆ’ βˆ‘ 𝑋𝑖𝑖 𝛽𝑗
𝑝
𝑖=1
2
+ πœ† βˆ‘ 𝛽𝑗
𝑝
𝑗=1
𝑛
𝑖=1
 Minimizing the L1 norm of 𝛽 drives some 𝛽𝑗 to zero.
 Forward Stagewise Linear Regression
 Pick the covariate xj1 with the biggest correlation with y.
 Compute the residual π‘Ÿ1 = 𝑦 βˆ’ 𝛽1 π‘₯𝑗𝑗.
 Pick the covariate xj2 with the biggest correlation with r1.
Compute the residual. Repeat this step until k covariates are
found.
 Build a k-parameter linear model in the usual way, e.g., ordinary
least squares.
 This is a greedy search that may eliminate useful covariate in the
2nd step.
Least Angle Regression (LARS) algorithm
11
 Problem
 min βˆ‘ π‘Œπ‘– βˆ’ βˆ‘ 𝑋𝑖𝑖 𝛽𝑗
𝑝
𝑖=1
2𝑛
𝑖=1 s.t., βˆ‘ 𝛽𝑗
𝑝
𝑗=1 ≀ 𝑑
Covariance Selection
12
 Covariance matrix represents relation between all
variables while inverse covariance shows the relation
of element with their neighbors.
 Zeros in X corresponds to conditionally independent
variables, discovering structure in the model.
 We want zeros in X to highlight the conditional
independence of the assets.
 max 𝑋 log det 𝑋 βˆ’ Tr Σ𝑋 βˆ’ 𝜌 Card 𝑋
 𝑋: the inverse covariance matrix
 Solution: Graphical LASSO or LASSO.
Covariance Selection
Robust and sparse estimation of the covariance matrix
developed by Dempster (1972)
Maximum-likelihood penalized by the cardinality of X
ί³ ΰͺ±
12
)Card()(Trdetlogmax XXX
x
Οβˆ’βˆ‘βˆ’
in the variable X ί³ Sn, where ΰͺ± is the sample covariance
matrix, Card(X) is the number of nonzero coefficients in X and
ૉ>0 controls the trade-off between log-likelihood and sparsity
Hard to solve numerically. D’Aspremont, Banerjee & El
Ghaoui (2006) replaces the penalty by the l1 norm
x
||)(Trdetlogmax
1,
βˆ‘=
βˆ’βˆ‘βˆ’
n
ji
ij
x
XXX ρ
Covariance Selection – Dual Problem
Block-coordinate descent gradient method
The dual problem is given by
in the variable U ί³ Sn
13
njiU
nU
ij ,,1,,||tosubject
)(detlogmin
K=≀
βˆ’+βˆ‘βˆ’
ρ
ί³
We can decompose the matrices in blocks as follows
where V is fixed, A ί³ S(n-1), u,b ί³ R(n-1) and w,c ί³ R
u represents the variables, i.e. the rows and columns we are
updating at each iteration.
ο£·ο£·
ο£Έ
ο£Ά

ο£­

=βˆ‘ο£·ο£·
ο£Έ
ο£Ά

ο£­

=
cb
bA
wu
uV
U TT
and
Covariance Selection – Dual Problem
Block-coordinate descent gradient method
The dual problem in blocks becomes
At each iteration, the main step is then a box
14
njiuw
nubVAubcwVA
ij
T
,,1,,||,||tosubject
)]()()()log[()(detlogmin 1
K=≀≀
βˆ’+++βˆ’+βˆ’+βˆ’ βˆ’
ρρ
At each iteration, the main step is then a box
constrained quadratic program of the form
can be solved using SeDuMi by Sturm (1999)
njiu
ubVAub
ij
T
,,1,,||tosubject
)()()(min 1
K=≀
+++ βˆ’
ρ
Block-coordinate descent gradient method
Algorithm
Pick the row and colum to update;
Compute (A + V)-1;
Update the row and column previously picked with the
solution of the box constrained QP
After each step, check the folowing convergence
15
After each step, check the folowing convergence
condition
Matlab code available on d’Aspremont’s website
Ρρ ≀+βˆ’βˆ‘ βˆ‘=
n
ji
ijXnX
1,
)(Tr
Covariance Selection
Example
Each component equal to 0 in the inverse covariance
matrix represents two variables that are conditionally
independent
Financial meaning of the inverse covariance matrix:
idiosyncratic components of asset prices dynamics
16
Example
15 currencies vs. USD
daily data from Jan 2008 to Dec 2009
graphs done using Cytoscape
Covariance Selection
Initial inverse covariance matrix
17
Covariance Selection
rho = 0.05
18
Covariance Selection
rho = 0.5
19
Clusters
13
 Select the right financial instruments
 Based on conditional dependence (inversecovariance)
 The chosen instruments should be conditional dependent on each other,
but conditional independent to the rest.
 Identify clusters in the inverse covariance matrix
Predictability
14
 𝜈 =
πœŽπ‘‘βˆ’1
2 𝐹2
πœŽπ‘‘
2
 𝜈 small οƒ  variance of π‘†π‘‘βˆ’1 is shadowed by the
contribution from Ξ£ οƒ  𝑆𝑑 is mostly noise, not
predictable
 𝜈 big οƒ  variance of π‘†π‘‘βˆ’1 dominates that of 𝑆𝑑 and the
contribution from Ξ£ is small οƒ  𝑆𝑑 is more predictable
 Hence 𝜈 is a good measure for mean reversion (low
predictability), and is a good proxy for πœ†.
Portfolio Predictability
15
 𝑃𝑑 = π‘₯𝑆𝑑 = π‘†π‘‘βˆ’1 𝐹𝐹 + 𝑍𝑑 π‘₯
 𝜈 =
π‘₯𝐹′Γπ‘₯𝐹
π‘₯β€²Ξ“π‘₯
Problem Formulation (Greedy Search)
16
 min
π‘₯
π‘₯β€² 𝐹′Γ𝐹π‘₯
π‘₯β€²Ξ“π‘₯
 s.t.,
 π‘₯ 0 ≀ π‘˜
 π‘₯ = 1
 𝐴 = 𝐹′Γ𝐹
 𝐡 = Ξ“
Greedy Search
17
 𝐼 π‘˜ = 𝑖 ∈ 1, 𝑛 | π‘₯𝑖 β‰  0 , the set of non-zero indices.
 When π‘˜ = 1, all but one index of π‘₯𝑖 is empty, π‘₯𝑖
β€²
𝐴π‘₯𝑖 = 𝐴𝑖𝑖.
 𝐼1 = argmin
π‘–βˆˆ 1,𝑛
𝐴𝑖𝑖/𝐡𝑖𝑖.
 Recursion. Given 𝐼 π‘˜, find 𝐼 π‘˜+1.
 For each index i not in 𝐼 π‘˜, solve the minimization problem.
 With a fixed set of indices,
 Find z the vector corresponding to the smallest eigenvalue in
Ξ“βˆ’1/2
𝐴 𝑇
Ξ“π΄Ξ“βˆ’1/2
.
 π‘₯ = Ξ“βˆ’1/2
𝑧.
 Add the index i of the smallest objective value to 𝐼 π‘˜.
 Simple.
 Solution not optimal.
Primal SDP Problem
18
 min
𝑋
Tr 𝐢𝐢
 s.t.,
 Tr 𝐴𝑖 𝑋 = 𝑏𝑖
 𝑋 ≽ 0
 C, X, Ai are all symmetric matrices of n-by-n.
 Convex set: pick any two points and draw a line. The
line lies entirely inside the set. No dents in the
perimeter.
 Convex cone 𝐾: π‘₯ ∈ 𝐾 implies that Ξ±π‘₯ ∈ 𝐾 for any
scalar Ξ± β‰₯ 0.
Linear Programming
19
 Linear Programming is a special case.
 C, Ai are diagonal matrices.
 min
π‘₯
𝑐′ π‘₯
 s.t.,
 𝐴𝐴 = 𝑏
 π‘₯ β‰₯ 0
 Note: Quadratic Programming is another special case
of SDP.
Problem Formulation (SDP)
20
 min
π‘₯
π‘₯β€² 𝐴𝐴
π‘₯β€² 𝐡π‘₯
 s.t.,
 π‘₯ 0 ≀ π‘˜
 π‘₯ = 1
 𝐴 = 𝐹′Γ𝐹
 𝐡 = Ξ“
Equivalent Problem
21
 𝑋 = π‘₯π‘₯β€²
 min
π‘‹βˆˆπ‘† 𝑛
Tr 𝐴𝑋
Tr 𝐡𝐡
 s.t.,
 𝑋 0 ≀ π‘˜2
 Tr 𝑋 = 1
 𝑋 ≽ 0
 Rank of X =1
Convex Relaxation
22
 min
π‘‹βˆˆπ‘† 𝑛
Tr 𝐴𝐴
Tr 𝐡𝐡
 s.t.,
 πŸβ€² 𝑿 𝟏 ≀ π’Œ
 Tr 𝑋 = 1
 𝑋 ≽ 0
Relaxed SDP Problem Problems
23
 Need to transform πŸβ€² 𝑿 𝟏 ≀ π’Œ into the standard form.
 The transformation will introduce 𝑁 𝑁 + 1
constraints.
 The relaxation may return an X that has a bigger rank
and/or cardinality, violating the constraints.
Equivalent SDP Problem
24
 min
π‘Œβˆˆπ‘† 𝑛
Tr 𝐴𝐴
 s.t.,
 π‘Œ 0 ≀ π‘˜
 Tr π΅π‘Œ = 1
 π‘Œ ≽ 0
 Rank of Y = 1
 Change of variable
 π‘Œ =
𝑋
Tr 𝐡𝐡
Handling Rank and Cardinality
25
 Iteratively solve this system of three equations, starting with
 π‘Š = 𝐷 = 0
 min
π‘Œβˆˆπ‘† 𝑛
𝑇𝑇 𝐴𝐴 βˆ’ 𝑀1 𝑇𝑇 π‘Šπ‘Š βˆ’ 𝑀2 𝑇𝑇(𝐷𝐷)
 Tr 𝐡𝐡 = 1
 π‘Œ ≽ 0
 min
π‘Šβˆˆπ‘† 𝑛
𝑇𝑇(π‘Šπ‘Œβˆ—
)
 0 ≀ π‘Š ≀ 𝐼
 𝑑𝑑 π‘Š = 𝑛 βˆ’ 1
 Can be solved analytically.
 min
𝐷∈𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷
𝑇𝑇(π·π‘Œβˆ—
)
 0 ≀ 𝐷 ≀ 𝐼
 𝑇𝑇 𝐷 = 𝑛 βˆ’ π‘˜
 Can be solved analytically.
Optimal Weights
26
 Even if the assets are correctly chosen, without the
correct weights, the portfolio is still not mean
reverting.
Determine
optimal
weights
Semidefinite
programming
Utilize Mean Reverting Portfolio in Trading
27
 Given the portfolio can be modelled as a mean
reverting OU process, dynamic spread trading is a
stochastic optimal control problem.
 Objectives:
 Given a fixed amount of capital, dynamically allocate
capital over a risky mean reverting portfolioand a risk-free
asset over a finite time horizon to maximize a general
constant relative risk aversion (CRRA) utility function of
the terminal wealth
 Allocate capital amongst several mean reverting portfolios
Utilize Mean Reverting Portfolio in Trading
28
 Given the portfolio can be modelled as a mean
reverting OU process, dynamic spread trading is a
stochastic optimal control problem.
 Mathematics involved:
 Ornstein-Uhlenbeck (OU) estimation
 Hamilton-Jacobi-Bellman (HJB) equation
 ODE (Riccatti differential equations)
 Portfolio allocation (mean variance analysis)
Proposed Procedure
 Step 1: Split a large pool of risky assets into sufficiently
small clusters;
 Step 2: Search each of the clusters for optimal small
mean reverting portfolios;
 Step 3: For each portfolio identified in Step 2,
determine the optimal pairs trading strategy;
 Step 4: Dynamically allocate money among mean
reverting portfolios.
29
Case Study – S&P 500 Stocks
 Trading periods
 From 2010-Jan-01 to 2014-Dec-31, 10 sub-trading period,
length of every sub-period is 6 month;
 Re-select the portfolio before each sub-trading period
begins;
 For every sub-trading period, 2 years stock data are used to
select the portfolio.
 Once portfolio is chosen, the weights of stocks are
unchanged within the 6 month period
 Rebalance when the difference between current portfolio
price and last trade price is larger than a certain threshold.
Case Study – S&P 500 Stocks
 Assumptions
 Margin requirement
 For short selling, 50% of the short selling value needs to be
deposited into the margin account.
 50% of values of stocks in long position can be used as collateral
for short margin account.
 Cost
 Transactioncost: 0.2% per transaction
 Borrowing cost: 8% p.a. (short selling)
 Risk-free rate: 0.55% p.a. (1-year LIBOR)
Case Study – S&P 500 Stocks
 An example, the last sub-trading period, 2014/07/02 -
2014/12/31:
 In-sample fitting
 2004/07/01-2014/07/01 Identify the largest cluster: 69 stocks are
selected from S&P 500 stocks (covariance selection);
 2012/07/01-2014/07/01 Calculate the optimal combination of stocks: 5
stocks are selected from the largest cluster and their weights are
optimized (LASSO, semidefinite programming) ;
 Fit an OU model to the portfolio constructed (OU estimation);
 Out-of-sample trading (2014/07/02-2014/12/31)
 Calibration frequency: rebalance when state changes more than 1
unit, state is (current price - mean)/s.d.;
 Determine the optimal capital to be allocated to the portfolio and the
risk-free asset (ODE solving, portfolio optimization);
Case Study – S&P 500 Stocks
 Optimal portfolio
 The portfolio price is volume weighted average price
 If we want to buy N shares of the portfolio, we need to buy 0.13N shares of
CSX, buy 0.07N shares of DHI, buy 0.98N shares of FTR, sell 0.04N shares of
GPS and sell 0.11 shares of MAR.
 Although the weight of FTR seems to be large, it is only because the price of
FTR is significantly lower than other stocks. Total value of FTR does not
dominate values of other stocks.
Stock Sector Weigh
t
Avg.
price
CSX Corp. Industrials 0.13 24.1
D. R. Horton Consumer Discretionary 0.07 21.1
Frontier
Communications
Telecommunications
Services
0.98 4.1
Gap (The) Consumer Discretionary -0.04 36.7
Marriott Int'l. Consumer Discretionary -0.11 43.5
Case Study – S&P 500 Stocks
Case Study – S&P 500 Stocks
2010/01/01-2014/12/31
35

More Related Content

What's hot

Intro to Quant Trading Strategies (Lecture 9 of 10)
Intro to Quant Trading Strategies (Lecture 9 of 10)Intro to Quant Trading Strategies (Lecture 9 of 10)
Intro to Quant Trading Strategies (Lecture 9 of 10)Adrian Aley
Β 
Intro to Quantitative Investment (Lecture 6 of 6)
Intro to Quantitative Investment (Lecture 6 of 6)Intro to Quantitative Investment (Lecture 6 of 6)
Intro to Quantitative Investment (Lecture 6 of 6)Adrian Aley
Β 
Intro to Quantitative Investment (Lecture 1 of 6)
Intro to Quantitative Investment (Lecture 1 of 6)Intro to Quantitative Investment (Lecture 1 of 6)
Intro to Quantitative Investment (Lecture 1 of 6)Adrian Aley
Β 
Intro to Quantitative Investment (Lecture 3 of 6)
Intro to Quantitative Investment (Lecture 3 of 6)Intro to Quantitative Investment (Lecture 3 of 6)
Intro to Quantitative Investment (Lecture 3 of 6)Adrian Aley
Β 
Discrete Probability Distributions.
Discrete Probability Distributions.Discrete Probability Distributions.
Discrete Probability Distributions.ConflagratioNal Jahid
Β 
Les5e ppt 04
Les5e ppt 04Les5e ppt 04
Les5e ppt 04Subas Nandy
Β 
Simplex Algorithm
Simplex AlgorithmSimplex Algorithm
Simplex AlgorithmAizaz Ahmad
Β 
Types of Probability Distributions - Statistics II
Types of Probability Distributions - Statistics IITypes of Probability Distributions - Statistics II
Types of Probability Distributions - Statistics IIRupak Roy
Β 
Chapter 07
Chapter 07Chapter 07
Chapter 07bmcfad01
Β 
Linear programming
Linear programmingLinear programming
Linear programmingPiyush Sharma
Β 
Demystifying the Bias-Variance Tradeoff
Demystifying the Bias-Variance TradeoffDemystifying the Bias-Variance Tradeoff
Demystifying the Bias-Variance TradeoffAshwin Rao
Β 
Directional Hypothesis testing
Directional Hypothesis testing Directional Hypothesis testing
Directional Hypothesis testing Rupak Roy
Β 
Simplex method maximisation
Simplex method maximisationSimplex method maximisation
Simplex method maximisationAnurag Srivastava
Β 
The Newsvendor meets the Options Trader
The Newsvendor meets the Options TraderThe Newsvendor meets the Options Trader
The Newsvendor meets the Options TraderAshwin Rao
Β 
Choosing the Right Regressors
Choosing the Right RegressorsChoosing the Right Regressors
Choosing the Right RegressorsAsad Zaman
Β 
Simplex Method
Simplex MethodSimplex Method
Simplex Methoditsvineeth209
Β 

What's hot (20)

Intro to Quant Trading Strategies (Lecture 9 of 10)
Intro to Quant Trading Strategies (Lecture 9 of 10)Intro to Quant Trading Strategies (Lecture 9 of 10)
Intro to Quant Trading Strategies (Lecture 9 of 10)
Β 
Intro to Quantitative Investment (Lecture 6 of 6)
Intro to Quantitative Investment (Lecture 6 of 6)Intro to Quantitative Investment (Lecture 6 of 6)
Intro to Quantitative Investment (Lecture 6 of 6)
Β 
Intro to Quantitative Investment (Lecture 1 of 6)
Intro to Quantitative Investment (Lecture 1 of 6)Intro to Quantitative Investment (Lecture 1 of 6)
Intro to Quantitative Investment (Lecture 1 of 6)
Β 
Intro to Quantitative Investment (Lecture 3 of 6)
Intro to Quantitative Investment (Lecture 3 of 6)Intro to Quantitative Investment (Lecture 3 of 6)
Intro to Quantitative Investment (Lecture 3 of 6)
Β 
Discrete Probability Distributions.
Discrete Probability Distributions.Discrete Probability Distributions.
Discrete Probability Distributions.
Β 
Les5e ppt 04
Les5e ppt 04Les5e ppt 04
Les5e ppt 04
Β 
Simplex Algorithm
Simplex AlgorithmSimplex Algorithm
Simplex Algorithm
Β 
Types of Probability Distributions - Statistics II
Types of Probability Distributions - Statistics IITypes of Probability Distributions - Statistics II
Types of Probability Distributions - Statistics II
Β 
Chapter 07
Chapter 07Chapter 07
Chapter 07
Β 
Linear programming
Linear programmingLinear programming
Linear programming
Β 
Chi Square & Anova
Chi Square & AnovaChi Square & Anova
Chi Square & Anova
Β 
Sfs4e ppt 07
Sfs4e ppt 07Sfs4e ppt 07
Sfs4e ppt 07
Β 
Demystifying the Bias-Variance Tradeoff
Demystifying the Bias-Variance TradeoffDemystifying the Bias-Variance Tradeoff
Demystifying the Bias-Variance Tradeoff
Β 
Econometrics ch8
Econometrics ch8Econometrics ch8
Econometrics ch8
Β 
Directional Hypothesis testing
Directional Hypothesis testing Directional Hypothesis testing
Directional Hypothesis testing
Β 
Simplex method
Simplex methodSimplex method
Simplex method
Β 
Simplex method maximisation
Simplex method maximisationSimplex method maximisation
Simplex method maximisation
Β 
The Newsvendor meets the Options Trader
The Newsvendor meets the Options TraderThe Newsvendor meets the Options Trader
The Newsvendor meets the Options Trader
Β 
Choosing the Right Regressors
Choosing the Right RegressorsChoosing the Right Regressors
Choosing the Right Regressors
Β 
Simplex Method
Simplex MethodSimplex Method
Simplex Method
Β 

Similar to Intro to Quant Trading Strategies (Lecture 7 of 10)

2 random variables notes 2p3
2 random variables notes 2p32 random variables notes 2p3
2 random variables notes 2p3MuhannadSaleh
Β 
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...Mengxi Jiang
Β 
The world of loss function
The world of loss functionThe world of loss function
The world of loss function홍배 κΉ€
Β 
Efficient Computation of Regret-ratio Minimizing Set: A Compact Maxima Repres...
Efficient Computation ofRegret-ratio Minimizing Set:A Compact Maxima Repres...Efficient Computation ofRegret-ratio Minimizing Set:A Compact Maxima Repres...
Efficient Computation of Regret-ratio Minimizing Set: A Compact Maxima Repres...Abolfazl Asudeh
Β 
1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmr1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmrAdam Lee Perelman
Β 
MVPA with SpaceNet: sparse structured priors
MVPA with SpaceNet: sparse structured priorsMVPA with SpaceNet: sparse structured priors
MVPA with SpaceNet: sparse structured priorsElvis DOHMATOB
Β 
Regularization and variable selection via elastic net
Regularization and variable selection via elastic netRegularization and variable selection via elastic net
Regularization and variable selection via elastic netKyusonLim
Β 
nber_slides.pdf
nber_slides.pdfnber_slides.pdf
nber_slides.pdfssuser05b736
Β 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)theijes
Β 
seminar1!$%^*((^$#@$^@%@%@%$%@%@$@%$%$%@%@
seminar1!$%^*((^$#@$^@%@%@%$%@%@$@%$%$%@%@seminar1!$%^*((^$#@$^@%@%@%$%@%@$@%$%$%@%@
seminar1!$%^*((^$#@$^@%@%@%$%@%@$@%$%$%@%@umeshthotigar
Β 
Numerical
NumericalNumerical
Numerical1821986
Β 
simple linear regression - brief introduction
simple linear regression - brief introductionsimple linear regression - brief introduction
simple linear regression - brief introductionedinyoka
Β 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notesUmeshJagga1
Β 
MASSS_Presentation_20160209
MASSS_Presentation_20160209MASSS_Presentation_20160209
MASSS_Presentation_20160209Yimin Wu
Β 
Introduction to Supervised ML Concepts and Algorithms
Introduction to Supervised ML Concepts and AlgorithmsIntroduction to Supervised ML Concepts and Algorithms
Introduction to Supervised ML Concepts and AlgorithmsNBER
Β 
A Family Of Extragradient Methods For Solving Equilibrium Problems
A Family Of Extragradient Methods For Solving Equilibrium ProblemsA Family Of Extragradient Methods For Solving Equilibrium Problems
A Family Of Extragradient Methods For Solving Equilibrium ProblemsYasmine Anino
Β 

Similar to Intro to Quant Trading Strategies (Lecture 7 of 10) (20)

2 random variables notes 2p3
2 random variables notes 2p32 random variables notes 2p3
2 random variables notes 2p3
Β 
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
Application of Graphic LASSO in Portfolio Optimization_Yixuan Chen & Mengxi J...
Β 
The world of loss function
The world of loss functionThe world of loss function
The world of loss function
Β 
Regression
RegressionRegression
Regression
Β 
Machine Learning 1
Machine Learning 1Machine Learning 1
Machine Learning 1
Β 
Efficient Computation of Regret-ratio Minimizing Set: A Compact Maxima Repres...
Efficient Computation ofRegret-ratio Minimizing Set:A Compact Maxima Repres...Efficient Computation ofRegret-ratio Minimizing Set:A Compact Maxima Repres...
Efficient Computation of Regret-ratio Minimizing Set: A Compact Maxima Repres...
Β 
1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmr1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmr
Β 
MVPA with SpaceNet: sparse structured priors
MVPA with SpaceNet: sparse structured priorsMVPA with SpaceNet: sparse structured priors
MVPA with SpaceNet: sparse structured priors
Β 
Stochastic Optimization
Stochastic OptimizationStochastic Optimization
Stochastic Optimization
Β 
Regularization and variable selection via elastic net
Regularization and variable selection via elastic netRegularization and variable selection via elastic net
Regularization and variable selection via elastic net
Β 
nber_slides.pdf
nber_slides.pdfnber_slides.pdf
nber_slides.pdf
Β 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
Β 
seminar1!$%^*((^$#@$^@%@%@%$%@%@$@%$%$%@%@
seminar1!$%^*((^$#@$^@%@%@%$%@%@$@%$%$%@%@seminar1!$%^*((^$#@$^@%@%@%$%@%@$@%$%$%@%@
seminar1!$%^*((^$#@$^@%@%@%$%@%@$@%$%$%@%@
Β 
Numerical
NumericalNumerical
Numerical
Β 
simple linear regression - brief introduction
simple linear regression - brief introductionsimple linear regression - brief introduction
simple linear regression - brief introduction
Β 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notes
Β 
MASSS_Presentation_20160209
MASSS_Presentation_20160209MASSS_Presentation_20160209
MASSS_Presentation_20160209
Β 
Introduction to Supervised ML Concepts and Algorithms
Introduction to Supervised ML Concepts and AlgorithmsIntroduction to Supervised ML Concepts and Algorithms
Introduction to Supervised ML Concepts and Algorithms
Β 
A Family Of Extragradient Methods For Solving Equilibrium Problems
A Family Of Extragradient Methods For Solving Equilibrium ProblemsA Family Of Extragradient Methods For Solving Equilibrium Problems
A Family Of Extragradient Methods For Solving Equilibrium Problems
Β 
2. diagnostics, collinearity, transformation, and missing data
2. diagnostics, collinearity, transformation, and missing data 2. diagnostics, collinearity, transformation, and missing data
2. diagnostics, collinearity, transformation, and missing data
Β 

Recently uploaded

Stock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfStock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfMichael Silva
Β 
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...yordanosyohannes2
Β 
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...First NO1 World Amil baba in Faisalabad
Β 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managmentfactical
Β 
VIP Kolkata Call Girl Jodhpur Park πŸ‘‰ 8250192130 Available With Room
VIP Kolkata Call Girl Jodhpur Park πŸ‘‰ 8250192130  Available With RoomVIP Kolkata Call Girl Jodhpur Park πŸ‘‰ 8250192130  Available With Room
VIP Kolkata Call Girl Jodhpur Park πŸ‘‰ 8250192130 Available With Roomdivyansh0kumar0
Β 
chapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trendschapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trendslemlemtesfaye192
Β 
Governor Olli Rehn: Dialling back monetary restraint
Governor Olli Rehn: Dialling back monetary restraintGovernor Olli Rehn: Dialling back monetary restraint
Governor Olli Rehn: Dialling back monetary restraintSuomen Pankki
Β 
Andheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot ModelsAndheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot Modelshematsharma006
Β 
Mulki Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Mulki Call Girls 7001305949 WhatsApp Number 24x7 Best ServicesMulki Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Mulki Call Girls 7001305949 WhatsApp Number 24x7 Best Servicesnajka9823
Β 
(εŠžη†ε­¦δ½θ―)εŠ ζ‹Ώε€§θ¨ηœε€§ε­¦ζ―•δΈšθ―ζˆη»©ε•εŽŸη‰ˆδΈ€ζ―”δΈ€
(εŠžη†ε­¦δ½θ―)εŠ ζ‹Ώε€§θ¨ηœε€§ε­¦ζ―•δΈšθ―ζˆη»©ε•εŽŸη‰ˆδΈ€ζ―”δΈ€(εŠžη†ε­¦δ½θ―)εŠ ζ‹Ώε€§θ¨ηœε€§ε­¦ζ―•δΈšθ―ζˆη»©ε•εŽŸη‰ˆδΈ€ζ―”δΈ€
(εŠžη†ε­¦δ½θ―)εŠ ζ‹Ώε€§θ¨ηœε€§ε­¦ζ―•δΈšθ―ζˆη»©ε•εŽŸη‰ˆδΈ€ζ―”δΈ€S SDS
Β 
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...makika9823
Β 
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...Amil baba
Β 
Tenets of Physiocracy History of Economic
Tenets of Physiocracy History of EconomicTenets of Physiocracy History of Economic
Tenets of Physiocracy History of Economiccinemoviesu
Β 
20240417-Calibre-April-2024-Investor-Presentation.pdf
20240417-Calibre-April-2024-Investor-Presentation.pdf20240417-Calibre-April-2024-Investor-Presentation.pdf
20240417-Calibre-April-2024-Investor-Presentation.pdfAdnet Communications
Β 
Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111Sapana Sha
Β 
Vp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsAppVp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsAppmiss dipika
Β 
How Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingHow Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingAggregage
Β 
Classical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithClassical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithAdamYassin2
Β 
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyInterimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyTyΓΆelΓ€keyhtiΓΆ Elo
Β 
Chapter 2.ppt of macroeconomics by mankiw 9th edition
Chapter 2.ppt of macroeconomics by mankiw 9th editionChapter 2.ppt of macroeconomics by mankiw 9th edition
Chapter 2.ppt of macroeconomics by mankiw 9th editionMuhammadHusnain82237
Β 

Recently uploaded (20)

Stock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfStock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdf
Β 
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
Β 
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Β 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managment
Β 
VIP Kolkata Call Girl Jodhpur Park πŸ‘‰ 8250192130 Available With Room
VIP Kolkata Call Girl Jodhpur Park πŸ‘‰ 8250192130  Available With RoomVIP Kolkata Call Girl Jodhpur Park πŸ‘‰ 8250192130  Available With Room
VIP Kolkata Call Girl Jodhpur Park πŸ‘‰ 8250192130 Available With Room
Β 
chapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trendschapter_2.ppt The labour market definitions and trends
chapter_2.ppt The labour market definitions and trends
Β 
Governor Olli Rehn: Dialling back monetary restraint
Governor Olli Rehn: Dialling back monetary restraintGovernor Olli Rehn: Dialling back monetary restraint
Governor Olli Rehn: Dialling back monetary restraint
Β 
Andheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot ModelsAndheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot Models
Β 
Mulki Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Mulki Call Girls 7001305949 WhatsApp Number 24x7 Best ServicesMulki Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Mulki Call Girls 7001305949 WhatsApp Number 24x7 Best Services
Β 
(εŠžη†ε­¦δ½θ―)εŠ ζ‹Ώε€§θ¨ηœε€§ε­¦ζ―•δΈšθ―ζˆη»©ε•εŽŸη‰ˆδΈ€ζ―”δΈ€
(εŠžη†ε­¦δ½θ―)εŠ ζ‹Ώε€§θ¨ηœε€§ε­¦ζ―•δΈšθ―ζˆη»©ε•εŽŸη‰ˆδΈ€ζ―”δΈ€(εŠžη†ε­¦δ½θ―)εŠ ζ‹Ώε€§θ¨ηœε€§ε­¦ζ―•δΈšθ―ζˆη»©ε•εŽŸη‰ˆδΈ€ζ―”δΈ€
(εŠžη†ε­¦δ½θ―)εŠ ζ‹Ώε€§θ¨ηœε€§ε­¦ζ―•δΈšθ―ζˆη»©ε•εŽŸη‰ˆδΈ€ζ―”δΈ€
Β 
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...
Β 
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
NO1 WorldWide Genuine vashikaran specialist Vashikaran baba near Lahore Vashi...
Β 
Tenets of Physiocracy History of Economic
Tenets of Physiocracy History of EconomicTenets of Physiocracy History of Economic
Tenets of Physiocracy History of Economic
Β 
20240417-Calibre-April-2024-Investor-Presentation.pdf
20240417-Calibre-April-2024-Investor-Presentation.pdf20240417-Calibre-April-2024-Investor-Presentation.pdf
20240417-Calibre-April-2024-Investor-Presentation.pdf
Β 
Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Β 
Vp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsAppVp Girls near me Delhi Call Now or WhatsApp
Vp Girls near me Delhi Call Now or WhatsApp
Β 
How Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingHow Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of Reporting
Β 
Classical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam SmithClassical Theory of Macroeconomics by Adam Smith
Classical Theory of Macroeconomics by Adam Smith
Β 
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyInterimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Β 
Chapter 2.ppt of macroeconomics by mankiw 9th edition
Chapter 2.ppt of macroeconomics by mankiw 9th editionChapter 2.ppt of macroeconomics by mankiw 9th edition
Chapter 2.ppt of macroeconomics by mankiw 9th edition
Β 

Intro to Quant Trading Strategies (Lecture 7 of 10)

  • 1. Introduction to Algorithmic Trading Strategies Lecture 7 Small Mean Reverting Portfolio Haksun Li haksun.li@numericalmethod.com www.numericalmethod.com
  • 2. References  A d’Aspremont. Identifying Small Mean Reverting Portfolios. Stanford University. 2008.  Box, G. E. & Tiao, G. C. β€œA canonical analysis of multiple time series”, Biometrika 64(2), 355. 1977.  Dattorro, J. β€œExample 4.6.0.0.12, Semidefinite programming," Convex Optimization & Euclidean Distance Geometry. 2010.  Efron, B., Hastie, T., Johnstone, I., Tibshirani, R. Least Angle Regression. The annuals of Statistics, Vol. 32, No. 2, 407-499. 2004. 2
  • 3. Outline  Why small portfolios? 3
  • 5. Construction Methods 5  Distance method  Cointegration
  • 6. Shortcomings 6  Dense  Hard to execute; need to trade all assets all at the same time.  Big transaction costs.  Hard to interpret the significance of the relationship.  Cointegration  It gives an β€˜Yes’/’No’ answer. Not sure what to do if the cointegration relationship is not stable, especially after entering a position.
  • 7. As a Maximization Problem 7  Find the portfolio weights π‘₯𝑖 such that the portfolio 𝑃𝑑 = βˆ‘ π‘₯𝑖 𝑆𝑑𝑖 𝑑 𝑖=1 is most mean reverting meaning that if 𝑑𝑃𝑑 = πœ† 𝑃� βˆ’ 𝑃𝑑 𝑑𝑑 + πœŽπœŽπ‘π‘‘ then πœ† is maximized.  Sparsity: no more than π‘˜ non-zeros in x, trading at most k assets.  Note that unlike cointegration, this approach always give you a mean reverting portfolio and tells how mean reverting it is.
  • 8. VAR(1) 8  Assume that the prices follow a stationary VAR(1) process.  𝑆𝑑 = π‘†π‘‘βˆ’1 𝐹 + 𝑍𝑑  𝑍𝑑 is 𝑁 0, Ξ£  Canonical Analysis  𝑛 = 1  E 𝑆𝑑 = E π‘†π‘‘βˆ’1 𝐹 + E 𝑍𝑑  πœŽπ‘‘ 2 = πœŽπ‘‘βˆ’1 2 𝐹2 + Ξ£
  • 9. Estimation of F 9  Regress 𝑆𝑑 on π‘†π‘‘βˆ’1.  𝐹� = π‘†π‘‘βˆ’1 β€² π‘†π‘‘βˆ’1 βˆ’1 π‘†π‘‘βˆ’1 β€² 𝑆𝑑  But this 𝐹� is dense. It does not highlight the dependence relationship between 𝑆𝑑 and π‘†π‘‘βˆ’1.  Sparse 𝐹�.  Penalized Least Squares estimation, column by column.  𝑓𝑖 = argmin π‘₯βˆˆπ‘… 𝑛 𝑆𝑖𝑖 βˆ’ π‘†π‘‘βˆ’1 π‘₯ 2 + 𝛾 π‘₯ 1  𝛾 control the sparsity of π‘₯ and hence 𝑓𝑖 and hence 𝐹�.
  • 10. Least Absolute Shrinkage and Selection Operator (LASSO) 10  It is an automatic model building problem, a factor/model selection problem.  minβˆ‘ π‘Œπ‘– βˆ’ βˆ‘ 𝑋𝑖𝑖 𝛽𝑗 𝑝 𝑖=1 2 + πœ† βˆ‘ 𝛽𝑗 𝑝 𝑗=1 𝑛 𝑖=1  Minimizing the L1 norm of 𝛽 drives some 𝛽𝑗 to zero.  Forward Stagewise Linear Regression  Pick the covariate xj1 with the biggest correlation with y.  Compute the residual π‘Ÿ1 = 𝑦 βˆ’ 𝛽1 π‘₯𝑗𝑗.  Pick the covariate xj2 with the biggest correlation with r1. Compute the residual. Repeat this step until k covariates are found.  Build a k-parameter linear model in the usual way, e.g., ordinary least squares.  This is a greedy search that may eliminate useful covariate in the 2nd step.
  • 11. Least Angle Regression (LARS) algorithm 11  Problem  min βˆ‘ π‘Œπ‘– βˆ’ βˆ‘ 𝑋𝑖𝑖 𝛽𝑗 𝑝 𝑖=1 2𝑛 𝑖=1 s.t., βˆ‘ 𝛽𝑗 𝑝 𝑗=1 ≀ 𝑑
  • 12. Covariance Selection 12  Covariance matrix represents relation between all variables while inverse covariance shows the relation of element with their neighbors.  Zeros in X corresponds to conditionally independent variables, discovering structure in the model.  We want zeros in X to highlight the conditional independence of the assets.  max 𝑋 log det 𝑋 βˆ’ Tr Σ𝑋 βˆ’ 𝜌 Card 𝑋  𝑋: the inverse covariance matrix  Solution: Graphical LASSO or LASSO.
  • 13. Covariance Selection Robust and sparse estimation of the covariance matrix developed by Dempster (1972) Maximum-likelihood penalized by the cardinality of X ί³ ΰͺ± 12 )Card()(Trdetlogmax XXX x Οβˆ’βˆ‘βˆ’ in the variable X ί³ Sn, where ΰͺ± is the sample covariance matrix, Card(X) is the number of nonzero coefficients in X and ૉ>0 controls the trade-off between log-likelihood and sparsity Hard to solve numerically. D’Aspremont, Banerjee & El Ghaoui (2006) replaces the penalty by the l1 norm x ||)(Trdetlogmax 1, βˆ‘= βˆ’βˆ‘βˆ’ n ji ij x XXX ρ
  • 14. Covariance Selection – Dual Problem Block-coordinate descent gradient method The dual problem is given by in the variable U ί³ Sn 13 njiU nU ij ,,1,,||tosubject )(detlogmin K=≀ βˆ’+βˆ‘βˆ’ ρ ί³ We can decompose the matrices in blocks as follows where V is fixed, A ί³ S(n-1), u,b ί³ R(n-1) and w,c ί³ R u represents the variables, i.e. the rows and columns we are updating at each iteration. ο£·ο£· ο£Έ ο£Ά  ο£­  =βˆ‘ο£·ο£· ο£Έ ο£Ά  ο£­  = cb bA wu uV U TT and
  • 15. Covariance Selection – Dual Problem Block-coordinate descent gradient method The dual problem in blocks becomes At each iteration, the main step is then a box 14 njiuw nubVAubcwVA ij T ,,1,,||,||tosubject )]()()()log[()(detlogmin 1 K=≀≀ βˆ’+++βˆ’+βˆ’+βˆ’ βˆ’ ρρ At each iteration, the main step is then a box constrained quadratic program of the form can be solved using SeDuMi by Sturm (1999) njiu ubVAub ij T ,,1,,||tosubject )()()(min 1 K=≀ +++ βˆ’ ρ
  • 16. Block-coordinate descent gradient method Algorithm Pick the row and colum to update; Compute (A + V)-1; Update the row and column previously picked with the solution of the box constrained QP After each step, check the folowing convergence 15 After each step, check the folowing convergence condition Matlab code available on d’Aspremont’s website Ρρ ≀+βˆ’βˆ‘ βˆ‘= n ji ijXnX 1, )(Tr
  • 17. Covariance Selection Example Each component equal to 0 in the inverse covariance matrix represents two variables that are conditionally independent Financial meaning of the inverse covariance matrix: idiosyncratic components of asset prices dynamics 16 Example 15 currencies vs. USD daily data from Jan 2008 to Dec 2009 graphs done using Cytoscape
  • 18. Covariance Selection Initial inverse covariance matrix 17
  • 21. Clusters 13  Select the right financial instruments  Based on conditional dependence (inversecovariance)  The chosen instruments should be conditional dependent on each other, but conditional independent to the rest.  Identify clusters in the inverse covariance matrix
  • 22. Predictability 14  𝜈 = πœŽπ‘‘βˆ’1 2 𝐹2 πœŽπ‘‘ 2  𝜈 small οƒ  variance of π‘†π‘‘βˆ’1 is shadowed by the contribution from Ξ£ οƒ  𝑆𝑑 is mostly noise, not predictable  𝜈 big οƒ  variance of π‘†π‘‘βˆ’1 dominates that of 𝑆𝑑 and the contribution from Ξ£ is small οƒ  𝑆𝑑 is more predictable  Hence 𝜈 is a good measure for mean reversion (low predictability), and is a good proxy for πœ†.
  • 23. Portfolio Predictability 15  𝑃𝑑 = π‘₯𝑆𝑑 = π‘†π‘‘βˆ’1 𝐹𝐹 + 𝑍𝑑 π‘₯  𝜈 = π‘₯𝐹′Γπ‘₯𝐹 π‘₯β€²Ξ“π‘₯
  • 24. Problem Formulation (Greedy Search) 16  min π‘₯ π‘₯β€² 𝐹′Γ𝐹π‘₯ π‘₯β€²Ξ“π‘₯  s.t.,  π‘₯ 0 ≀ π‘˜  π‘₯ = 1  𝐴 = 𝐹′Γ𝐹  𝐡 = Ξ“
  • 25. Greedy Search 17  𝐼 π‘˜ = 𝑖 ∈ 1, 𝑛 | π‘₯𝑖 β‰  0 , the set of non-zero indices.  When π‘˜ = 1, all but one index of π‘₯𝑖 is empty, π‘₯𝑖 β€² 𝐴π‘₯𝑖 = 𝐴𝑖𝑖.  𝐼1 = argmin π‘–βˆˆ 1,𝑛 𝐴𝑖𝑖/𝐡𝑖𝑖.  Recursion. Given 𝐼 π‘˜, find 𝐼 π‘˜+1.  For each index i not in 𝐼 π‘˜, solve the minimization problem.  With a fixed set of indices,  Find z the vector corresponding to the smallest eigenvalue in Ξ“βˆ’1/2 𝐴 𝑇 Ξ“π΄Ξ“βˆ’1/2 .  π‘₯ = Ξ“βˆ’1/2 𝑧.  Add the index i of the smallest objective value to 𝐼 π‘˜.  Simple.  Solution not optimal.
  • 26. Primal SDP Problem 18  min 𝑋 Tr 𝐢𝐢  s.t.,  Tr 𝐴𝑖 𝑋 = 𝑏𝑖  𝑋 ≽ 0  C, X, Ai are all symmetric matrices of n-by-n.  Convex set: pick any two points and draw a line. The line lies entirely inside the set. No dents in the perimeter.  Convex cone 𝐾: π‘₯ ∈ 𝐾 implies that Ξ±π‘₯ ∈ 𝐾 for any scalar Ξ± β‰₯ 0.
  • 27. Linear Programming 19  Linear Programming is a special case.  C, Ai are diagonal matrices.  min π‘₯ 𝑐′ π‘₯  s.t.,  𝐴𝐴 = 𝑏  π‘₯ β‰₯ 0  Note: Quadratic Programming is another special case of SDP.
  • 28. Problem Formulation (SDP) 20  min π‘₯ π‘₯β€² 𝐴𝐴 π‘₯β€² 𝐡π‘₯  s.t.,  π‘₯ 0 ≀ π‘˜  π‘₯ = 1  𝐴 = 𝐹′Γ𝐹  𝐡 = Ξ“
  • 29. Equivalent Problem 21  𝑋 = π‘₯π‘₯β€²  min π‘‹βˆˆπ‘† 𝑛 Tr 𝐴𝑋 Tr 𝐡𝐡  s.t.,  𝑋 0 ≀ π‘˜2  Tr 𝑋 = 1  𝑋 ≽ 0  Rank of X =1
  • 30. Convex Relaxation 22  min π‘‹βˆˆπ‘† 𝑛 Tr 𝐴𝐴 Tr 𝐡𝐡  s.t.,  πŸβ€² 𝑿 𝟏 ≀ π’Œ  Tr 𝑋 = 1  𝑋 ≽ 0
  • 31. Relaxed SDP Problem Problems 23  Need to transform πŸβ€² 𝑿 𝟏 ≀ π’Œ into the standard form.  The transformation will introduce 𝑁 𝑁 + 1 constraints.  The relaxation may return an X that has a bigger rank and/or cardinality, violating the constraints.
  • 32. Equivalent SDP Problem 24  min π‘Œβˆˆπ‘† 𝑛 Tr 𝐴𝐴  s.t.,  π‘Œ 0 ≀ π‘˜  Tr π΅π‘Œ = 1  π‘Œ ≽ 0  Rank of Y = 1  Change of variable  π‘Œ = 𝑋 Tr 𝐡𝐡
  • 33. Handling Rank and Cardinality 25  Iteratively solve this system of three equations, starting with  π‘Š = 𝐷 = 0  min π‘Œβˆˆπ‘† 𝑛 𝑇𝑇 𝐴𝐴 βˆ’ 𝑀1 𝑇𝑇 π‘Šπ‘Š βˆ’ 𝑀2 𝑇𝑇(𝐷𝐷)  Tr 𝐡𝐡 = 1  π‘Œ ≽ 0  min π‘Šβˆˆπ‘† 𝑛 𝑇𝑇(π‘Šπ‘Œβˆ— )  0 ≀ π‘Š ≀ 𝐼  𝑑𝑑 π‘Š = 𝑛 βˆ’ 1  Can be solved analytically.  min 𝐷∈𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷 𝑇𝑇(π·π‘Œβˆ— )  0 ≀ 𝐷 ≀ 𝐼  𝑇𝑇 𝐷 = 𝑛 βˆ’ π‘˜  Can be solved analytically.
  • 34. Optimal Weights 26  Even if the assets are correctly chosen, without the correct weights, the portfolio is still not mean reverting. Determine optimal weights Semidefinite programming
  • 35. Utilize Mean Reverting Portfolio in Trading 27  Given the portfolio can be modelled as a mean reverting OU process, dynamic spread trading is a stochastic optimal control problem.  Objectives:  Given a fixed amount of capital, dynamically allocate capital over a risky mean reverting portfolioand a risk-free asset over a finite time horizon to maximize a general constant relative risk aversion (CRRA) utility function of the terminal wealth  Allocate capital amongst several mean reverting portfolios
  • 36. Utilize Mean Reverting Portfolio in Trading 28  Given the portfolio can be modelled as a mean reverting OU process, dynamic spread trading is a stochastic optimal control problem.  Mathematics involved:  Ornstein-Uhlenbeck (OU) estimation  Hamilton-Jacobi-Bellman (HJB) equation  ODE (Riccatti differential equations)  Portfolio allocation (mean variance analysis)
  • 37. Proposed Procedure  Step 1: Split a large pool of risky assets into sufficiently small clusters;  Step 2: Search each of the clusters for optimal small mean reverting portfolios;  Step 3: For each portfolio identified in Step 2, determine the optimal pairs trading strategy;  Step 4: Dynamically allocate money among mean reverting portfolios. 29
  • 38. Case Study – S&P 500 Stocks  Trading periods  From 2010-Jan-01 to 2014-Dec-31, 10 sub-trading period, length of every sub-period is 6 month;  Re-select the portfolio before each sub-trading period begins;  For every sub-trading period, 2 years stock data are used to select the portfolio.  Once portfolio is chosen, the weights of stocks are unchanged within the 6 month period  Rebalance when the difference between current portfolio price and last trade price is larger than a certain threshold.
  • 39. Case Study – S&P 500 Stocks  Assumptions  Margin requirement  For short selling, 50% of the short selling value needs to be deposited into the margin account.  50% of values of stocks in long position can be used as collateral for short margin account.  Cost  Transactioncost: 0.2% per transaction  Borrowing cost: 8% p.a. (short selling)  Risk-free rate: 0.55% p.a. (1-year LIBOR)
  • 40. Case Study – S&P 500 Stocks  An example, the last sub-trading period, 2014/07/02 - 2014/12/31:  In-sample fitting  2004/07/01-2014/07/01 Identify the largest cluster: 69 stocks are selected from S&P 500 stocks (covariance selection);  2012/07/01-2014/07/01 Calculate the optimal combination of stocks: 5 stocks are selected from the largest cluster and their weights are optimized (LASSO, semidefinite programming) ;  Fit an OU model to the portfolio constructed (OU estimation);  Out-of-sample trading (2014/07/02-2014/12/31)  Calibration frequency: rebalance when state changes more than 1 unit, state is (current price - mean)/s.d.;  Determine the optimal capital to be allocated to the portfolio and the risk-free asset (ODE solving, portfolio optimization);
  • 41. Case Study – S&P 500 Stocks  Optimal portfolio  The portfolio price is volume weighted average price  If we want to buy N shares of the portfolio, we need to buy 0.13N shares of CSX, buy 0.07N shares of DHI, buy 0.98N shares of FTR, sell 0.04N shares of GPS and sell 0.11 shares of MAR.  Although the weight of FTR seems to be large, it is only because the price of FTR is significantly lower than other stocks. Total value of FTR does not dominate values of other stocks. Stock Sector Weigh t Avg. price CSX Corp. Industrials 0.13 24.1 D. R. Horton Consumer Discretionary 0.07 21.1 Frontier Communications Telecommunications Services 0.98 4.1 Gap (The) Consumer Discretionary -0.04 36.7 Marriott Int'l. Consumer Discretionary -0.11 43.5
  • 42. Case Study – S&P 500 Stocks
  • 43. Case Study – S&P 500 Stocks 2010/01/01-2014/12/31 35