How it works...
In Step 2, we defined a function used for running the ADF test and printing out the results. We specified autolag='AIC' in the adfuller function, so the number of considered lags is automatically selected based on the Akaike Information Criterion (AIC). Alternatively, we could select this value manually.
For the kpss function (Step 3), we specified the regression argument. A value of 'c' corresponds to the null hypothesis stating that the series is level-stationary, while 'ct' corresponds to trend-stationary (removing the trend from the series would make it level-stationary).
For all the tests and the autocorrelation plots, we selected the significance level of 5%, which is the probability of rejecting the null hypothesis ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access