Kendallknight: An R package for efficient implementation of Kendall’s correlation coefficient computation

R
Statistics
With 20,000 observations, this reduces the required operations from 400 million pairwise comparisons to 200,000 operations.
Author

Mauricio “Pachá” Vargas S.

Published

June 19, 2025

The kendallknight package introduces an efficient implementation of Kendall’s correlation coefficient computation, significantly improving the processing time for large datasets without sacrificing accuracy. The kendallknight package, following Knight (1966) and posterior literature, reduces the time complexity resulting in drastic reductions in computation time, transforming operations that would take minutes or hours into milliseconds or minutes, while maintaining precision and correctly handling edge cases and errors. The package is particularly advantageous in econometric and statistical contexts where rapid and accurate calculation of Kendall’s correlation coefficient is desirable. Benchmarks demonstrate substantial performance gains over the Base R implementation, especially for large datasets.

The article with the implementation details available at Plos One (Open Access).