Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Forecasting with ARIMA | Implementing ARIMA for Forecasting
Time Series Forecasting with ARIMA

bookForecasting with ARIMA

Once you have fitted an ARIMA model to your time series data, you can use it to forecast future values. The forecasting process involves projecting the time series beyond the observed data, using the model's learned parameters. ARIMA models not only provide point forecasts (the most likely future values) but also forecast intervals, which represent the range within which the true values are likely to fall with a certain probability (usually 95%).

Forecast intervals are important because they account for the uncertainty inherent in predicting future values. A narrower interval suggests higher confidence in the forecast, while a wider interval indicates more uncertainty. When interpreting ARIMA forecast plots, pay attention to both the predicted values and the intervals. The intervals typically widen as the forecast horizon increases, reflecting growing uncertainty further into the future.

1234567891011121314151617181920212223242526272829303132333435363738
import pandas as pd import matplotlib.pyplot as plt from statsmodels.tsa.arima.model import ARIMA # Generate example time series data date_range = pd.date_range(start="2020-01-01", periods=100, freq="ME") data = pd.Series( [i + 10 * (i % 12 == 0) + 5 * (i % 6 == 0) for i in range(100)], index=date_range ) # Fit ARIMA model (order chosen for demonstration) model = ARIMA(data, order=(1, 1, 1)) fitted_model = model.fit() # Forecast next 12 periods forecast_result = fitted_model.get_forecast(steps=12) forecast = forecast_result.predicted_mean conf_int = forecast_result.conf_int() # Plot original data and forecasts with intervals plt.figure(figsize=(10, 6)) plt.plot(data, label="Observed") plt.plot(forecast.index, forecast, label="Forecast", color="orange") plt.fill_between( forecast.index, conf_int.iloc[:, 0], conf_int.iloc[:, 1], color="orange", alpha=0.3, label="95% Confidence Interval" ) plt.xlabel("Date") plt.ylabel("Value") plt.title("ARIMA Forecast with 95% Confidence Intervals") plt.legend() plt.tight_layout() plt.show()
copy
question mark

Which statement best describes the 95% confidence interval shown in an ARIMA forecast plot?

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Can you explain how to interpret the ARIMA forecast plot?

What do the parameters (1, 1, 1) in the ARIMA model mean?

How can I choose the best ARIMA order for my own data?

Awesome!

Completion rate improved to 6.67

bookForecasting with ARIMA

Glissez pour afficher le menu

Once you have fitted an ARIMA model to your time series data, you can use it to forecast future values. The forecasting process involves projecting the time series beyond the observed data, using the model's learned parameters. ARIMA models not only provide point forecasts (the most likely future values) but also forecast intervals, which represent the range within which the true values are likely to fall with a certain probability (usually 95%).

Forecast intervals are important because they account for the uncertainty inherent in predicting future values. A narrower interval suggests higher confidence in the forecast, while a wider interval indicates more uncertainty. When interpreting ARIMA forecast plots, pay attention to both the predicted values and the intervals. The intervals typically widen as the forecast horizon increases, reflecting growing uncertainty further into the future.

1234567891011121314151617181920212223242526272829303132333435363738
import pandas as pd import matplotlib.pyplot as plt from statsmodels.tsa.arima.model import ARIMA # Generate example time series data date_range = pd.date_range(start="2020-01-01", periods=100, freq="ME") data = pd.Series( [i + 10 * (i % 12 == 0) + 5 * (i % 6 == 0) for i in range(100)], index=date_range ) # Fit ARIMA model (order chosen for demonstration) model = ARIMA(data, order=(1, 1, 1)) fitted_model = model.fit() # Forecast next 12 periods forecast_result = fitted_model.get_forecast(steps=12) forecast = forecast_result.predicted_mean conf_int = forecast_result.conf_int() # Plot original data and forecasts with intervals plt.figure(figsize=(10, 6)) plt.plot(data, label="Observed") plt.plot(forecast.index, forecast, label="Forecast", color="orange") plt.fill_between( forecast.index, conf_int.iloc[:, 0], conf_int.iloc[:, 1], color="orange", alpha=0.3, label="95% Confidence Interval" ) plt.xlabel("Date") plt.ylabel("Value") plt.title("ARIMA Forecast with 95% Confidence Intervals") plt.legend() plt.tight_layout() plt.show()
copy
question mark

Which statement best describes the 95% confidence interval shown in an ARIMA forecast plot?

Select the correct answer

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2
some-alt