I have two time series, and I am using one to forecast the other. Both are trend-nonstationary, so I de-trended them. The resulting model produces non-autocorrelatated residuals, but the Durbin-Watson is still low.
First, my independent variable is plotted, and I see that it is trend-nonstationary.
I can test and see that it is indeed trend-nonstationary, and that a removal of a trend would yield a stationary series.
from statsmodels.tsa.statstools import adfuller df_temp['past_flow'].plot() plt.show() plt.hist(df_temp['past_flow']) plt.show() result = adfuller(df_temp['past_flow']) print('ADF Statistic: %f' % result) print('p-value: %f' % result) ADF Statistic: -3.711959 p-value: 0.003948
So I detrend the series
df_temp['past_flow'] = signal.detrend(df_temp['past_flow'] )
I do the same with my dependent series, and I yield the following model:
This model has a rather low Durbin-Watson, but plotting the residuals, I see no autocorrelation: