0
$\begingroup$

I've been wondering recently about covariance stationarity. Say we have a stationary series with statsmodels' ADF and KPSS results:

enter image description here

ADF:  (-17.69367433194328, 3.562758332968972e-30, 0, 326, {'1%': -3.4505694423906546, '5%': -2.8704469462727795, '10%': -2.5715154495841017}, 4125.109339911818)

KPSS:  (0.27792620704854987, 0.1, 17, {'10%': 0.347, '5%': 0.463, '2.5%': 0.574, '1%': 0.739})

and then let us calculate rolling autocovariance functions for the first lag and more-or-less-random rolling window:

    for i in [2, 10, 20, 30, 50, 100]:
      walk_cov = data.rolling(i).cov()["diff"][:, "lag"].plot()
      plt.show()  

this code results in:

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

You can say I've gone completely crazy, but to me this doesn't look like any of these plots represent stable autocovariance, even though both ADF and KPSS tests said it is. Are the biggest values here simply outliers that were artificially created by big epsilon of the process? And if it isn't, how do models like autoregressive model even hold up?

Am I doing something wrong, or am I missing some piece of information?

PS: I'm NOT using log returns on purpose in this example.

$\endgroup$
8
  • $\begingroup$ Your first included image is almost unreadable! Please nclude that information as text, not as an image. $\endgroup$ Commented Apr 23, 2022 at 2:14
  • 2
    $\begingroup$ Hi: Those tests are for unit root testing. They are not testing for stable autocovariance (ac). For a series to exhibit strong stationarity, the ac of any group of observations should be time-invariant but that's not what those tests test for. My guess is that you're interested in weak stationarity where one tests for constant mean and constant variance. But those tests don't test for that either. A unit root is one type of non-stationarity so, if you find a unit root you can reject stationarity ( weak and strong ). But not finding a unit root is not a sufficient condition for stationarity. $\endgroup$
    – mlofton
    Commented Apr 23, 2022 at 3:31
  • $\begingroup$ @mlofton thanks for the answer! However, as far as I understand the ADF structure, the test actually creates an AR model, which means it is somehow possible for it to represent that process as (cov(x,y)/var(x)) in order to get the coefficients. Does that mean it's overfitting it on purpose? And more interestingly, as you say 'not finding a unit root is not sufficient' - what would your recommendation be to confirm covariance stability? $\endgroup$
    – Fatafim
    Commented Apr 23, 2022 at 10:04
  • $\begingroup$ @mlofton also, how would you define sufficient condition for stationarity in practice? $\endgroup$
    – Fatafim
    Commented Apr 23, 2022 at 10:04
  • $\begingroup$ Hi: I'm not sure that I understand your first question but all the ADF test is test for whether the series has the structure $y_t = y_{t-1} + $ whatever. It's complex in terms of its implementation but that's what it's doing. So, it's testing for whether $\beta$, the coefficient of $y_{t-1}$, equals 1. $\endgroup$
    – mlofton
    Commented Apr 23, 2022 at 11:19

0

Your Answer

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