Aan de slagGa gratis aan de slag

Fitting Prelude

Great, you understand model order! Understanding the order is important when it comes to fitting models. You will always need to select the order of model you fit to your data, no matter what that data is.

In this exercise you will do some basic fitting. Fitting models is the next key step towards making predictions. We'll go into this more in the next chapter but let's get a head start.

Some example ARMA(1,1) data have been created and are available in your environment as y. This data could represent the amount of traffic congestion. You could use forecasts of this to suggest the efficient routes for drivers.

Deze oefening maakt deel uit van de cursus

ARIMA Models in Python

Cursus bekijken

Oefeninstructies

  • Import the ARIMA model class from the statsmodels.tsa.arima.model submodule.
  • Create a model object, passing it the time series y and the model order (1,0,1). Assign this to the variable model.
  • Use the model's .fit() method to fit to the data.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Import the ARIMA model
from ____ import ____

# Instantiate the model
model = ____(____, order=____)

# Fit the model
results = ____
Code bewerken en uitvoeren