IniziaInizia gratis

AR or MA

In this exercise you will use the ACF and PACF to decide whether some data is best suited to an MA model or an AR model. Remember that selecting the right model order is of great importance to our predictions.

Remember that for different types of models we expect the following behavior in the ACF and PACF:

AR(p)MA(q)ARMA(p,q)
ACFTails offCuts off after lag qTails off
PACFCuts off after lag pTails offTails off

A time series with unknown properties, df is available for you in your environment.

Questo esercizio fa parte del corso

ARIMA Models in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Import
from statsmodels.graphics.tsaplots import ____, ____

# Create figure
fig, (ax1, ax2) = plt.subplots(2,1, figsize=(12,8))
 
# Plot the ACF of df
____(____, lags=____, zero=False, ax=ax1)

# Plot the PACF of df
____(____, lags=____, zero=____, ax=ax2)

plt.show()
Modifica ed esegui il codice