There are three popular metrics to measure the correlation between two random variables: Pearson's correlation coefficient, Kendall's tau and Spearman's rank correlation coefficient. In this article, I will make a detailed comparison among the three…
[http://www.statisticshowto.com/what-is-the-pearson-correlation-coefficient/] Correlation between sets of data is a measure of how well they are related. Correlation coefficients are used in statistics to measure how strong a relationship is between…
template <class T1, class T2>double Pearson(std::vector<T1> &inst1, std::vector<T2> &inst2) { if(inst1.size() != inst2.size()) { std::cout<<"the size of the vectors is not the same\n"; return 0; } size_t n=inst1.s…