optimiz.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Chalutier 作者: LaBaleineFr 项目源码 文件源码
def evaluate_portefolio(wei, returns_vec):
    """ Given a repartition, compute expected return and risk from a portefolio

    :param wei: Weights for each currency
    :type wei: ndarray of float
    :return: expected return and risk
    :rtype: (float, float)
    """
    p = np.asmatrix(np.mean(returns_vec, axis=1))
    w = np.asmatrix(wei)
    c = np.asmatrix(np.cov(returns_vec))
    mu = w * p.T
    sigma = np.sqrt(w * c * w.T)
    return mu, sigma
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号