Carl's Correlation Coefficient Algorithm

 











  • To measure the degree of linear dependence between two variable, Pearson Product Moment Correlation Coefficient (PPMCC) is used. This coefficient was developed by Carl Peasron.
  • This coefficient gives Statistical measurement of linear relationship between paired data.
  • This coefficient is denoted by 'r' and it is in the range, -1 ≤  r ≤ +1.
  • If value of 'r' is positive, then it gives positive linear correlation.
  • If value of 'r' is negative, then it gives negative linear correlation.
  • And if r = 0, then it indicates that there is no linear correlation.
  • The range of 'r' is from -1 to +1, so if the value of r is closer to +1 or -1 then it indicates stranger positive and negative linear correlation.
  • When the Pearson's correlation coefficient is applied to population then it is called as population pearson correlation coefficient and it is denoted by ρ (rho).
  • This coefficient is given by,
                           ρx,y =  COV (X, Y)σxσy              ...(1)
                 
         Here, COV(X,Y) denotes the covariance between X and Y.
              σx and  σy denotes standard deviation of X and Y respectively.

  • In terms of expectations (E), equation (1) can be written as,
                    ρx,y     =          E(X, Y) - E(X).E(Y)           
                                       E(X2) - E(X)2 . E(Y2) - E(Y)2


  • Consider that, we have the data sets (x1 , x2 , x3 , ..., xn ) and (y1 , y2 , y3 , ...yn ), contain n samples then the correlation coefficient is denoted by r and it is given by, 
                              

  • Here x̄ and ȳ denote the sample mean and given by,
           x̄  =   1  Σxi        and        ȳ =  1   Σyi                  (from i = 1 to n)
                n                             n