What is a good method to generate the KS-statistic in R?
Also consider using the builtin ks.test:

&gt; ks.test(prd, act, alternative='greater')

        Two-sample Kolmogorov-Smirnov test

data:  prd and act
D^+ = 0.494, p-value &lt; 2.2204e-16
alternative hypothesis: the CDF of x lies above that of y