Environmental Engineering Reference
In-Depth Information
1.3.3.3 Rank correlation method
The Spearman rank correlation between X 1 and X 2 , denoted by ρ 12 , is the Pearson cor-
relation between the ranks of X 1 and X 2 . Namely, each X samples are converted into its
ranks. For instance, if there are five (X 1 , X 2 ) samples (random sequence initiated using
randn['state', 13]):
=
()
1
()
2
()
3
()
4
()
5
XXXXX
XXXXX
1
1
1
1
1
X T
()
()
1
()
2
()
3
()
4
5
2
2
2
2
2
(1.43)
120067
.
.
174047
.
.
168
.
=
128094
.
.
027143
.
.
051
.
Then the ranks are
32514
23514
X r T =
(1.44)
The Spearman rank correlation ρ 12 is simply the Pearson correlation between the two
rows of ranks in Equation 1.44 . The Spearman rank correlation ρ 12 quantifies how well the
relationship between two variables can be described as a monotonic function. For ρ 12 = 1,
the relationship between the two variables is perfectly positively monotonic (not necessarily
linear), and for ρ 12 = −1, the relationship is perfectly negatively monotonic. In MATLAB, ρ 12
can be estimated using the function corr( X 1 , X 2 ,'type', 'Spearman').
In general, the Spearman correlation ρ 12 is not the same as the Pearson correlation δ 12 .
Table 1.6 s hows an example where X and Y are perfectly monotonically correlated. In fact,
Y = X 3 . The Pearson correlation δ = 0.906 is computed by corr( X , y , 'type', 'Pearson'),
whereas the Spearman correlation ρ = 1 is computed by the MATLAB function corr( X , y ,
'type', 'Spearman'). They are not equal. The Pearson correlation δ is not exactly 1 because
it quantifies “linear correlation,” and in this case, the relationship between X and Y is
nonlinear. The Spearman correlation ρ is exactly 1 because the ranks of X and Y are iden-
tical (see the fourth and fifth columns of Table 1.6 ) . As a result, the Spearman correlation
ρ quantifies how well the relationship between (X, Y) can be described as a monotonic
function.
It is well known that the Pearson product-moment correlation δ 12 between the bivariate
normal random variables (X 1 , X 2 ) is approximately equal to its Spearman rank correlation
ρ 12 . It is therefore possible to estimate δ 12 using the rank correlation ρ 12 .
Table 1.6 Values of (X, Y) data points
Index k
X
Y
X rank
Y rank
1
0
0
1
1
2
1
1
2
2
3
2
8
3
3
4
3
27
4
4
5
4
64
5
5
6
5
125
6
6
 
 
Search WWH ::




Custom Search