Exercise

Compare AR Model with Random Walk

Sometimes it is difficult to distinguish between a time series that is slightly mean reverting and a time series that does not mean revert at all, like a random walk. You will compare the ACF for the slightly mean-reverting interest rate series of the last exercise with a simulated random walk with the same number of observations.

You should notice when plotting the autocorrelation of these two series side-by-side that they look very similar.

Instructions

100 XP
  • Import plot_acf function from the statsmodels module
  • Create two axes for the two subplots
  • Plot the autocorrelation function for 12 lags of the interest rate series interest_rate_data in the top plot
  • Plot the autocorrelation function for 12 lags of the interest rate series simulated_data in the bottom plot