January 2022 | Przegląd Piekarski i Cukierniczy (Baking and Confectionery Review)
Data scientist in the bakery. Choosing a sales strategy under conditions of economic uncertainty by means of operational programming. The theory of choosing a pure strategy
The present times cannot be called calm. Rising inflation, falling exchange rates, a shortage of hands to work, and hastily introduced new tax law. All of this is happening at the height of a further wave of the covid-19 pandemic. In such conditions small and large companies must find their way, and entrepreneurs must choose a strategy for conducting their business. Should they buy new machines or real estate, spend money which, because of inflation and the fall in the zloty’s exchange rate, is melting away all the time anyway? Perhaps do the opposite? Deposit the money and wait until the announced economic cooling in the middle of 2022 arrives. And what if such a recession does not occur? What will happen if the European Union stops direct subsidies for farmers? How will grain prices then behave on the commodity exchanges? At what price will we be buying flour for our bakeries and confectioners’ shops? What will happen to bread prices?
It is impossible to list all the possible economic scenarios. One can, however, try to write down a few of the most probable ones and try to adapt a strategy to them. But how does one choose the optimal strategy — one which would increase the probability of great earnings, or at least minimise losses?
W-MOSZCZYNSKI ppic 1-22The theory of choosing a pure strategy
To begin with, a handful of theory, which resembles philosophy more than pragmatic mathematical considerations. When speaking of choosing a pure strategy, we are speaking of choosing one strategy. We do not therefore assume the choice of some mixed variant. In this study we will deal with choosing a one-off and a repeated strategy of action. The optimal choice must be made by means of a defined rule. In economics it is not assumed that someone made a choice on the basis of their own subjective feelings. There is a series of choice rules. Below I will present the most popular of them.
The Bayes–Laplace rule
For a short-term strategy which is to be repeated many times, we stress the Bayes–Laplace principle. I described the analysis of Bayesian probability in issue 6/21 of „Przegląd Zbożowo-Młynarski”.* The Bayes strategy consists in adopting the assumption that every state of nature — in our case, every state of the economy — is equally probable. In this rule we choose the strategy which will bring us the greatest average profit. We also apply this rule to the choice of one-off strategies.
Wald’s rule
This rule is called the strategy of the extreme pessimist. In this approach one chooses the decision which, in the worst possible variant of the state of the economy, gives the highest profits.
The Maximum rule
This is the opposite of Wald’s rule — that is, it is the rule of the extreme optimist. One chooses the decision which, in the best possible variant of the state of the economy, gives the highest profits.
The Hurwicz rule
This is an intermediate approach between Wald’s rule and the maximum strategy. The choice of strategy depends on the manager’s caution coefficient α — every manager has their own. For every decision we calculate the value of its pessimism coefficient α × min + (1−α) × max. In a moment we will use this rule in practice.
Savage’s rule
The constructed matrix of profits achieved for combinations of states of the economy and chosen strategies is transformed into a matrix of relative losses, which can be interpreted as a matrix of lost benefits. From this table one should choose the decision which minimises the maximum losses.
* Naive Bayes forecasting algorithm, Wojciech Moszczyński, Ewa Moszczyńska, „Przegląd Zbożowo-Młynarski” 6/2021.
The practical application of some strategy-choice rules
The bakery owner must choose a strategy for the coming year. Should they buy machines, buy or sell several shops, perhaps renew the fleet of vehicles, or invest in an internet shop? The baker set up three scenarios for the state of the economy: G₁ — recession, G₂ — a boom, and G₃ — stabilisation. Then they formulated three strategies of action for the coming year. They named the strategies S₁, S₂ and S₃. The bakery owner entered all the most important macroeconomic parameters of each of the three assumed states of the economy into a spreadsheet. Then they compared them with their strategies and in this way calculated how much they would earn annually on each strategy depending on the state of the economy G₁, G₂ and G₃.
The table below presents the results of the bakery owner’s calculations.
Table 1. Potential profits in millions of zł from the strategies depending on the state of the economy
| G₁ recession | G₂ boom | G₃ stabilisation | |
|---|---|---|---|
| Strategy S₁ | 16 | 8 | 19 |
| Strategy S₂ | 23 | 11 | 14 |
| Strategy S₃ | 21 | 17 | 9 |
Our task is to choose the optimal strategy for the bakery. An important matter is the decision whether the adopted strategies will be realised once or many times.
The Bayes rule
Strategies may concern many aspects, e.g. the structure of products or the methods of manufacturing goods because of changing economic circumstances. In the case of choosing a repeated strategy, the bakery owner should apply the Bayes rule. It consists in calculating the average profits from each strategy.
Z₁ = (16+8+19) / 3 = 14.3 million zł (1)
Z₂ = (23+11+14) / 3 = 16.0 million zł (2)
Z₃ = (21+17+9) / 3 = 15.6 million zł (3)
The best strategy, according to the Bayes rule, is S₂, giving profit Z₂, on the assumption that the occurrence of stagnation, a boom and stabilisation are equally probable.
Which strategy should the bakery choose applying the Hurwicz rule?
Let us assume that the bakery owner’s caution coefficient amounts to α = 0.6. The Hurwicz rule is described by formula (6), where b_min is the minimum profit from strategy S_i, and b_max is the maximum profit from strategy S_i.
Z = α × b_min + (1−α) × b_max (4)
We substitute the data from Table 1 into formula (6).
Z₁ = (0.6 × 8) + (0.4 × 19) = 12.4 (5)
Z₂ = (0.6 × 11) + (0.4 × 23) = 15.8 (6)
Z₃ = (0.6 × 9) + (0.4 × 21) = 13.8 (7)
So again the optimal strategy turned out to be strategy S₂.
Summary
In this short summary I have presented the possibilities of analysing one’s own strategies. Building scenarios of actions dependent on the course of changes in the environment is widely applied in dynamic situations, such as military actions or sudden socio-economic changes. The rules described can help in the rational planning of future actions.
Wojciech Moszczyński
Wojciech Moszczyński — graduate of the Department of Econometrics and Statistics of Nicolaus Copernicus University in Toruń; specialist in econometrics, finance, data science, and management accounting. He specializes in the optimization of production and logistics processes. He conducts research in the area of the development and application of artificial intelligence. For years he has been engaged in the popularization of machine learning and data science in business environments.

Dodaj komentarz