Session Ready
Exercise

Estimate Order of Model: PACF

One useful tool to identify the order of an AR model is to look at the Partial Autocorrelation Function (PACF). In this exercise, you will simulate two time series, an AR(1) and an AR(2), and calculate the sample PACF for each. You will notice that for an AR(1), the PACF should have a significant lag-1 value, and roughly zeros after that. And for an AR(2), the sample PACF should have significant lag-1 and lag-2 values, and zeros after that.

Just like you used the plot_acf function in earlier exercises, here you will use a function called plot_pacf in the statsmodels module.

Instructions
100 XP
  • Import the modules for simulating data and for plotting the PACF
  • Simulate an AR(1) with \(\small \phi=0.6\) (remember that the sign for the AR parameter is reversed)
  • Plot the PACF for simulated_data_1 using the plot_pacf function
  • Simulate an AR(2) with \(\small \phi_1=0.6, \phi_2=0.3\) (again, reverse the signs)
  • Plot the PACF for simulated_data_2 using the plot_pacf function