I've tried setting the maxlag with the ADF test in statsmodels but the number of lags being used by the test is not what I set it as. It is almost always less. Here's a small example of what I mean.
import numpy as np
import statsmodels.tsa.stattools as ts
x = np.array([1,2,3,4,3,4,2,3])
result = ts.adfuller(x, 1) # maxlag is now set to 1
>>> result
(-2.6825663173365015, 0.077103947319183241, 0, 7, {'5%': -3.4775828571428571, '1%': -4.9386902332361515, '10%': -2.8438679591836733}, 15.971188911270618)
The maxlag is set to one, but in the result it says the max lags used is 0 corresponding to the third entry in result.
Can anyone explain why this is happening and possibly how to fix this?
