Quant interview toolkit · forecast evaluation

Two fill models get the daily total right. Which one learned anything?

Ten of twenty limit orders fill within a minute. One model assigned a 50% chance to every order. A second split them evenly between 10% and 90%. Both predicted ten fills in total. Before crediting the second model for its confidence, open the order log and check which ten filled.

Penalize a confident fill miss

Brier loss when no fill occurs

For one no-fill outcome, Brier loss is the squared forecast probability.

A small enough ledger to score by hand

Assume each order stayed live for the full minute or filled earlier. Take a fill to mean a complete execution. Here is the hypothetical log compressed by the probability issued at submission.

Issued probabilityOrdersFillsObserved rate
0.101020.20
0.901080.80

Score each prediction pp against its outcome yy using (p−y)2(p-y)^2, then take the mean. This binary convention gives the constant model a Brier loss of 0.25 on every order. In the low-probability group the second model incurs 2(0.9)2+8(0.1)2=1.702(0.9)^2+8(0.1)^2=1.70 units of loss. The high group contributes another 1.70. Dividing by twenty gives 0.17. Its advantage comes from putting the higher probability on orders that actually filled more often.

Price the confidence error separately

Within any group sharing a single issued probability pgp_g, let rgr_g be its observed fill rate. Expand around that rate. The cross term vanishes because the deviations y−rgy-r_g sum to zero within the group. The mean loss there is

rg(1−rg)+(pg−rg)2.r_g(1-r_g)+(p_g-r_g)^2.

Let wgw_g be the fraction of orders in group gg and rr the overall fill rate. Averaging the identity and expanding the first term gives Murphy’s decomposition. Murphy, A New Vector Partition of the Probability Score

BS=r(1−r)⏟uncertainty−∑gwg(rg−r)2⏟resolution+∑gwg(pg−rg)2⏟reliability penalty.\mathrm{BS}= \underbrace{r(1-r)}_{\text{uncertainty}} -\underbrace{\sum_g w_g(r_g-r)^2}_{\text{resolution}} +\underbrace{\sum_g w_g(p_g-r_g)^2}_{\text{reliability penalty}}.

Here uncertainty is 0.25. The two groups each sit 0.30 away from the overall fill rate, giving resolution of 0.09. Each forecast misses its own group frequency by 0.10, giving a reliability penalty of 0.01. The arithmetic is 0.25−0.09+0.01=0.170.25-0.09+0.01=0.17. The model separated the flow successfully and exaggerated the size of that separation.

The tempting repair that uses tomorrow’s answers

Replacing 0.10 and 0.90 with 0.20 and 0.80 would score 0.16 on these orders. Those replacement values were chosen after observing all twenty outcomes. To test whether the repair transfers, estimate the mapping on an earlier period, freeze it, then score both versions on the same later orders. If cancellations truncate some observation windows, specify how your fill label treats them before making either comparison.

groups = [(0.10, 10, 2), (0.90, 10, 8)]
n = sum(count for _, count, _ in groups)
loss = sum(fills * (1-p)**2 + (count-fills) * p**2
           for p, count, fills in groups) / n
assert abs(loss - 0.17) < 1e-12

Practice

AggregationWhat happens if the dashboard merges all twenty orders into a single bin?
Show answer

Its mean forecast and empirical frequency are both 0.50. Applying the grouped formula to that single representative forecast gives 0.25, the score of the coarsened model. For continuously varying forecasts, compute the actual loss order by order. A coarse reliability plot can conceal errors of opposite signs.

Stress testSuppose the low group gets eight fills and the high group gets two. What changes?
Show answer

The overall frequency and resolution stay fixed. Each probability now misses its group’s frequency by 0.70, so loss rises to 0.25−0.09+0.49=0.650.25-0.09+0.49=0.65. The daily total still looks perfect.