Implementing threshold detection function for distance error trap covariate method.