I used an optimal transport map at work! Youโd be right to roll your eyes, but it happened! We started with a metric and planned to introduce a change that modified the definition of from to . This change meant our metric went from representing the maximum average of groups to the maximum of the last observation among the groups. Because the distribution of has higher variance than the old distribution of , would likely increase quite a bit. How could we choose a percentile of the new distribution of that would approximately match the p100 of the old distribution?
โ Important to note that all values are assumed to be independent and drawn from the same distribution. Thereโs nothing unique about the last observation. Letโs also make things more concrete. This may be useful for readers and future me: , , is the underlying metric from pod returned by scrape .
In general, given two real-valued, continuous distributions, and , the optimal transport map is given by . In our case, we can find our desired percentile by swapping the order of composition to . From there, it was easy to find the corresponding percentile, , and rewrite our new metric as .
โ Thought of this while typing this note out. Two quick claims regarding a bound on the expectation of and (i.e.ย the maximum of the new ).
The former is just a result from summing variances, the latter is an application of the maximal inequality in Boucheron, Lugosi, and Massart, .
โ This is (somehow) both a hand-wavey and overly formal account of this PR I submitted to Mimirโs alerting rules.