test_stat {GSSE} | R Documentation |
This function is used to calculate the Kolmogorov-Smirnov statistic: D(F_1, F_2) = \sup_{x}|F_1(x) - F_2(x)|
.
test_stat (F1, F2)
F1 |
vector of one distribution function value. |
F2 |
vector of the other distribution function value. |
It is necessary to point out that F1
and F2
are based on common grids. Other technical details can be found in Wang et al. (2015).
This function returns a list of prediction values for classes,
out |
value of Kolmogorov-Smirnov statistics. |
Wang, Y., Liang, B., Tong, X., Marder, K., Bressman, S., Orr-Urtreger, A., Giladi, N. & Zeng, D. (2015). Efficient estimation of nonparametric genetic risk function with censored data. Biometrika, 102(3), 515-532.
X = seq(0.01, 1, 0.05);
Func_1 = function(x){ x + runif(length(x), min=0, max=1) };
Func_2 = function(x){ x + 2*runif(length(x), min=0, max=1) };
U1 = Func_1(X);
U2 = Func_2(X);
test_stat (F1 = U1, F2 = U2);