2
$\begingroup$

I have run the Engle-Granger cointegration test in Python between a stock's return and its index return. In this case i have run the test between QQQ returns vs CCMP returns like this:

from statsmodels.tsa.stattools import coint

results = coint(df_stock_returns['QQQ'], df_stock_returns['CCMP'])

print(results)

which yields:

(-2.7063675732286856,
 0.1972968735378101,
 array([-3.99084033, -3.38795719, -3.08028241]))

The p-value is huge (0.19) so we can state that the two series are not cointegrated with a 95% confidence right?

Now, if i plot the two variables' time series, this is what i get:

enter image description here

How in the world is this even possible? They seem to move almost identically in time, they are almost like a replica of each other. Shouldn't we we be expecting to see the two variables moving/behaving differently over time? How can we explain that despite the high p-value the two series look so correlated like this? I have been searching about this in Google but i didn't find a meaningful answer and this is driving me nuts, i would really appreciate a good explanation about this.

Thank you very much in advance.

$\endgroup$

2 Answers 2

3
$\begingroup$

For cointegration, you need processes with unit roots. Stock returns do not have unit roots (as you can see, they fluctuate around zero rather than wandering off and potentially never returning), so they cannot be cointegrated.

$\endgroup$
4
  • $\begingroup$ Hi @Richard Hardy, thank you for your answer. I know this is a common practice in algorithmic trading, there are a lot of documentation about pairs trading using stock cointegration in Python. How is that stocks can't be co-integrated? Could you give a bit more of an explanation about this please? $\endgroup$ Commented Apr 28, 2021 at 22:24
  • 2
    $\begingroup$ @Miguel2488, stock prices can be cointegrated, but their returns cannot. You needs to analyze prices, not returns if you want to talk about cointegration and pairs trading. $\endgroup$ Commented Apr 29, 2021 at 5:59
  • 1
    $\begingroup$ Hi again @Richard Hardy, thank you very much for your clarification. I'll try with the prices and contrast the results :) $\endgroup$ Commented Apr 29, 2021 at 9:03
  • 1
    $\begingroup$ @Miguel2488, you are welcome! I am glad I could help. $\endgroup$ Commented Apr 29, 2021 at 9:03
1
$\begingroup$

You have 2 ways to interpret this:

  1. Your statistic (-2.606) > than any of the Critical values (-3.99084033, 3.38795719, -3.08028241). --> we accept the null hypothesis (=no cointegration)

  2. As you say it, p-value is huge: 0.1972968735378101.. 19.72% > than 1%, 5% and 10% ---> therefore we accept the null hypothesis and the data is not cointegrated

In order to interpret our cointegration results, you need to do the following:

  1. Estimate the cointegration regression.
  2. Test the residuals from the cointegration regression for unit root

If the residuals contain a unit root, then there is no cointegration.

$\endgroup$

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.