Fixed correlation coefficient calculation

* Correlation coefficient r() was returning NaN
  if the standard deviation of y was 0 (because
  all y values were equal)
* Added test for calculating linear regression
  with points containing same y coordinate values