The calculated distance is \(D^2 = \frac{1 - COR(`x`')}{2}\)

dist_pearson(x)

Arguments

x

a matrix

Value

distance matrix (distance object)

Details

The distance between the rows of x is calculated. The possible values range from 0 (perfectly correlated) over 0.5 (uncorrelated) to 1 (perfectly anti-correlated).

References

S. Theodoridis and K. Koutroumbas: Pattern Recognition, 3rd ed., p. 495

See also

Author

C. Beleites

Examples


dist_pearson(flu[[]])
#>              1            2            3            4            5
#> 2 0.0006321414                                                    
#> 3 0.0004898572 0.0002887337                                       
#> 4 0.0004424217 0.0002664884 0.0001705457                          
#> 5 0.0004852460 0.0002368675 0.0001909183 0.0001149165             
#> 6 0.0004242441 0.0002416168 0.0001591670 0.0001208129 0.0001102328
dist_pearson(flu)
#>              1            2            3            4            5
#> 2 0.0006321414                                                    
#> 3 0.0004898572 0.0002887337                                       
#> 4 0.0004424217 0.0002664884 0.0001705457                          
#> 5 0.0004852460 0.0002368675 0.0001909183 0.0001149165             
#> 6 0.0004242441 0.0002416168 0.0001591670 0.0001208129 0.0001102328