1. Learn
  2. /
  3. Courses
  4. /
  5. ARIMA Models in Python

Exercise

Augmented Dicky-Fuller

In this exercise you will run the augmented Dicky-Fuller test on the earthquakes time series to test for stationarity. You plotted this time series in the last exercise. It looked like it could be stationary, but earthquakes are very damaging. If you want to make predictions about them you better be sure.

Remember that if it were not stationary this would mean that the number of earthquakes per year has a trend and is changing. This would be terrible news if it is trending upwards, as it means more damage. It would also be terrible news if it were trending downwards, it might suggest the core of our planet is changing and this could have lots of knock on effects for us!

The earthquakes DataFrame has been loaded in for you as earthquake.

Instructions

100 XP
  • Import the augmented Dicky-Fuller function adfuller() from statsmodels.
  • Run the adfuller() function on the 'earthquakes_per_year' column of the earthquake DataFrame and assign the result to result.
  • Print the test statistic, the p-value and the critical values.