风险预算
原能力
登记可接受的风险、仓位与流动性条件,列出不可越过的约束和复核点。(细化版 p.16–17)
首选项目
PyPortfolioOpt(MIT)。 PyPortfolioOpt
匹配范围
组合优化约束、权重范围及 CVaR 表达风险边界。
源码
PyPortfolioOpt · def efficient_risk(
pypfopt/efficient_frontier/efficient_cvar.py · 201–214 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def efficient_risk(self, target_cvar, market_neutral=False):
"""
Maximise return for a target CVaR.
The resulting portfolio will have a CVaR less than the target
(but not guaranteed to be equal).
Parameters
----------
target_cvar : float
the desired conditional value at risk of the resulting portfolio.
market_neutral : bool, optional
whether the portfolio should be market neutral (weights sum to zero),
defaults to False. Requires negative lower weight bound.
CVXPY · def quad_form(
cvxpy/atoms/quad_form.py · 290–303 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def quad_form(x, P, assume_PSD: bool = False) -> Expression:
"""Alias for :math:`x^T P x`.
Parameters
----------
x : vector argument.
P : matrix argument.
assume_PSD : P is assumed to be PSD without checking.
Notes
-----
When ``P`` is a ``Parameter`` declared PSD or NSD and the solver supports
quadratic objectives, ``quad_form(x, P)`` can participate in a DPP solve,
so repeated solves can reuse cached compilation data.
- Copyright 2013 Steven Diamond, 2017 Robin Verschueren
实现与验收要点
授权、风险度量、仓位及流动性口径,需正式批准。