我无法弄清楚在 numeric.js 中使用 quadprog 进行的投资组合优化(找到最佳权重)我做错了什么
我的投资组合限制很简单:权重总和应为 1,所有权重(对于 3 种资产中的每一种)应介于 0 和 1 之间(无卖空,无杠杆)。约束未被识别,权重变得非常高(也是负数)。
var constraintsmatrix = [[0,0,0,0], [1,0,1,0], [1,0,0,0]];
var covmatrix = [[0.00020817,0.00016281,0.00009747],[0.00016281,0.00026680,0.00009912],[0.00009747,0.00009912,0.00019958]];
var returnsmatrix = [0.1,0.05,0.1];
var bvec = 1; // [1,0,0,0,0,0,0,1,1,1];
var result = numeric.solveQP(covmatrix, returnsmatrix, constraintsmatrix, bvec);
任何提示表示赞赏。谢谢