Exercise

Is Temperature a Random Walk (with Drift)?

An ARMA model is a simplistic approach to forecasting climate changes, but it illustrates many of the topics covered in this class.

The DataFrame temp_NY contains the average annual temperature in Central Park, NY from 1870-2016 (the data was downloaded from the NOAA here). Plot the data and test whether it follows a random walk (with drift).

Instructions

100 XP
  • Convert the index of years into a datetime object using pd.to_datetime(), and since the data is annual, pass the argument format='%Y'.
  • Plot the data using .plot()
  • Compute the p-value the Augmented Dickey Fuller test using the adfuller function.
  • Save the results of the ADF test in result, and print out the p-value in result[1].