Conditional Value at Risk, also called expected shortfall, is the average outcome across the worst share of possible scenarios — for example, the mean profit across the worst 5% of outcomes. Where probability of loss asks how often things go badly and an average asks what happens typically, CVaR asks how bad the bad cases are on average. It is magnitude-aware, unlike a frequency, and deliberately ignores the upside, unlike a mean, which makes it the standard measure when the purpose is to bound a downside rather than to describe a central tendency.
Formula
VaR at level α = the α-quantile of the outcome distribution (the cutoff)
CVaR at level α = average outcome given the outcome is below that cutoff
A risk-aware objective blends the two views:
objective = (1 − w) × expected profit + w × CVaR
w = 0 → pure expected profit; w = 1 → pure downside protectionExample
Two budget levels for the same Shopee campaign.
expected daily profit worst-5% average
฿8,000/day +฿1,900 −฿1,100
฿14,000/day +฿2,300 −฿6,400
The higher budget wins on the average by ฿400 and loses ฿5,300 more on
a bad day. Which is correct depends on how much a bad week costs you.How is CVaR different from probability of loss?
Probability of loss counts occurrences; CVaR measures amounts. A campaign that loses 50 baht on most days has a high probability of loss and a mild CVaR. A campaign that wins almost always and occasionally loses forty thousand baht has a low probability of loss and a severe CVaR. These are opposite risk profiles and the frequency measure cannot distinguish them, which is why a stop rule built on probability of loss will happily keep a campaign whose rare failures are the thing that actually threatens the business. CVaR is specifically the tool for that case.
Why not just use the average?
Because an average is fragile when the outcome distribution has a long tail, which marketplace campaign profit reliably does — many small losing days and occasional large wins. The mean of such a distribution is dominated by the rare large outcomes, so it is highly sensitive to how well the model estimated their probability and their size. Small errors in the tail produce large swings in the mean. CVaR looks at the downside deliberately rather than being dragged around by the upside, and it is a coherent risk measure, meaning it behaves sensibly when positions are combined — a property the more familiar value at risk does not have.
How do you choose the risk weight?
From the business, not from the model. The weight expresses how much expected profit the shop is willing to give up to reduce the severity of bad outcomes, and that depends on things no optimizer can observe: cash runway, whether a bad month is survivable, how much of the budget this campaign represents, and whether the shop is in a growth phase or defending a position. A shop with thin working capital should carry a high weight and accept a lower average. A shop with reserves and a long horizon should carry a low one. Setting it once and reviewing it when circumstances change is more sensible than tuning it per campaign.
Why it matters
Marketplace ad outcomes are skewed and their downside is not symmetric with their upside — a bad month consumes working capital that constrains the next three, while a good month mostly just funds the next campaign. Optimising only the average treats those two as equivalent. Carrying a tail measure alongside it is what lets a shop scale spend without occasionally taking a loss it cannot absorb.
In DataGlass
For campaigns with enough history to model the whole outcome distribution, DataGlass optimizes a blend of expected profit and the tail average rather than expected profit alone, so the recommended budget reflects how severe the downside is and not only how good the average looks. The tail figure is shown as evidence on the recommendation.