def cc_cov(r, **kwargs):
    '\n    Estimates a covariance matrix by using the Elton/Gruber Constant Correlation model\n    '
    rhos = r.corr()
    n = rhos.shape[0]
    rho_bar = ((rhos.values.sum() - n) / (n * (n - 1)))
    ccor = np.full_like(rhos, rho_bar)
    np.fill_diagonal(ccor, 1.0)
    sd = r.std()
    return pd.DataFrame((ccor * np.outer(sd, sd)), index=r.columns, columns=r.columns)
Estimates a covariance matrix by using the Elton/Gruber Constant Correlation model
def cc_cov(r, **kwargs):
    '\n    \n    '
    rhos = r.corr()
    n = rhos.shape[0]
    rho_bar = ((rhos.values.sum() - n) / (n * (n - 1)))
    ccor = np.full_like(rhos, rho_bar)
    np.fill_diagonal(ccor, 1.0)
    sd = r.std()
    return pd.DataFrame((ccor * np.outer(sd, sd)), index=r.columns, columns=r.columns)