Can You Solve This? Calculating KS from a Quarter-Circle ROC Curve
I recently came across an interesting interview question that bridges geometry and risk modeling: “If a model’s ROC curve is a perfect concave down quarter-circle, what is its KS value?”
In my last post, I discussed the relationship between AUC and KS. Let’s build on that foundation to tackle this new question. Let’s recap the key concepts:
ROC Curve: A plot of the true positive rate against the false positive rate. A good model’s ROC curve bows towards the top-left corner because it maximizes true positives while minimizing false positives.
KS Statistic: The maximum vertical distance between the cumulative distribution functions (CDFs) of the positive and negative classes. It quantifies how well the model separates the two classes.
The key insight to solving this problem lies in the fact that the true positive rate is the same as the cumulative distribution function (CDF) for the positive class, and the false positive rate is the CDF for the negative class. Therefore, the KS statistic can be expressed as: KS=max(TPR−FPR). (Please refer to my previous post for a detailed explanation of this relationship.)
The equation for a circle centered at (h,k) with radius r is: (x-h)^2 + (y-k)^2 = r^2. For a quarter-circle ROC curve centered at (1,0) with radius 1, the equation simplifies to: (x-1)^2 + y^2 = 1. Rearranging gives us:
To find the KS value, we need to maximize y−xy−x over the interval [0,1]. This leads us to the function:
. Taking the derivative and setting it to zero gives us the critical points:
Solving this equation, we find:
(Discarded another solution because the range of x is [0,1]).
Plugging this back into our function, we calculate:
If you can follow this reasoning and arrive at the same conclusion, congratulations! You’ve successfully connected geometric intuition with statistical modeling. The key learning of the question is that KS alone does not fully capture model performance. It only anchors the shape of the ROC curve.
