def msd_risk(weights, target_risk, cov):
    '\n        Returns the Mean Squared Difference in risk contributions\n        between weights and target_risk\n        '
    w_contribs = risk_contribution(weights, cov)
    return ((w_contribs - target_risk) ** 2).sum()
Returns the Mean Squared Difference in risk contributions
between weights and target_risk
def msd_risk(weights, target_risk, cov):
    '\n        Returns the Mean Squared Difference in risk contributions\n        between weights and target_risk\n        '
    w_contribs = risk_contribution(weights, cov)
    return ((w_contribs - target_risk) ** 2).sum()