correlation(x, y)

Returns the correlation coefficient of the data stored in arrays x and y.


See also linearreg autocorrelation 


Example


x = ( 1, 2, 3 )

1  2  3

y = ( 5, 5, 2 )

5  5  2

correlation( x, y )

-0.8660