Is it possible to estimate the optimal look back period for OLS from which we test if residuals are stationary? Almost all papers that I read use random look back periods of 100 days, 252 days, 500 days etc.

I think this procedure introduces data snooping bias.

The only "quantitative" method that I've found so far is calculation half-life of mean reversion and using it as a look back period.

Can somebody suggest a methodology or a procedure to select the optimal length of a look back period which can be used to test if a pair of stocks is co-integrated?

Any help will be appreciated.

  • $\begingroup$ I have a question of my own. How is it possible to use the half-life to determine the windows size if the parameters needed to calculate the half-life can only be estimated after one sets up the window somehow? $\endgroup$
    – James
    Jun 25, 2015 at 17:58
  • $\begingroup$ yes, you set up a random window first, estimate half-life and the continue with half-life*x (where x is < 1) as a look back period. $\endgroup$ Jun 25, 2015 at 18:16
  • $\begingroup$ And how does one choose the random window? $\endgroup$
    – James
    Jun 26, 2015 at 14:45

2 Answers 2


Yes, you're right.

Choosing a fixed lookback period allows you to find more couple of candidates to implement a statistical arbitrages, but it is misleading, in the sense that, looking back, it leads you in finding the period in which a couple of assets are cointegrated and not a couple of assets are really cointegrated;

So, what could be the solution to this problem?

Test (and, after, backtest) for different periods; if the results are too different, the cointegration relationship is not robust and, so, the candidated couple of assets is not good

In my humble opinion, it is interesting to follow E. Chan's blog, who deals with the statistical arbitrage topic pretty often; his books are pretty interesting too.

As regards the half-life, it corresponds to how long (approximately) on average you should expect to hold the spread you're investing in, before it becomes profitable and it is not the optimal length of the lookback period.

Hope this helps.


I think there is no quantitative method, but one can use some common sense based on how long one is willing to hold the position. For instance, if you don't want to hold a position in oil futures for more than a month, using a 10-year window is of no use even if the annual oil price is stationary.

In practice, the trader probably tests a few windows whose size is proportional to the reasonable holding period and picks the one that works best. As always, data snooping is offset by testing the strategy out-of-sample.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.