PetscProbComputeKSStatistic#
Compute the Kolmogorov-Smirnov statistic for the empirical distribution for an input vector, compared to an analytic CDF.
Synopsis#
#include "petscdt.h"
PetscErrorCode PetscProbComputeKSStatistic(Vec v, PetscProbFunc cdf, PetscReal *alpha)
Collective
Input Parameters#
v - The data vector, blocksize is the sample dimension
cdf - The analytic CDF
Output Parameter#
alpha - The KS statistic
Notes#
The Kolmogorov-Smirnov statistic for a given cumulative distribution function is
where is the supremum of the set of distances, and the empirical distribution function is discrete, and given by
The empirical distribution function is discrete, and thus had a ``stairstep’’ cumulative distribution, making the number of stairs. Intuitively, the statistic takes the largest absolute difference between the two distribution functions across all values.
See Also#
PetscProbFunc
Level#
advanced
Location#
Index of all DT routines
Table of Contents for all manual pages
Index of all manual pages