Air Passengers Forecasting with ARIMA
Decompose the classic Air Passengers time series, identify trend and seasonality, fit an ARIMA model, and forecast 12 months ahead.
What this AI workflow does
This AI Data Analyst workflow loads the Air Passengers monthly time series from a CSV URL and plots the 1949–1960 passenger counts. It decomposes the series into trend, seasonal, and residual components and checks stationarity using the Augmented Dickey-Fuller test with differencing as needed. It then fits an ARIMA model and generates a 12-month forecast with confidence intervals.
Who this example is for
This is for analysts and students learning classical time-series forecasting with decomposition, stationarity checks, and ARIMA modeling. It helps practitioners build a reproducible baseline forecast workflow on a well-known seasonal dataset.
Expected analysis outcomes
These are the results the AI workflow is expected to generate.
- Time-series line chart showing trend and seasonality (1949–1960)
- Seasonal decomposition plot with trend/seasonal/residual panels
- ADF test output and differencing step to achieve stationarity
- ARIMA model fit summary and diagnostics-ready artifacts
- 12-month forecast plot with confidence intervals
Tools and libraries used
Main Python packages and tooling used to run this AI data analysis task.
- pandas
- numpy
- matplotlib
- statsmodels
- scipy
Prompt sequence
This is the exact list of prompts used in this workflow. The same prompt sequence is sent to each model so outputs and scores can be compared fairly.
- 1load air passengers dataset from https://raw.githubusercontent.com/pplonski/datasets-for-start/refs/heads/master/air-passengers/AirPassengers.csv and plot the time series
- 2decompose the series into trend, seasonality and residuals
- 3check stationarity with ADF test and apply differencing if needed
- 4fit an ARIMA model and forecast the next 12 months
Model Comparison
We compared several LLM models on the same analysis task. The table below shows their scores side by side. You can also open each model run to check the full conversation and notebook results.
| Model Source | Score | Task | Execution | Output | Reasoning | Reliability | Run |
|---|---|---|---|---|---|---|---|
| gemma4:31b | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open gemma4:31b conversation |
| glm-5.1 | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open glm-5.1 conversation |
| gpt-oss:120b | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open gpt-oss:120b conversation |
| qwen3.5:397b | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open qwen3.5:397b conversation |
| gpt-5.4 | 9/10 | 2/2 | 2/2 | 3/3 | 1/2 | 1/1 | Open gpt-5.4 conversation |
| qwen3-coder-next | 8/10 | 2/2 | 2/2 | 3/3 | 1/2 | 0/1 | Open qwen3-coder-next conversation |
How scoring works
Each run is graded on five dimensions:
- Task Completion (0-2): how fully the workflow answered the requested analysis task and completed required steps.
- Execution Correctness (0-2): whether generated code is correct, consistent, and likely runnable without major fixes.
- Output Quality (0-3): how well tables, charts, and results match the expected analytical outcomes.
- Reasoning Quality (0-2): clarity and correctness of interpretation, explanation, and conclusions.
- Reliability (0-1): robustness of the run, including low hallucination risk and stable behavior.
The final score is the sum of these dimensions, so total score = 0-10. Higher values indicate more complete, correct, and reliable notebook results for this workflow.
AI Analysis with qwen3.5:397b
This run uses AI with a step-by-step list of prompts to perform the analysis task Air Passengers Forecasting with ARIMA. Below, you can review the full conversation generated with qwen3.5:397b. After the conversation, we show detailed score cards for this run.
Score cards for qwen3.5:397b for Air Passengers Forecasting with ARIMA
Total score: 10/10
Task Completion: 2/2
ExcellentThe workflow completed all major requested steps: loading and plotting the series, decomposition, ADF stationarity testing with differencing, and ARIMA/SARIMA forecasting for 12 months.
Execution Correctness: 2/2
ExcellentThe provided code is coherent and likely runnable, with valid pandas, statsmodels, and plotting usage. No major syntax or logic-breaking errors are evident from the notebook content.
Output Quality: 3/3
ExcellentThe outputs match the expected outcomes: a clear time-series plot, a 4-panel decomposition, ADF results showing differencing improves stationarity, and a forecast table with confidence intervals. The semantic results align well with the task.
Reasoning Quality: 2/2
ExcellentThe reasoning correctly identifies the need for decomposition, stationarity testing, differencing, and ARIMA-family forecasting. The choice of second differencing is supported by the ADF results shown.
Reliability: 1/1
ExcellentThe workflow is consistent and evidence-based, with outputs supporting the conclusions. It is reasonably robust despite using SARIMAX rather than a plain ARIMA model.
Try MLJAR Studio
Run the same type of AI-powered data analysis on your own datasets with conversational notebooks in MLJAR Studio.
Explore More AI Analysis Examples
Discover additional workflows across categories. Each example includes prompts, conversation outputs, and model-level scoring so you can compare approaches and results.