function C = SumSqDiffCDFTest(data,model)

% Maximum vertical distance between CDFs of model distribution and data
% Based on NuMRec

% sort data
data = sort(data);
ndata=length(data);

dataCDF = [1:ndata] ./ ndata;
modlCDF = BinomCDF(model,data);
C = sum( (dataCDF-modlCDF).^2 );
