Back to Community
stationary subspace analysis

SSA is an algorithm that factorizes a multivariate time series into stationary and non stationary components. Unfortunately there is no python implementation available. I used the Java SSA toolbox on a a random set of 10 XLE components using Yahoo daily prices and tried to see if it can find a mean reverting stationary series. Apparently it seems to work.

You can read more about SSA here

You can also see results of my experiment here

Looking forward to comments for a discussion/improvements/viability etc.

6 responses

Seems like a pretty cool trick.

The wikipedia page is uninformative. The first citation describes the method in detail.

It's not clear from your Quora post what metrics you're measuring its success by.

This is essentially a method for finding co-integrated linear combinations of instruments, which I would expect to be substantially arbitraged out of most market prices at this stage.

Thanks for your feedback Alex. I implemented a closed form solution of SSA in python and here are the test results. It works but requires careful calibration of block sizes (epoch lengths) and available blocks.

Loading notebook preview...
Notebook previews are currently unavailable.

Any suggestions as to how to create buy and sell rules from this research?

Would you guys be very patient and explain to a non statistician (me) how you would apply this to a stock system?

I can see that typically a time series for financial instrument is non stationary. It contains trends, its variance increases and decreases in time, in might contain seasonality particularly in the commodities markets.

The above chart looks to a non expert (me) to be stationary. It looks to be mean reverting and hence one could profit from an overbought / oversold type of system.

If this is the case where have the non stationary elements gone? Is there another chart which shows just non stationary elements? Can one use such a procedure on a single time series to inform one when to apply mean reversion and when to apply momentum strategies?

Is it predictive or merely historic?

Hi Anthony,

You are absolutely right. This procedure separates the stationary and non stationary components. If you want you could also extract the non stationary components from this procedure. Simply use the eigen vector corresponding to the largest eigen value and you get the non stationary.

Basically given X non stationary stock prices, it finds out weights such that the combined portfolio is stationary.

The red line in the above graph is historic (in sample data) and the blue line is out of sample. Attached is a demo algorithm to trade using this research. To increase trading activity add more baskets.

Best regards,

Clone Algorithm
36
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 57b068b67ea87f1008cbd889
There was a runtime error.

Basically given X non stationary stock prices, it finds out weights such that the combined portfolio is stationary.

Hugely valuable explanation and thank you. I have cloned the algo, for which more thanks and will turn my attention to it once I have got a little further forward in my foray into machine learning (using Noddy textbooks that even I can understand).

I am still trying to answer the following question which I have been asking myself for a while now:

Does increased statistical and ML sophistication translate into better trading? Does it (can it) enhance or replace "traditional" technical analysis solutions converted to systematic strategies such as the simple momentum system I posted here.

Will my research overcome my scepticism and lead me to withdraw my accusations of "mathturbation" ( a phrase famously used by sometime physicist and trader Ed Seykota).

Will I manage to verify the following academic paper? And if so, will it stand up to further out of sample training/testing? Will it achieve a high CAGR in actual trading or will it turn out to have been over fitted to the data?

45% CAGR from ML enhanced Momentum Trading

That is an interesting paper Anthony.