The coverage rule
Why does Lumoda's rule not see a shirt's warehouse stock? We build a simple rule that looks at stock and the rate of sale, and race it against Lumoda's with the same stock. The rule wins; the gain comes from starting early and from seeing the warehouse.
Markdown Calendar · 3 / 6
In this article we ask whether a simple rule that looks at stock and the rate of sale can mark down better than Lumoda’s rule. Pelin’s table never asks the most basic markdown question of all: at this rate, in how many weeks will this stock sell out? First we will see, through a shirt, what the table looks at. Then we will build the rule that asks that question and race it against Lumoda’s.
What Pelin’s table looks at
Every Monday Pelin’s table looks at every product’s STRSTR; the percentage of the stock a store received that has sold. In fashion retail the figure that matters is the part sold at full price.: the units sold in the stores, divided by the units sent to the stores. If this ratio is well behind where it should be in that week of the season, the product comes down one step.
Both sides of the sum look at the stores. Stock waiting in the warehouse does not come into it. An order placed with the supplier but not yet delivered is not seen at all. A shirt shows what that means.
The Lumberjack Shirt
Pars comes to the meeting in a green Lumberjack Shirt. The buy was 13,050 units; 4,350 of them came during the season through an RPTRPT; reordering from the supplier a product that is selling better than expected in-season. It is not a shipment from the warehouse to stores., a repeat order placed with the supplier. By sale day 7,283 units had gone to the stores, and 4,713 had sold in the stores.
“STR 0.65,” says Pelin. “In my table that’s a good number. The rule won’t touch this shirt.”
“And it doesn’t,” says Pars. “Now look at the whole picture. Up to the same day, online included, total sales are 5,490 units. Divide that by all the stock bought and you get 0.42.”
“Same shirt, two STRs,” says Veli.
“Different denominators,” says Pars. “Pelin’s table only counts what went to the stores. Part of the shirt never went out to the stores; it’s waiting in the warehouse. And on top of that there’s a repeat order on its way.”
The bad luck is in the timing. The repeat order was placed on the very day Pelin’s rule first looked at the shirt. The stock arrives in the warehouse two days after the markdown starts. The rule sees this stock neither on its way nor in the warehouse. It never once takes the shirt deeper: on sale day it takes it to 30% along with everything else and leaves it there. When the outlet closes there are 5,447 shirts in the warehouse; dead stockStock left in the warehouse after the season and the outlet window are over, which will never sell. that will never sell.
“My rule asks whether a product is selling,” says Pelin. “This shirt is selling.”
“It is,” says Pars. “But not fast enough to clear the stock you have in the weeks that are left. That’s the real question.”
The coverage rule
The rule Pars proposes asks two questions. At this rate, in how many weeks will the stock I have sell out? How many weeks are left to the exit? The exit is the day the stock is collected from the season’s stores and sent to the outlet. If the first answer is longer than the second, the stock will not sell out in the season, and the rule comes down one step. If not, the price stays where it is.
We call the answer to the first question coverage; in the trade it also goes by coverCurrent stock divided by the rate of sale; it says how many weeks of sales the stock will last., or weeks of supply. It counts all of the product’s sellable stock: on the shelf, in transit to the store, in the warehouse and still to come from the supplier. That stock is divided by the rate of sale over the last two weeks. The rate is measured only on days with stock on the shelf, because a day when the shelf is empty cannot make a sale; it should not drag the rate down.
The heart of the code is a few lines. The extract below comes from the
working code under cases/markdown-calendar/, simplified for a single
product. The real code works out every product at once, and measures the
rate per store and size before adding it up for the product.
# markdown_calendar/policy.py, Rule._decide (simplified, for a single product)
def decide(option, today, rate, alpha=1.0):
X = option.shelf + option.in_transit + option.dc + option.open_orders
v = option.in_stock_day_sales / option.in_stock_days # last two weeks, daily
left = option.exit_day - today # days left to the exit
if v > 0:
coverage = X / v # sold out in how many days at this rate
else:
coverage = float("inf") if X > 0 else 0.0 # not selling, but there is stock
if coverage > alpha * left:
return next_step(rate) # 20%, 30%, 40%, 50%, 70%
return rate
alpha is the rule’s only setting: how patient it is. With alpha at one
the rule says “if it won’t sell out in the weeks left, come down”. The larger
it is, the longer the rule waits; the smaller, the sooner it acts.
The rest is like Lumoda’s rule. The rule decides only on Mondays, comes down one step at a time, and the price never goes back up. There are two differences. It can start eight weeks before the sale, not four. And on sale day it does not give everyone a floor: a product with enough coverage can stay at full price even in the end-of-season sale.
“So where’s the elasticity?” says Pelin. “This rule doesn’t know how much a markdown sells.”
“It doesn’t,” says Pars. “It comes down one step and looks at the result a week later. If the markdown lifted sales, the rate goes up, coverage gets shorter and the rule stops. If it didn’t, it comes down another step.”
We chose the setting without looking at the seasons we race in, by replaying the two seasons before them in the simulation. The plainest setting gave the best result, “if it won’t sell out in the weeks left, come down”; every setting we tried beat Lumoda in those two seasons.
The race
We run the race over two seasons: the summer season of the first article and the winter before it. The referee is a simulation: the same flow of customers, the same stock, the same repeat orders; only the markdown calendar changes. The true demand and the true elasticity are part of the world behind the data. In real life there is no such referee. The measure is again season contribution: the net revenue taken from the same stock over the season and in the outlet, minus the cost of buying it.
The coverage rule beats Lumoda by TRY 24.91 million over the two seasons, by roughly the same margin in each.
| Two seasons | Lumoda | Coverage rule |
|---|---|---|
| Dead stock | 341,672 units | 165,726 units |
| Markdown cost | TRY 86.97 million | TRY 278.92 million |
The rule leaves far less stock in the warehouse. But it gives far more markdown.
“What will finance say when they see this?” says Pelin. “What I was asked to do was shrink markdown cost.”
“The rule does the exact opposite,” says Pars. “It marks down more, leaves less stock in the warehouse, and season contribution grows. The two lines at the top of your report have to be read together. We’ll come back to this in the sixth article.”
Back to the Lumberjack Shirt. The coverage rule takes it to 20% three weeks before the sale and down one more step every Monday. On every Monday it marks down, the repeat order is part of the sum: first as an open order, then as warehouse stock. When the outlet closes, 189 shirts are left in the warehouse. The shirt’s contribution rises from TRY 0.36 million to TRY 0.82 million.
The jumpsuits change under the rule too. The rule starts marking Veli’s jumpsuit down before Lumoda’s has even woken up. With Lumoda’s rule 2,944 jumpsuits were left in the warehouse; with the coverage rule, 1,514. Ali’s jumpsuit, meanwhile, it leaves alone on sale day. That jumpsuit was selling out anyway.
Where the gain comes from
To see where the gain comes from, we ran the rule twice more, each time with one thing missing; these are two separate experiments, and their results do not add up. The rule forced to wait until sale day leaves TRY 18.77 million less contribution over the two seasons; the rule that cannot see the warehouse and the open orders, TRY 11.53 million less.
“So my rule’s real trouble is when it starts,” says Pelin. “And that it doesn’t see the warehouse.”
“The jumpsuit showed you the first,” says Pars. “The shirt showed you the second.”
The same markdown for everyone
We ran one more baseline: the same rate for everyone, from sale day to the exit. In the seasons we chose the settings on, the best of the flat rates we tried was 40%. In the race seasons Lumoda’s rule is only TRY 0.79 million better than this flat rate.
“Is my table only that much better than the same markdown for everyone?” says Pelin.
“Your table doesn’t touch most products before the sale,” says Pars. “And on the day it does, it takes everything to 30% and leaves most of it there. In practice you’re giving everyone the same rate.”
The coverage rule does not know much either. It knows no elasticity, nor how demand will melt away over the rest of the season; it looks only at today’s rate and the stock in hand. Even so it beats Lumoda comfortably. Most likely that is because this world has a lot of stock; we did not test that separately. Where there is this much stock, the first question is not how deep the markdown should be but when it should start. Even a rough rule can answer that question correctly.
The optimisation in the fifth article takes into account the two things the rule does not look at: how much a markdown sells, and how demand will melt away. We will see whether they are enough to beat the rule.
What is hard in your data
The rule’s most valuable information is all of the sellable stock. In most chains store stock, warehouse stock and supplier orders sit in separate systems. And an open order’s delivery date is often a date on paper; stock that arrives late, like the Lumberjack Shirt’s, only shows up when it arrives.
To measure the rate you need to know, for every store, every size and every day, whether the shelf was empty. If the stock record is wrong, a product that has sold out looks slow-selling and the rule marks it down for nothing. If a promotion ran in the last two weeks, the rate is inflated, coverage looks short and the rule puts off the markdown.
The rule looks at the chain’s total stock. Veli’s jumpsuit had piled up in Anatolia. A markdown that comes at the right time for the chain can come too late in the store where the stock is sitting; a transfer fixes that.
The hardest part is choosing the setting. We replayed two past seasons in the simulation. In a real chain a past season cannot be replayed. You can only find the setting by trying it on some of the products, season by season.
The coverage rule does its job without knowing elasticity. In the next article we try to know it: how much does a markdown really sell, how do we measure that from sales, and what happens when we measure it wrong?