R/P_di.R

P_di <-
function(i,a,N){
	res = rep(-1,length(a))
	if(any(a == floor(N/2))){
		res[a == floor(N/2)] = P_ceq(i,a[a == floor(N/2)],N)
	}
	if(any(res == -1)){
		res[res == -1] = P_cge_ale(i,a[res == -1]+1,a[res == -1],N) - P_cge_ale(i,a[res == -1]+1,a[res == -1]-1,N) + P_ceq(i,a[res == -1],N)
	}
	return(res)
}

Try the knnIndep package in your browser

Any scripts or data that you put into this service are public.

knnIndep documentation built on May 2, 2019, 3:23 a.m.