How Artificial Intelligence Optimizes Decisions in the Presence of Uncertainty (Part 2)

In the previous post,we explored why people find thinking in probabilities difficult and how our world, despite our daily experiences telling us otherwise, is ultimately governed by probabilities. We then discussed how predictions for business decisions also need to be based on predicting probabilities and probability distributions, such as the one shown here. Rather than having a single predicted number  like the expected sale, modern machine learning and Artificial Intelligence (AI) algorithms can predict a full probability distribution. This distribution then forms the basis of the optimization: Each specific choice of a number (or quantile) derived from this distribution is associated with a specific outcome. Being able to evaluate all the different options for the future, each associated with a specific probability, allows full exploration of the impact of all operational decisions with scientific precision. And the optimal choices may
be very different.

probability density distribution

Optimizing Business Decisions – a Practical Example

How does this work in a practical setting? Let’s go back to our example from the last post of the sales of a specific product, e.g. a can of soda. In order for customers to be able to buy the soda, the shop has to order it from the supplier or wholesaler, but how many cans of soda should be ordered? Traditional forecasting methods mostly predict a single number that is usually interpreted as the expected sale of a specific product in a given store. This value is then amended by further rules, such as the minimum order size, the lot size, etc. This order proposal is finally executed when the number of products determined in this manner are ordered from the supplier. This procedure is straightforward, but does not allow much room for optimization. Minimum order size and lot size are, in principle, free parameters that can be changed, but all too often are determined by external constraints. And what if the predicted expected number of sales doesn’t “feel right”? After all, the expectation value is just the mean of a distribution and in this case, there is no access to the full probability distribution so one has to rely on guess work or a “gut feeling” to change the number.

This is where the power of working with predicted probability distributions comes in: The height of the distribution at each point describes how likely each outcome is. Looking at the example above, just using the mean (or expected sales) can be quite misleading, especially when the distribution is asymmetric and has long tails towards one side. The mean of the distribution is around 20 units, however the bulk of the distribution is lower than this and we can therefore anticipate that maybe 50 to 60 percent of all sales are lower than the mean or expected number of sales. It’s actually quite common that the distribution is skewed. Often for the sale of products, the distribution is limited to zero or greater numbers, whereas there is no upper limit that would force the tail of the distribution toward smaller numbers.

How does this help when optimizing business decisions? Each number derived from the predicted distribution (also called “point estimator”) can now be taken as the basis for the order. Constraints determined by minimum delivery size or lot size can be added and fed into a simulation framework: What would happen if the order would be based on the 10 percent quantile, 50 percent quantile, 99 percent quantile, etc.? These quantiles can be seen as a measure of the fraction of the demand that can be satisfied. Choosing a 99 percent quantile means that in 99 out of 100 cases, the realized (actual) demand can be satisfied and only in 1 percent of the cases customer will not be able to buy the product. The height of the distribution at each quantile is directly related to how likely this particular scenario is.

Optimizing for Profit

Optimizing also means that a specific number or a set of numbers should be evaluated and compared to the overall corporate strategy. The most natural number for businesses to optimize is profit. This figure illustrates the overall profit that can be made based on six products with varying margin and overall sales rate from slow moving goods to fast moving goods.

In this simulation, six products are considered, each with their own mean observed sales and volatility. For simplicity, they are only two prices: The fast selling items (products 4,5,6) have a margin of 50 percent, the slow selling items (products 1,2,3) a margin of just 10%.  The simulation is based on “true” demand and neglects effects from real observed sales of products. Although this simplification implies that effects from cannibalization, cannot be modelled, it allows to study the fundamental properties of the sales of products. Furthermore, no minimum order quantity has been imposed in this simulation and the lot size is set to one unit as well. A number of conventional forecasting methods, as well as two assumptions for probability distributions, are being evaluated. The forecasting methods depicted as bar graphs are:

  1. The moving average (“rolling mean”), which takes the simple average over the past few sales of a given product.
  2. The exponentially damped moving average (“ewma”) does the same but favors recent events over those that lie in the more distant past.
  3. Today’s observed sale is taken as the prediction for tomorrow’s sale.

The two probability distributions assumed in this model and depicted in the line graph are:

  1. The Poisson distribution
  2. The Gamma-Poisson distribution. This distribution is related to the Poisson distribution but has an additional parameter that effectively modifies the width (or volatility) of the distribution. This is important as it is observed in many practical applications that the distribution of observed events such as sales of individual items has similar characteristics as a Poisson process but cannot be accurately described by the relatively narrow Poisson distribution alone.

The profit is taken as the number of units sold times the selling price minus the number of items stocked from the supplier times the purchasing price, which, in this picture is assumed to include all costs from labour, logistics, etc.  Each product has their own characteristics, in this scenario the purchasing and the selling price that can lead to a different order size for each of the products considered in the simulation. In a more realistic scenario, the distributions would be replaced by the prediction from the machine learning algorithm and effects, such as promotions, seasonality, a weekly profile, etc., would have to be included.

This simple simulation illustrates the major points rather well: Although the business is profitable using simple forecasting methods such as the moving average compared to last sales predictions ($1500 profit to $2500 profit), the profit can be nearly doubled ($1500 profit to more than $3000 profit) simply by working with predicted probability distributions, keeping all other parameters the same. Crucially, one can now evaluate what quantile of the predicted sales distribution results in how much profit.

Artificial Intelligence and decision

Optimizing Profit vs KPIs

Artificial Intelligence and Decisions

However, profit isn’t the only thing business leaders keep in mind. They also focus on other Key Performance Indicators (KPIs), such as the out-of-stock rate, perishable goods waste or capital lock-up. For example, a supermarket typically tries to reduce the out-of-stock rate while keeping the disposal of perishable goods as low as possible. In a two-dimensional diagram, these two KPIs, waste and out-of-stock, can be aligned as shown. The aim of the optimization is then to find the best possible working point: Operating with zero waste and zero out-of-stock would be ideal, but is not realistic. Furthermore, both KPIs contradict each other: Adding more perishable goods to the shelves reduces the out-of-stock rate, but increases waste. Reducing the number of goods on the shelf reduces waste, but increases the risk of going out-of-stock. So, before choosing the optimal working point regarding these KPIs, we need to know what the available options are.

This can again be determined using the predicted probability distribution and simulation techniques as shown in this figure. The three points correspond to the traditional forecasting methods, which result in only one number given by the rolling mean or similar. Being restricted to just one point in this graph also means that there is no optimization potential. However, using predicted probability distributions results in a continuous line that represents all possible options on which to base order quantities, given the product properties, lot size, margin, etc. Decision-makers can now choose any point on this line and evaluate how a low out-of-stock rate relates to waste. Since each point of the curve corresponds to a specific quantile of the predicted density distribution, the behaviour of the KPIs can also be compared to the profit. For example, the quantile resulting in the highest profit can now be compared to how the KPIs would perform in such a scenario. Or one could estimate how much profit can be invested by choosing a better working point regarding waste and stock-out rate and thus increase customer satisfaction.

In Short

Artificial Intelligence and Decisions

In this short series, we’ve explored how modern machine learning algorithms and AI optimize business decisions in the presence of uncertainty. In the first post we’ve explored how difficult it is for us humans to understand probabilities and act accordingly, highlighting that although our day-to-day experience appears to be largely deterministic, probabilities and probability distributions are at the core of the fundamental laws of nature and the way businesses work. This leads us to embracing uncertainty to make optimal decisions. We then discussed how AI and machine learning can predict probabilities and probability distributions for future events.

This blog post focused on how these predicted probability distributions are the cornerstone of the subsequent optimization of the business decisions. Using the example of six products with different margins, mean sales and volatilities, we found that using probabilities as the basis for optimal decisions can lead to a significant boost in performance of the business compared to traditional forecasting methods, measured by either the profit the business can make or the behavior of KPIs. Using a simulation framework, we were able to determine the best operational decision for each of the simulated products, based on their characteristics and predicted future sales.

Dr. Ulrich Kerzel Dr. Ulrich Kerzel

earned his PhD under Professor Dr Feindt at the US Fermi National Laboratory and at that time made a considerable contribution to core technology of NeuroBayes. He continued this work as a Research Fellow at CERN before he came to Blue Yonder as a Principal Data Scientist.