Defined similarity function with Pearson correlation