def pymc3_mse(y_true, y_pred_rv):
    """
    Allows you to get a trace of a model's mean square error

    :param y_true: array like
    :param y_pred_rv: PyMC3 Rv trace
    :return:
    """
    import pymc3.math as pmath
    n = len(y_true)
    return pmath.sum(pmath.sqr(y_true - y_pred_rv)) / n
