0% found this document useful (0 votes)
28 views38 pages

Stat Arb

Uploaded by

yiyangsong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views38 pages

Stat Arb

Uploaded by

yiyangsong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Statistical Arbitrage (Stat Arb)

Week 10

traders.berkeley.edu
Announcements

● Final project coming out soon!


○ Stay tuned for more details on Ed
Agenda

● Brainteaser
● What is stat arb?
● Stat arb pipeline
○ Identifying relationships
○ Trading relationships
○ Managing risk
Problem of the Day
I have a dataset which I can split into four parts (say by marginalizing by a
categorical variable). A linear model can achieve an R^2 of .8 on each of these
individual datasets.

What’s the range of R^2 of a linear model on the aggregate dataset?


Solution
● An R^2 of 0 can be achieved by having the four clusters arranged such that
the OLS prediction degenerates to the mean ie have our four cluster be
symmetric about the origin.
● An R^2 of 1 can be achieved in the limit. Consider two clumps on a line with
slope not equal to 0. Move these clumps infinitely far away from each other.
Warning!

This is by far the most mathematically involved lecture so


far–please ask questions and stop me if anything is unclear.
What is Stat Arb?
Arbitrage
● Arbitrage describes trades where one earns a risk-free profit.
● Traditionally, arbitrage occurs between fundamentally linked assets, like an
ETF and its constituent securities.
● See the quantitative strategies lecture for more.
Stat Arb
● Stat arb is a class of trading strategies by which you identify and trade on
statistical relationships between assets.
○ Usually this looks like pairs trading.
● Stat arb is fundamentally a reversion strategy: we general hope that any
deviation from historical statistical relationships is simply due to inefficiency
or a temporary disruption and will correct in the future.
● Stat Arb differs from other styles of trading that we have discussed in that it is
generally at longer time scales (seconds to days).
● While market making has a capped upside, stat arb has potentially unlimited
upside.
Statistical Relationships
Identifying them:
● Fundamental Factors
○ Like Coke vs Pepsi
● Testing relationships on historical data
○ Beware of false discovery rates

Useful Concepts
● Correlation
○ Pearson: linear relationship between two random variables
■ E(XY)/[SD(X)SD(Y)]
○ Spearman: monotonic relationship between two variables
■ Pearson correlation between ranks
● Cointegration
○ Some linear combination of the two time series sum to a constant
Identifying Relationships
Regression Hypothesis Testing
● First, we have to specify a distribution. Correlation (and regression
coefficients) is generally assumed to follow a Student’s t distribution.
○ Null Hypothesis: 𝝆=0 Alternative: 𝝆≠0 with some significance level ɑ.
● Test for time series stationarity (Augmented Dickey-Fuller Test).
○ This is important because if your time series has a trend, you usually cannot perform inference
on the whole dataset.
● Most parametric tests can also be performed in non-parametric ways using
bootstrapping.
Using Correlation
● Usually, we want to
measure the relationship
between the returns.
● Returns are generally
stationary time series
which tells us that price is
an order one time series
Error Rate Analysis
● We will generally run many hypothesis tests, and we want to ensure that our
discoveries are real.
● Therefore we have to consider the False Discovery Rate (FDR) and the
Family-wise Error Rate (FWER).
● The FDR is E[V/R], ie the total number of false discoveries/the total number
of total discoveries
● The FWER (assuming our tests are independent) is 1-(1-ɑ)^n, where we run n
hypothesis tests.
Controlling the FWER: Bonferroni Correction
● Let’s say we run n hypothesis tests and we a global 5% error rate.
● We can just run each test at ɑ=.05/n.
● This gives us our goal, but is super conservative, because it assumes all of
our rejection regions are disjoint.
● This is literally the worst case.
Controlling the FDR: Benjamini-Hochberg
● The Benjamini-Hochberg procedure limits the FDR using the following
procedure.
1. Run hypothesis tests.
2. Collect p values and sort them.
3. Plot the line k/m*ɑ, where k is the rank of the current test and m is the
number of tests
4. Reject the null hypothesis for tests below this line.
Also Important
● Online FDR control (you don’t know how many hypothesis tests you’re going
to run)
○ Use the LORD algorithm
○ Or Generalized alpha investment (GAI, SAFFRON)
Out-of-Sample Testing
● Usually, you don’t just train a model on your dataset and hope it works, you
hold out a certain amount of the data to test on after training.
● Beware: data leakage. What is wrong with the following situations?
○ In order to test the performance of a strategy on the S&P, I take its current constituent stocks
and trade a momentum-based strategy on their returns.
○ I take a returns series, shuffle it and split it into a train and test set. I then train a model and
see shockingly good results on the test set.
Trading Stat Arb
No (Stat) Arbitrage Bounds
● Whenever you take a position, you have to cross the spread.
● You should not take the position when E[profit] ≤ 2*spread
● The following example does not yield a profit

Asset 1 Asset 2 Asset 1 Asset 2


Positions to Take (What)

● Short the over performer, long the underperformer.


● Make the position such that you’re betting that current deviations return
● Usually, we also don’t want to take on too much correlated risk–so we sometimes
use other trades to hedge.
○ For example, if I have 2 trades that have low correlation, I might be more
confident sizing up, because one not panning out has little bearing on the
others
Sizing (How much)
● This depends a lot on portfolio construction and risk limits
● For example, if your expected max deviation is $10 below the current price,
you shouldn't size up such that you get margin called when this max
deviation is achieved.
● How should we handle incorrect estimates and out of distribution events?
Risk Management
Portfolio Risk
● Let’s say you’re running a large stat arb strategy and a market event occurs
such that several relationships all dislocate.
● You trade on each of these relationships.
● However, as since these relationships are all correlated you run the risk of
further drawdown tanking your portfolio and getting margin called.
Structural Divergence
● A relationship may no longer exist for fundamental reasons.
● Example:
○ Let’s say you’re pairs trading Microsoft and Amazon, specifically on their respective cloud
computing businesses.
○ However, the anti-trust action is taken against Microsoft so they have to drop Azure (their
cloud platform).
○ Your statistical relationship will likely no longer hold, even when the two securities diverge.
Failure to Converge
● It is hard to predict when two statistically related securities will converge back
to their original relationship.
○ This is roughly equivalent to detecting distribution shift in an online setting. There’s a lot of
work going into how to do this.
● This can yield long term exposure to the securities you’re trading, which isn’t
a great thing.
● Stop losses or trade exit time periods can help mitigate this risk.
Liquidity Risk
● If you are running a strategy in illiquid assets, it may be very hard to clear
positions, even after reconvergence.
● You will also not be able to take large positions without having a large market
impact.
● How can you solve this?
Trade Example
Real World
● Coke and Pepsi are in very similar lines of business and therefore have very
similar price movements.
● Consider a situation where Coke’s earnings call happens and they severely
miss expectations. It’s likely that Pepsi will also miss their earnings.
● How do you trade this?
Toy
● Securities A and B’s are statistically related and usually have the following
price relationship: 3A-2B = 10 + e, where e is a gaussian(0, 7) noise term.
● Security A is current prices at $31, Security B is currently priced at $40.
● What position do you take?
Portfolio Example
Optimize which trades to take
● You have a number of trades, each of which you have measured certain
correlations for. Let’s say that you’re modelling each of these trades as a
direction in a multivariate gaussian with mean vector [100, -50, 80]^T and
covariance matrix [[1000, -400, 900], [-400, 500, -600], [900, -600, 950]].
● What trades to you make to maximize the risk adjusted return of this
strategy? (Just state the objective function)
○ Hint: model the trade as aX+bY+cZ, where X, Y, Z are each of possible trades.
Major Players
Major Players
● PDT Partners
● TGS Management
● Renaissance Technologies
● Two Sigma
● D.E. Shaw
● AQR
Questions?

You might also like