Determining Differencing Order (d)
What you'll learn: How to decide how many times to difference your time series to make it stationary for ARIMA modeling.
The Core Idea
In ARIMA notation, the "d" represents the differencing order—how many times you need to subtract consecutive observations to achieve stationarity. Most non-stationary series need d=0 (already stationary), d=1 (first differencing), or rarely d=2 (second differencing). Going beyond d=2 is almost never necessary and can actually harm your model.
How to Determine d
Start with d=0: Check if your original series is already stationary using visual inspection and the Augmented Dickey-Fuller or KPSS tests you learned earlier.
Try d=1: If non-stationary, apply first-order differencing (subtracting each value from the previous one). Test again for stationarity. Most trending series become stationary after d=1.
Consider d=2 cautiously: If d=1 didn't work, try second-order differencing (differencing the already-differenced series). This is rare and typically only needed for series with changing trends.
The Balancing Act
Think of differencing like peeling an onion—you want to remove just enough layers (non-stationarity) without over-peeling and losing the essence of your data. Over-differencing introduces unnecessary complexity and can create artificial patterns.
Practical Guidelines
- Visual check: Plot the series after each differencing step. It should look like it fluctuates around a constant mean with stable variance.
- Statistical confirmation: Run stationarity tests after differencing.
- Stop when stationary: Don't difference more than necessary—if your tests confirm stationarity, stop there.
Key Takeaway: The differencing order (d) is typically 0, 1, or rarely 2; determine it by applying differencing incrementally and testing for stationarity after each step until the series becomes stationary.