Quant interview toolkit · probabilistic forecasting

How much should one confidently wrong forecast cost?

Two models forecast whether a replay session will breach a latency limit. For nine quiet sessions, model A assigns a breach probability of 1%. On the one session that breaches, it assigns 0.1%. Model B assigns 10% every time. B wins under two standard scoring rules. How far could B raise its forecast and still win under each rule?

Confidently wrong probabilities are costly

Log loss

One observed event with forecast probability p incurs −log p.

Reconstruct the two scorecards

The probability assigned to the outcome that occurred is pp on a breach and 1−p1-p on a quiet session. The logarithmic loss is minus the natural logarithm of that probability. The Brier loss is the squared difference between the breach forecast and its zero-or-one outcome. Smaller is better for both.

ModelMean Brier lossMean log loss (nats)
A(9(0.01)2+0.9992)/10=0.0998901(9(0.01)^2+0.999^2)/10=0.0998901−[9log⁡(0.99)+log⁡(0.001)]/10≈0.700-[9\log(0.99)+\log(0.001)]/10\approx0.700
B(9(0.10)2+0.902)/10=0.090(9(0.10)^2+0.90^2)/10=0.090−[9log⁡(0.90)+log⁡(0.10)]/10≈0.325-[9\log(0.90)+\log(0.10)]/10\approx0.325

So far B wins twice. Now change just one number: let B issue 25% on every session. Its mean Brier loss becomes (9(0.25)2+0.752)/10=0.1125(9(0.25)^2+0.75^2)/10=0.1125, while its mean log loss is about 0.398. A now wins on Brier loss and B still wins on log loss. For Brier, the nine small errors saved by A cover its bad miss. For log loss, A’s breach costs log⁡(1000)≈6.91\log(1000)\approx6.91 nats by itself.

For a constant forecast bb, this week’s mean Brier loss is 0.09+(b−0.10)20.09+(b-0.10)^2. Increasing bb from 10%, B first ties A at about 19.94%. For log loss the tie solves −[9log⁡(1−b)+log⁡b]/10=0.69982-[9\log(1-b)+\log b]/10=0.69982, giving about 50.41% on the same upward sweep. The range between those two thresholds is where choosing a scoring rule changes the winner.

Why either rule rewards an honest forecast

Suppose the true breach probability for this case is qq, strictly between zero and one. For a reported probability pp, expected Brier loss is q(1−q)+(p−q)2q(1-q)+(p-q)^2. Expected log loss and its derivative are

L(p)=−qlog⁡p−(1−q)log⁡(1−p),L′(p)=p−qp(1−p).L(p)=-q\log p-(1-q)\log(1-p),\qquad L'(p)=\frac{p-q}{p(1-p)}.

For 0<p<10<p<1, the derivative is negative below qq and positive above it. Both rules have their unique minimum at the truth. They impose different penalties for departing from it. Near p=qp=q, the excess log loss is approximately (p−q)2/[2q(1−q)](p-q)^2/[2q(1-q)]. The same small absolute error costs more near the extremes. Gneiting and Raftery, Strictly Proper Scoring Rules, Prediction, and Estimation

Read accumulated loss as evidence

If each forecast is a conditional probability given the information available at that session, the chain rule multiplies the probabilities assigned to the realized sequence. Its negative logarithm is total log loss. Against the 25% version of B, the likelihood ratio for B over A is about exp⁡(10(0.700−0.398))≈20.5\exp(10(0.700-0.398))\approx20.5. The comparison uses the probabilities the models actually issued. It does not require successive sessions to be independent when their forecasts specify the appropriate conditional laws.

from math import log, log1p

def scores(quiet_p, breach_p):
    brier = (9 * quiet_p**2 + (1 - breach_p)**2) / 10
    log_loss = -(9 * log1p(-quiet_p) + log(breach_p)) / 10
    return brier, log_loss

a, b = scores(0.01, 0.001), scores(0.25, 0.25)
assert a[0] < b[0] and a[1] > b[1]

A literal zero assigned to an event that occurs yields infinite log loss. If an export rounds small probabilities to zero, score the original model outputs or record the numerical floor and apply it consistently. Changing the floor after observing a breach changes the contest.

Practice

UnitsWould reporting log loss in bits change the winner?
Show answer

Dividing every natural-log loss by log⁡2\log 2 converts nats to bits. The ranking stays the same. Recover a likelihood ratio from a difference in total bit losses by raising 2 to that difference.

Evaluation designCan the desk choose whichever metric favors its new model on these ten sessions?
Show answer

It can report both, with their different penalties made explicit. Using the winning metric as the sole measure of validation adds a selection step. Choose the primary scoring rule before the next evaluation window and keep a separate cost model for the desk’s actual interventions.