Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen ARMA and ARIMA Models | Section
Forecasting With Classical Models

bookARMA and ARIMA Models

Swipe um das Menü anzuzeigen

After learning about Autoregressive (AR) and Moving Average (MA) models, you are ready to explore how these ideas combine into more flexible models for time series forecasting. The ARMA(p, q) model merges the strengths of both AR and MA models, allowing you to capture relationships where current values depend both on previous values and on past errors. In this notation, pp is the order of the autoregressive part and qq is the order of the moving average part.

However, many real-world time series are not stationary; their mean or variance change over time, often due to trends or other long-term patterns. In such cases, simply applying ARMA is not enough. This is where the ARIMA(p, d, q) model comes in. The "I" stands for "Integrated" and refers to the process of differencing the series dd times to achieve stationarity before applying the ARMA model. Differencing means subtracting the previous value from the current value, which helps remove trends and stabilize the mean.

To summarize:

  • Use ARMA models for stationary time series;
  • Use ARIMA models for non-stationary time series, applying differencing as needed to achieve stationarity.

Now, you will see how to difference a time series and fit an ARIMA model in Python.

1234567891011121314151617181920212223242526
import pandas as pd from statsmodels.tsa.arima.model import ARIMA import matplotlib.pyplot as plt # Simulate a non-stationary time series with a trend data = pd.Series([i + (i % 5) for i in range(50)]) # Plot the original series plt.plot(data, label="Original Series") plt.legend() plt.show() # Difference the series to remove the trend (d=1) differenced = data.diff().dropna() # Plot the differenced series plt.plot(differenced, label="Differenced Series (d=1)") plt.legend() plt.show() # Fit an ARIMA model (p=1, d=1, q=1) model = ARIMA(data, order=(1, 1, 1)) model_fit = model.fit() # Print summary of the model print(model_fit.summary())
copy
question mark

When should you use an ARIMA model instead of an ARMA model?

Select the correct answer

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 8

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

Abschnitt 1. Kapitel 8
some-alt