SOFTWARE IMPLEMENTATION OF ALGORITHMS FOR CALCULATING PEARSON, SPEARMAN AND KENDALL CORRELATIONS IN C#
ПРОГРАМНА РЕАЛІЗАЦІЯ НА МОВІ C# АЛГОРИТМІВ ОБЧИСЛЕННЯ КОРЕЛЯЦІЇ ПІРСОНА, СПІРМЕНА І КЕНДАЛЛА
DOI:
https://doi.org/10.31110/fmo2026.v41i2-01Keywords:
correlation, algorithm, Pearson, Spearman, Kendall, component-oriented approach, software libraryAbstract
Formulation of the problem. In scientific research in sociology, education, physics, chemistry and other sciences, methods of correlation analysis are used. Correlation coefficients are used to determine the existence of a relationship between two or more data samples. The use of correlation coefficients allows the researcher to determine whether there is a relationship between two data sets and the nature of that relationship: strong or weak, direct or inverse. Thanks to correlation methods, the researcher has an effective tool for confirming or disproving a hypothesis. Information technology tools play an important role in the application of correlation analysis in practice. These tools enable reducing the processing time for scientific research results by several times. Software tools used in correlation analysis vary widely, from MS Excel spreadsheets to STATISTICA and the R programming language. A common drawback of these IT tools is that the researcher using them must have a certain level of mathematical training (STATISTICA), programming skills (R), or manual data entry skills (MS Excel). There is a discrepancy between the capabilities of ICT for correlation analysis and how they are currently used.
Materials and methods. During the research, we used the following methods: analysis and synthesis of scientific literature on correlation analysis, algorithm theory, object-oriented programming, and the foundations of scientific research; comparative analysis of algorithms for calculating Pearson, Spearman, and Kendall correlation coefficients; algorithmic method for constructing correlation calculation algorithms; object-oriented programming methods for software development of developed algorithms; correlation methods; computational complexity testing; accuracy testing; exception testing (handling missing values, different sample sizes); numerical stability testing.
Results. Algorithms for calculating Pearson, Spearman, and Kendall correlations have been implemented in the C# language. During development, component-oriented and object-oriented approaches in programming were used. Algorithms for calculating Pearson, Spearman, and Kendall correlations are presented in the C# language in the form of a program library in DLL format, which consists of 5 classes. Classes and methods for calculating Pearson, Spearman, and Kendall correlations have been developed. The objective novelty is the software implementation of the algorithm for calculating Kendall correlations for the .NET platform. To calculate the specified correlation coefficients, the CorrAnalyzer application has been developed, which connects to the program library created. The developed library and application are recommended for use in pedagogical, psychological, and sociological research to determine the relationship between the two samples.
Conclusions. Correlation methods are used to determine the relationship between two samples. The most commonly used are Pearson, Spearman, and Kendall correlations. The Pearson, Spearman, and Kendall correlation coefficients differ in their principles and calculation algorithms. Based on testing results for accuracy, computational complexity, and exceptions, the suitability of the developed methods for processing experimental results was determined. To make the software library a powerful tool for determining relationships between samples, all three of the above correlation methods are implemented in it. The library for calculating correlation is implemented as a component (DLL) that is integrated into the CorrAnalyzer application, written in C#. The CorrAnalyzer application is designed to determine the relationship between small samples (up to 1000 values).
In the future, it is advisable to supplement the developed software library with classes for calculating the Matthews correlation and concordance.
Downloads
References
Accord.NET Framework (n.d.). Measures.Correlation Method (Double[,]). URL: http://accord-framework.net/docs/html/M_Accord_Statistics_Measures_Correlation.htm
Arifin, W. N. (2018). A Web-based Sample Size Calculator for Reliability Studies. Education in medicine journal, 10(3), 67–76. https://doi.org/10.21315/eimj2018.10.3.8
Chen, J., Wang, G., & Giannakis, G. B. (2019). Graph multiview canonical correlation analysis. IEEE Transactions on Signal Processing, 67(11), 2826-2838. https://doi.org/10.1109/TSP.2019.2910475
Cicuttin, A., Morales, I. R., Crespo, M. L., Carrato, S., García, L. G., Molina, R. S., Valinoti, B., & Folla Kamdem, J. (2022). A Simplified Correlation Index for Fast Real-Time Pulse Shape Recognition, Sensors, 22(20), 7697. https://doi.org/10.3390/s22207697
Cleophas, T. J., & Zwinderman, A. H. (2018). Bayesian Pearson correlation analysis. In Modern Bayesian statistics in clinical research (pp. 111-118). Cham: Springer International Publishing. https://doi.org/10.1007/978-3-319-92747-3_11
Dakılır, D. (2024). FinnCorr: Financial Data Correlation Analysis Engine (Computer software). GitHub. URL: https://github.com/zelosleone/FinnCorr
Derevyanchuk, O. (2025). Methods of correlation and regression of educational data in the systematic analysis of the quality of training of teachers of vocational education. Pedagogical Academy: scientific notes, 23. https://doi.org/10.5281/zenodo.18004752
Franzece, M., & Iuliano, A. (2018). Correlation analysis. In Encyclopedia of bioinformatics and computational biology: ABC of bioinformatics (Vol. 1, pp. 706-721). Elsevier. https://doi.org/10.1016/B978-0-12-809633-8.20358-0
Gogtay, N. J., & Thatte, U. M. (2017). Principles of correlation analysis. Journal of the Association of Physicians of India, 65(3), 78-81. https://www.kem.edu/wp-content/uploads/2012/06/9-Principles_of_correlation-1.pdf
Janse, R. J., Hoekstra, T., Jager, K. J., Zoccali, C., Tripepi, G., Dekker, F. W., & Van Diepen, M. (2021). Conducting correlation analysis: important limitations and pitfalls. Clinical Kidney Journal, 14(11), 2332-2337. https://doi.org/10.1093/ckj/sfab085
Makowski, D., Ben-Shachar, M. S., Patil, I., & Lüdecke, D. (2020). Methods and algorithms for correlation analysis in R. Journal of Open Source Software, 5(51), 2306. https://doi.org/10.21105/joss.02306
MathNet.Numerics (n.d.). Correlation – Math.NET Numerics Documentation. URL: https://numerics.mathdotnet.com/api/MathNet.Numerics.Statistics/Correlation.htm#Pearson
MathNet.Numerics (n.d.). Correlation – Math.NET Numerics Documentation. URL: https://numerics.mathdotnet.com/api/MathNet.Numerics.Statistics/Correlation.htm#Spearman
Measures Methods. (2017). URL: http://accord-framework.net/docs/html/Methods_T_Accord_Statistics_Measures.htm
Mith0304. (2015). CorrelEstimator (Computer software). GitHub. URL: https://github.com/Mith0304/CorrelEstimator
Rayhan, M., Al, A., Md Nurnabe Sagor, Pranto Das, Md. Sabbir Ahmed, Abu Sadat, Abdul Hafiz Tamim, Emon, S., Asad, M. A., & Alam, M. K. (2025). An Open-Source Framework for Advanced Correlation Analysis: The KARL Lab Correlation Tool (Pro Edition). Zenodo. https://doi.org/10.5281/zenodo.17088075
Ruegg, C. (2025). Math.NET Numerics (Source code). GitHub. URL: https://github.com/mathnet/mathnet-numerics
Schober, P., & Vetter, T. R. (2020). Correlation analysis in medical research. Anesthesia & Analgesia, 130(2), 332. https://doi.org/10.1213/ANE.0000000000004578
Senthilnathan, S. (2019). Usefulness of correlation analysis. Available at SSRN 3416918. http://doi.org/10.2139/ssrn.3416918
StatisticFormula.Correlation (2025). URL: https://learn.microsoft.com/en-us/dotnet/api/system.web.ui.datavisualization.charting.statisticformula.correlation?view=netframework-4.8.1
Vallat, R. (2018). Pingouin: statistics in Python. J. Open Source Softw., 3(31), 1026. http://doi.org/10.21105/joss.01026
Winter, B. (2019). Statistics for linguists: An introduction using R. Routledge. URL: https://www.jeffreyheinz.net/classes/20F/materials/readings/Bodo2020-FrontMatter.pdf
Yadav, S. (2018). Correlation analysis in biological studies. Journal of the Practice of cardiovascular sciences, 4(2), 116-121. https://doi.org/10.4103/jpcs.jpcs_31_18
Yoo, J.-Ch., & Han, T.H. (2009). Fast Normalized Cross-Correlation. Circuits, Systems, and Signal Processing, 28(6), 819-843. https://doi.org/10.1007/s00034-009-9130-7
Downloads
Published
Issue
Section
Categories
How to Cite
License
Copyright (c) 2026 Vitalii Bazurin, Sofia Bazurina, Svitlana Kolesnyk, Valerii Kolesnyk, Nina Dulenko

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
- Authors grant the journal a right of the first publication of the work under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0)that allows others freely to use (read, copy and print) submissions, search content and link to published articles, disseminate their full text and use them for any legitimate non-commercial purposes (i.e. educational or scientific) with the mandatory reference to the article’s authors and initial publication in this journal.
- Original published articles cannot be used by users (exept authors) for commercial purposes or distributed by third-party intermediary organizations for a fee.

