MBS Mohammed Baobaid
All projects
Project
University project Data Analytics Created February 18, 2026 at 1:37 PM

Product Demand Time Series Forecasting

A reproducible ARIMA and ETS forecasting case that turns daily store-item sales into monthly inventory planning guidance.

Created on February 18, 2026 at 1:37 PM, this STAT 482 case study turns five years of retail sales history into a practical demand forecast for inventory planning. I built the workflow in R Markdown, diagnosed trend and seasonality, compared ARIMA and ETS models, validated the result on a holdout window, and translated forecast intervals into safety-stock guidance.

R R Markdown forecast tseries tidyverse lubridate ARIMA ETS Kaggle
Narrated walkthrough

This audio is not a word-for-word copy of the case below. You can read the written case while listening to me explain the project in more detail.

0:00 / 0:00
Speed
Product Demand Time Series Forecasting project preview
913K Training rows
60 Monthly series
4.46% Holdout MAPE
70-80 Safety stock

Role

Lead forecasting analyst and report author with Hamed Al-Saedi and Majid Tayfour

Outcome

The selected ARIMA(0,1,1)(0,1,0)[12] model reached 4.46% MAPE on the six-month holdout set and produced a forward demand path from about 500 to 865 units. The final recommendation kept safety stock around 70 to 80 units per month, with higher buffers during peak demand.

The Challenge

The business problem was not simply to draw a forecast line. Inventory teams need a number they can use: enough stock to avoid missed sales, but not so much that cash and shelf space are trapped in slow-moving inventory. The case therefore needed a transparent forecasting workflow that could explain trend, seasonality, uncertainty, and safety stock in operational terms.

The Approach

I treated the project as an inventory-planning workflow. I started with the full daily sales table, isolated a clear store-item demand stream, aggregated daily sales to monthly totals, decomposed the series, tested stationarity, applied first and seasonal differencing, compared ARIMA and ETS models, then used the selected forecast intervals to recommend a practical buffer for future months.

How it works

I started with the inventory decision

The case starts with a practical operating question: how much demand should the company prepare for next month and the months after that? I framed forecasting as an inventory decision instead of a purely statistical exercise. That kept the model comparison grounded in stockouts, overstock, reorder planning, and the value of forecast uncertainty.

I reduced a large sales table into a controlled demand stream

The source training file contained 913,000 daily sales records for 10 stores and 50 items from 2013 to 2017. To keep the case interpretable, I focused on Store 1 and Item 1, then aggregated the daily records into 60 monthly observations. That monthly series became the decision unit for inventory planning.

Monthly sales time series for Store 1 Item 1
The first output shows the 60-month demand stream created from the daily sales table.
Seasonal pattern plot for monthly sales by year
The seasonal plot makes the repeated annual demand shape visible before modeling.

I diagnosed the pattern before choosing a model

The series had a clear recurring seasonal shape and a level that changed over time, so I compared additive and multiplicative decomposition before fitting forecasting models. The multiplicative view matched the business pattern better because seasonal swings grew and shrank with the demand level rather than staying fixed in absolute units.

Multiplicative decomposition output with data trend seasonal and remainder panels
The decomposition output separates the observed data into trend, seasonal, and remainder components.

I made stationarity explicit

Before fitting ARIMA, I checked stationarity rather than assuming it. The ADF and KPSS results pointed to a series that still needed transformation, so I used first differencing and seasonal differencing. That gave the final ARIMA model a more defensible statistical foundation.

First-order and seasonal differencing plots for monthly sales
The differencing output shows how the series was transformed before ARIMA fitting.
Stationarity test table with ADF and KPSS outputs
The stationarity table keeps the ADF and KPSS evidence visible instead of burying the decision in prose.

I compared ARIMA and ETS as competing planning models

The final comparison was between an ARIMA(0,1,1)(0,1,0)[12] model and an ETS(M,Ad,M) model. ARIMA had the stronger inventory-facing accuracy profile, especially on MAPE, while ETS remained useful as a benchmark because it modeled level, trend, and multiplicative seasonality directly.

Holdout model comparison table for ARIMA and ETS
The model-comparison table shows the exact holdout metrics used to select ARIMA.

I validated the result on a six-month holdout

The six-month holdout was the credibility check. ARIMA reached 4.46% MAPE, RMSE 38.48, MAE 32.33, and Theil's U 0.403. ETS had slightly lower RMSE, but ARIMA had the better MAPE and Theil's U, which made it easier to defend for percentage-based inventory planning.

Six-month holdout chart comparing actual demand with ARIMA and ETS forecasts
The holdout chart compares observed demand against the two model forecasts for the test period.
ARIMA residual diagnostics with residual line ACF and distribution panels
Residual diagnostics show whether the selected model left obvious unexplained time-series structure.

I converted the forecast into safety-stock guidance

The selected ARIMA forecast moved from roughly 500 units in the first month to roughly 865 units by month six. The 95% forecast intervals implied a practical safety-stock buffer around 70 to 80 units per month, with peak months needing the higher end of that range. That translation from uncertainty to buffer stock is where the case becomes operational.

Six-month ARIMA forecast with prediction intervals
The forecast chart shows the forward demand curve with uncertainty intervals.
ARIMA forecast interval table for January through June 2018
The interval table records the six forecasted months and their 80% and 95% bounds.
Safety stock output table derived from the ARIMA 95 percent upper interval
The safety-stock table turns the forecast interval output into an inventory planning target.

I kept the limitations visible

The case uses only historical sales, so it cannot directly adjust for promotions, pricing, holidays, weather, or competitor behavior. It also focuses on one store-item pair and a short forecast horizon. I treated those limits as part of the recommendation: use the model for rolling monthly planning, then extend it later with external drivers and hierarchical forecasting.

What this project says about how I work

This case shows how I connect statistical modeling with a real operating decision. I do not want a forecast to stop at a chart. I want the workflow to explain the data, test the assumptions, compare alternatives, quantify uncertainty, and end with guidance that a team can actually use.

Results

  • I documented a 913,000-row training dataset covering 10 stores, 50 items, and daily sales from 2013 through 2017.
  • The focused Store 1 and Item 1 series produced 60 monthly observations, ranging from 322 to 903 units with an average of 607.8 units.
  • The multiplicative decomposition fit the proportional seasonal pattern more naturally, with residual variation far smaller than the additive alternative.
  • ADF and KPSS tests showed that differencing was needed, so the final workflow used one regular difference and one seasonal difference.
  • ARIMA achieved 4.46% MAPE, RMSE 38.48, MAE 32.33, and Theil's U 0.403 on the six-month holdout period.
  • The six-month forecast rose from about 500 units to about 865 units, so the recommendation was to hold roughly 70 to 80 units of safety stock and reevaluate monthly.

Key features

01 Built a reproducible R Markdown workflow from raw daily sales to forecast outputs
02 Filtered the analysis to Store 1 and Item 1 for a controlled inventory-planning case
03 Aggregated 1,826 daily observations into a 60-month demand series
04 Used additive and multiplicative decomposition to diagnose seasonality
05 Checked stationarity with ADF and KPSS tests before differencing
06 Compared ARIMA and ETS models on a six-month holdout window
07 Converted forecast intervals into safety-stock recommendations for operations
08 Kept report, code, data, and instructions versioned in a public GitHub repository

Tech stack

R R Markdown forecast tseries tidyverse lubridate ARIMA ETS Kaggle
Project links

Interested in similar work?

I build systems like this for teams that need reliable engineering, clean interfaces, and measurable outcomes.