← 返回题库
中级

确定性等价

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve(____):
    import math
    expected_wealth = sum(p * w for p, w in zip(____))
    if gamma == ____:
        expected_utility = sum(p * math.log(____) for p, w in zip(____))
        ce = math.exp(____)
    else:
        expected_utility = sum(p * w ** (____ - gamma) / (____ - gamma) for p, w in zip(____))
        ce = (expected_utility * (____ - gamma)) ** (____ / (____ - gamma))
    risk_premium = expected_wealth - ce
    return {"____": round(____), "____": round(____), "____": round(____)}

示例

输入
solve([100, 50], [0.5, 0.5], 2)
期望输出
{'期望财富': 75.0, '确定性等价': 66.67, '风险溢价': 8.33}
Python 代码 🔒 登录后使用
🔒

登录后即可练习

注册免费账号,在浏览器中直接运行 Python 代码