Resources

The data scientist’s guide to building demand forecasts for price optimization.

Shreya Sripada
Aug 24, 2024

The role of forecasting in in retail

At Luca, we are dedicated to transforming how retailers approach pricing strategy. Traditional pricing methods in the retail industry often leave substantial revenue and profit on the table, as they rely on outdated practices like cost-plus margin targets and manual spreadsheet analysis. 

Our founders recognized this gap having built pricing technology at Uber, that generated billions in incremental profit. Seeing that the retail industry lacked similar advanced tools, they created Luca—an AI-powered pricing engine designed to empower retail operators with intelligent, data-driven pricing recommendations.

A key component of Luca's capabilities is accurate forecasting. Forecasting is crucial because it allows us to predict SKU sales for the next 30 days, both with and without price changes. 

This insight is essential for optimizing pricing strategies, as it enables retailers to understand the potential revenue and profit impacts of different pricing scenarios. However, forecasting in retail is challenging due to the complexities of consumer behavior, large product catalogs, seasonal variations, and market dynamics.

Over the past couple months, we have been working to improve our baseline forecasting. This guide captures our approach to forecasting in retail.

Forecasting in price optimization

Baseline forecasting refers to estimating the quantity sold for each SKU for the next 30 days if the price is not changed. This forecast is a crucial step in our price optimization process. The baseline forecasts are combined with elasticity estimates to make optimal pricing decisions. 

If the baseline forecasts are biased, the resulting profit and revenue impact we would expect to see with a price change will be biased as well. 

Luca’s forecasting problem statement

For the project, we used the following goal to guide the project: 

Goal: Evaluate time series forecasting models for the purpose of more accurately predicting the upcoming (i.e. next 30 days) quantity sold for each product.

Time series forecasting models are statistical or Machine Learning models that analyze time series data and make predictions about future values. Time series data are measurements and data collected over time. 

In our case, the time series data consists of the quantity sold for each SKU over time. We also explored exogenous factors that are other variables we can use to help our forecast, other than the past quantities of each sku, which we will discuss later in more depth. 

Forecasting Model Selection

Our first part of the investigation was exploring different time series models. We explored more common models such as ARIMA and SARIMA, as well as deep learning models such as the LSTM, companies developments such as Meta’s Prophet and Google’s TimesFM, and others. 

After exploration, we decided on AutoARIMAX. AutoARIMAX is a time series model that uses an automatic process to select the optimal ARIMA (Autoregressive Integrated Moving Average) model parameters for a given time series. 

ARIMA is a very widely used statistical model for modeling and predicting time series. It can take non-stationary data and it is effective in capturing seasonal patterns. Our implementation of AutoARIMAX uses 100 different submodels with different parameters. 

We use ARIMAX which is slightly different from ARIMA. The X added to the end stands for “exogenous”. In other words, it allows us to add additional variables to help measure our endogenous variables. 

Selecting Exogenous Factors

We used 2 main Exogenous Factors. 

  1. Stockouts: Account for periods of time where quantity sold is affected by low inventory
  2. Unit price paid: Account for discount campaigns and other price changes that can influence demand

To evaluate whether using exogenous factors improved our performance, we used a metric called RMSE (Root Mean Squared Error). Root mean square error is one of the most commonly used measures for evaluating the quality of predictions. It shows how far predictions fall from measured true values using Euclidean distance. The lower the RMSE, the closer the prediction was to the true value.

Cross Validation

The main way that we evaluated performance was through cross validation. More specifically, we used Walk Forward validation: the data is split into k parts; the test set is the first k folds and the test set is the the (k+1)th fold.

Baseline vs. ARIMAX

In the final part of our analysis, we explored alternative baseline options, focusing on a window average approach that calculates the average of the last 𝑘 observations. We compared the performance of the two methods by taking the RMSE of the predictions of the ARIMAX model and the window average calculation with the actual observations occurring in the last 4 weeks. 

Although the ARIMAX model outperformed the baseline a majority of the time, there are instances where there is insufficient data for an ARIMAX model so we use the window average as a fallback. 

Conclusion

Our baseline forecasting project has advanced our ability to predict SKU sales for the upcoming 30 days. By transitioning from a simple baseline approach to a more sophisticated time series forecasting model like AutoARIMAX, we've greatly improved the accuracy of our predictions. The incorporation of exogenous factors further refined our model's performance, reducing errors and better capturing the complexities of our sales data.

Through cross-validation, we validated the robustness of our approach, ensuring that the chosen model—whether ARIMAX or a baseline model—provides the most accurate forecast for each SKU. This method not only enhances the precision of our baseline forecasting but also enables more reliable calculations of revenue and profit impact.

Overall, our final model represents a significant improvement in forecasting accuracy, offering a more precise and reliable foundation in our price optimization process.

Author

Shreya Sripada
Shreya is a student at the Jerome Fisher Management and Technology Program at University of Pennsylvania studying Computer Science and Finance. Shreya spent summer 2024 interning at Luca, working on various data science problems.

Ready to learn more?

Let's chat about bringing pricing intelligence into your process.