0

ADFTest() from pmdarima and adfuller() from statsmodels produce different p-values when given as input the same time series. Why is this happening?

For example:

from pmdarima.arima.stationarity import ADFTest
adf_test = ADFTest()
p_val1, should_diff = adf_test.should_diff(series.arrivals)
print(p_val1)

from statsmodels.tsa.stattools import adfuller
ad_fuller_result = adfuller(series.arrivals)
p_val2 = ad_fuller_result[1]
print(p_val2)

Output:

p_val1 = 0.05134192567802651
p_val2 = 0.3632790519019964
Clabis
  • 15
  • 2
  • 8
  • hi, please provide a [reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) – Mustafa Aydın Mar 30 '21 at 17:53
  • do you need me to give you the series also? – Clabis Mar 30 '21 at 18:12
  • The most likely difference is due to the deterministic terms included. `ADFTest` uses a data dependent choice of the deterministic terms, which is not a standard choice. A quick inspection of the code in pmdarima's `ADFTest` suggests it is wrong since it does not determine the critical value based on the number of deterministic terms included. I would not trust this function. A third, and mostly clean sheet implementation, is available in the `arch` package (which I maintain), although it is closer to statsmodels in terms of choices. – Kevin S Mar 31 '21 at 10:20

0 Answers0