3
$\begingroup$

My understanding is that a time series that does not appear to have constant variance over time is not stationary and that the Dickey Fuller test tests for stationarity (with the null hypothesis that the series is not stationary).

I created a synthetic series of 1000 points where each successive point is drawn from a Gaussian distribution with increasing variance. I ran the Dickey Fuller test on the series and consistently get significant p-values indicating the series is stationary. I'm not sure if I'm misunderstanding the test or what a stationary series is.

import numpy as np
from statsmodels.tsa.stattools import adfuller
result = []
np.random.seed(42)
for i in np.arange(0,10,0.001):
    result.append(np.random.normal(scale=i))
print(adfuller(result, autolag='AIC')[0])
print(adfuller(result, autolag='AIC')[4])

Output

-23.097799978008958
{'1%': -3.431005409094333, '5%': -2.8618296517685877, '10%': -2.566924176499291}
$\endgroup$
2

1 Answer 1

4
$\begingroup$

The null hypothesis of the augmented Dickey-Fuller test is not that the time series is nonstationary in general but specifically that it contains a unit root. The time series you generated does not contain a unit root, so the ADF test predictably rejects $H_0$, just as it should.

$\endgroup$
4
  • $\begingroup$ The Wikipedia article seems to imply that unit root and non-stationary are synonymous "A unit root is present if $\rho =1$. The model would be non-stationary in this case.", is this incorrect? $\endgroup$
    – Yandle
    Commented Oct 4, 2023 at 15:05
  • 1
    $\begingroup$ @Yandle, A implies not B is not equivalent to Not A implies B. While you cannot have presence of a unit root (A) and stationarity (B) simultaneously (so A does imply not B), you can have absence of a unit root (not A) and absence of stationarity (not B) simulateneously (not A does not imply B). $\endgroup$ Commented Oct 4, 2023 at 17:36
  • $\begingroup$ So the alternative hypothesis is $\rho\neq 1$, not 'stationarity'? $\endgroup$
    – Yandle
    Commented Oct 4, 2023 at 18:37
  • 1
    $\begingroup$ @Yandle, the alternative hypothesis is $\rho<1$. There is also a version of the test where the alternative is $\rho>1$ (an explosive process) but it is less commonly applied. $\endgroup$ Commented Oct 4, 2023 at 19:03

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.