In credit risk modeling, the cumulative accuracy profile (CAP) is a way to visualize the discriminative power of a PD model.
The following steps to get a CAP curve
The plot below illustrate a CAP curve. For example, 80% of default occurred amount the population with top 20% of PD,
Analyzing the Curve
In the above plot, the grey curve represents a perfect PD model, and the blue line represents a random model with no discriminative power. A good model will have a CAP that is close to the perfect CAP.
The accuracy ratio (AR) is defined as the ratio of the area between the model CAP and the random CAP and the area between the perfect CAP and the random CAP. For a successful model the AR has values between zero and one, with a higher value for a stronger model.
python code to be added