import math


def correl(x, y):
    """
    Compute Pearson correlation coefficient (r)
    """
    xbar = x.mean(0)
    ybar = y.mean(0)
    numerator = sum((x-xbar)*(y-ybar))
    denominator = math.sqrt(sum((x-xbar)**2))*math.sqrt(sum((y-ybar)**2))

    # Compute mean product (r)
    return numerator/denominator