Structural Breaks, what they are, how to spot them and how they appear in finance.
🧵 1/n
What is a Structural Break?
A structural break is when a timeseries suddenly starts behaving very differently.
This could be when it switches regimes for example.
2/n
What are some examples for structural breaks?
-Shift in local mean
-Much higher / lower volatility
-From Mean Reverting to Trending or the other way around
-Sudden different regression coefficients
etc.
3/n
How to detect Structural Breaks?
Method 1: CUSUM Filter
Let's say you have a mean reverting process that looks like the one below, we can cumulatively add up the change of this variable and set it to 0 whenever we exceed some threshold, let's say 0.005.
4/n
Now consider the following variable and look at what happens to the cusum filter.
It goes above out upper threshold which means we got a structural break at that point, at this point it resets to 0 meaning that this is now our new normal behavior.
5/n
Now look at the following variable: you will notice that there is a sudden increase in variance.
Let's define a new variable which is the standard deviation of our variable of let's say the past 30 values.
We can now run the cusum filter on the volatility of our variable.
6/n
Here I used a threshold of 0.002 .
As you can see it actually detected 2 structural breaks in a row, we can get around this by having more data.
Let's simulate 5000 data points instead of 500.
7/n
Using a threashold of 0.005 we get the following results.
The values for the thresholds are basically something you need to play around with historically.
Too high of a threshold and you don't catch structural breaks.
Too low and you capture too much randomness.
8/n
There are other tests used for detecting structural breaks like the chow test.
It basically fits models to different segments of your time series and then compares how different the coefficients are.
9/n
Structural breaks are often pretty exciting moments with potential to make lots of profit from.
Structural Break in correlation or vol? Run a momentum / mean reversion strat depending on the type of stuctural break.
etc.
10/n
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Moving Averages don't do well when data changes abruptly.
We can do better by solving a 100000-dimensional Second Order Cone Program.
Let's talk about Total variation denoising:
When to use it:
If you have a noisy dataset whose mean changes abruptly and you want to filter out all the noise and get the underlying process then Total variation denoising is perfect.
In the image below the black line is what we get after denoising.
Definition:
We have our original data x_1, x_2, ... and want to construct data y_1, y_2, ... such that the total variation V(y) is kept low while also keeping the sum of squared errors between the original data and our estimate y E(x, y) low.
This article gives a big overview of all the literature on market making models like the popular paper by Avellaneda & Stoikov and other popular papers in market making.
Most of those papers use convention that's used in real market making systems like fair price, spreads, etc. so you should get familiar with them.
Why more leverage doesn't necessarily mean more profit and how to find the optimal leverage.
🧵
1/n
Let's say you have $100. You do a trade, make 1% and are now at $101. You do a trade again with your $101 and this time you loose 1%.
Intuitively it would seem like you would be break even but if you do the math then 0.99*$101 is actually $99.99. You lost a penny!
2/n
Above is an example of what would happen to your equity if you did this 1000 times.
The bigger your returns are the more extreme this becomes.
If you have a 1% loss you only need a 1.0101...% return to make back your losses.
With a 50% loss you need a 100% return.
3/n