risk.validation.kolmogorovSmirnovPlot
Syntax
Description
risk.validation.kolmogorovSmirnovPlot(
creates two data samples from Score,BinaryResponse)Score and
BinaryResponse, then plots their empirical cumulative distribution
functions (CDF). The plot also includes dotted lines indicating the location of the
empirical CDFs' largest absolute difference, which is the value of the Kolmogorov-Smirnov
(KS) statistic.
risk.validation.kolmogorovSmirnovPlot(
plots the empirical CDFs for the data in Sample1,Sample2)Sample1 and
Sample2 together with dotted lines indicating the location of the
empirical CDFs' largest absolute difference.
risk.validation.kolmogorovSmirnovPlot(___,
specifies additional options using one or more name-value arguments. For example, you can
specify the direction in which to sort the distribution variable and whether to plot the
absolute differences of the empirical CDFs.Name=Value)
returns handles to the plotted graphics objects.h = risk.validation.kolmogorovSmirnovPlot(___)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Algorithms
To calculate the two-sample KS statistic,
risk.validation.kolmogorovSmirnovPlot calculates the empirical CDF for each sample. The KS
statistic is the largest absolute difference between the empirical CDFs.
Alternative Functionality
You can use the risk.validation.kolmogorovSmirnov function to calculate the KS statistic without
visualization.
References
[1] Basel Committee on Banking Supervision, "Calculation of RWA for market risk." January, 2022. https://www.bis.org/basel_framework/chapter/MAR/32.htm?inforce=20220101&published=20191215.
Version History
Introduced in R2026a

