参考Princeton在2021的论文《End-to-End Risk Budgeting Portfolio Optimization with Neural Networks》,实现基于FactorModel的组合优化:人工构建大类资产因子,然后输入神经网络映射为风险预算,再对接CvxpyLayers 优化得到资产权重。模型整合了因子合成和组合优化两个步骤。模型构建流程如: 选取5个大类资产如指数,国债指数,...
确定是否是初始问题,比如工具功能分析/特性传递等工具. 步骤 问题识别 主要是识别出初始问题;因为最...
開發者ID:oxfordcontrol,項目名稱:osqp_benchmarks,代碼行數:12,代碼來源:random_qp.py 示例11: portfolio_opt ▲點讚 5▼ # 需要導入模塊: import cvxpy [as 別名]# 或者: from cvxpy importquad_form[as 別名]defportfolio_opt(p):""" Create a portfolio optimization problem with p dimensions """tem...
Source File: cvxpy_examples.py From cvxpylayers with Apache License 2.0 5 votes def full_qp(): # print(f'--- {sys._getframe().f_code.co_name} ---') print('full qp') npr.seed(0) nx, ncon_eq, ncon_ineq = 5, 2, 3 Q = cp.Parameter((nx, nx)) p = cp.Parameter((...
Source File: test_cvxpylayer.py From cvxpylayers with Apache License 2.0 6 votes def test_lml(self): tf.random.set_seed(0) k = 2 x = cp.Parameter(4) y = cp.Variable(4) obj = -x * y - cp.sum(cp.entr(y)) - cp.sum(cp.entr(1. - y)) cons = [cp.sum(y) == k] ...
Differentiable convex optimization layers. Contribute to cvxgrp/cvxpylayers development by creating an account on GitHub.