Time-Series Product Sales Forecasting
Product Sales Forecasting Report
Date: June 2, 2025
Author: Muhammad Ahsan
1. Introduction
This report details the development of a time series forecasting model designed to predict daily product sales for the upcoming four weeks. Being able to accurately forecast sales is a cornerstone of smart business operations, helping with everything from managing inventory and planning resources to making strategic decisions. Our approach involved analyzing historical daily sales data from January 1, 2022, to December 31, 2024, to build a reliable model that understands past patterns to predict future outcomes.
2. Uncovering Patterns in Our Sales Data (Time Series Analysis)
Before we could build a model, we first had to get to know our data. We conducted an exploratory data analysis (EDA) to find the key patterns and characteristics of our historical sales.
2.1. Visuals and Decomposition
Looking at a plot of our sales over the last three years, we immediately spotted a few key things:
A Clear Upward Trend: It was obvious that sales have been growing steadily over time.
Regular Seasonal Patterns: The data also showed clear, repeating cycles. We noticed both a weekly seasonality (with sales numbers often behaving differently on certain days of the week) and a broader annual seasonality.
To look at these patterns more formally, we used time series decomposition. This technique broke our sales data down into three parts: the long-term Trend, the repeating Seasonal cycles, and the Residual (which is basically the random noise left over). This process confirmed the strong trend and seasonal effects we first noticed.
2.2. Checking for Stationarity
Many time series models work best when the data is "stationary" (meaning its basic properties like the average and variance don't change over time). To check for this, we used the Augmented Dickey-Fuller (ADF) test.
ADF Statistic: -0.7467
p-value: 0.8343
Since the p-value was much higher than the common threshold of 0.05, we concluded that our sales data is non-stationary. This wasn't a surprise, as the strong upward trend we saw visually is a classic sign of non-stationarity.
3. Our Modeling Approach: Exponential Smoothing (Holt-Winters)
3.1. Choosing the Right Model
Given that our data had both a clear trend and a repeating weekly seasonal pattern, we chose the Exponential Smoothing (Holt-Winters) model. This is a classic and highly effective forecasting method specifically designed to handle these two characteristics. It works by "smoothing" out the data, giving more weight to recent observations while still accounting for the underlying trend and seasonal cycles.
3.2. How We Built It
We used the ExponentialSmoothing model from Python's statsmodels library. We configured it to recognize both an additive trend (trend='add') and an additive seasonality (seasonal='add') with a cycle of 7 days (seasonal_periods=7). To make sure our model was any good, we first trained it on the first 90% of our historical data and kept the last 10% as a "test set" to check its performance.
4. How Well Did Our Model Do? (Performance and Evaluation)
We evaluated our model by having it predict sales for the test set period and then comparing those predictions to the actual sales numbers. Here’s how it performed:
Mean Absolute Error (MAE): 57.49
This tells us that, on average, our model's daily forecast was off by about 57 sales units.
Root Mean Squared Error (RMSE): 67.11
This is another measure of error that tends to penalize larger mistakes more heavily.
Mean Absolute Percentage Error (MAPE): 25.56%
This is a very useful metric. It means that, on average, our forecast was about 25-26% different from the actual sales value. While there is room for improvement, this can still be a very useful forecast for many business planning purposes.
A graph comparing the predicted sales to the actual sales showed that the model did a good job of following the overall trend and capturing the weekly ups and downs.
5. What's Next? The Sales Forecast (Next 4 Weeks)
After confirming the model worked reasonably well, we retrained it on our entire three-year sales history to make it as smart as possible. We then used this final model to forecast sales for the next 28 days (from January 1, 2025, to January 28, 2025).
Key Takeaways from the Forecast:
The forecast shows that the steady upward trend in sales is expected to continue.
The weekly pattern of sales is also predicted to continue as it has in the past.
Predicted sales for the next four weeks are expected to range from about 250 units at the low end of a day's forecast to over 290 units at the high end, reflecting the ongoing growth.
6. So, What's the Verdict? (Conclusion and Recommendations)
This project successfully created a Holt-Winters Exponential Smoothing model that can provide a solid forecast for daily product sales. The model's performance, with a MAPE of around 25%, shows it has learned the key patterns in our sales history and can provide valuable guidance for future planning.
Our Recommendations:
Smarter Inventory: This forecast should be used to guide inventory management. We can make sure we have more stock on hand for the days and weeks predicted to be busy, helping to avoid sell-outs and maximize revenue.
Plan Promotions: We can use the forecast to plan marketing campaigns. For instance, we could launch promotions during periods that are predicted to be a bit slower to help boost sales.
Keep the Model Fresh: The world of sales is always changing. We recommend retraining this model periodically—perhaps once a quarter—with new sales data to make sure it stays accurate and relevant. For even better accuracy in the future, we could also explore more complex models like SARIMA or machine learning approaches.
Project Summary
Developed a time-series model to forecast daily product sales for a 4-week future horizon using historical business records.
Analyzed 3 years of daily sales data. Conducted Augmented Dickey-Fuller (ADF) tests (p-value: 0.83) confirming non-stationarity. Decomposed trend, seasonality, and residual noise. Fitted a Holt-Winters Exponential Smoothing model.
Created a robust 28-day sales forecast accounting for weekly seasonality cycles. Achieved a Mean Absolute Percentage Error (MAPE) of 25.56%.