def mse(y, yhat):
    """Returns the mean squared error between y and yhat.

    :param y: true function values
    :param yhat: predicted function values
    :returns:
        .. math:: \\frac{1}{n} \sum_{i=1}^n \\big[(\hat{y}-y)^2\\big]

    Lower is better.

    >>> mse([0, 0], [2, 3])
    6.5

    """
    return float(sum([(l - p) ** 2
                      for l, p in zip(y, yhat)])) / len(y)