Calculates MeDiA_K (means Mean Distance Association by K-nearest neighbor) in order to detect nonlinear associations.