悬赏 1 个论坛币 未解决
小弟最近使用quadprog求二次规划问题时,不管是收益率设定为0.5%,1%,2%,3%,x的最优结果都一样。
下面是收益率设为0.5%时的程序,为什么会这样呢? 跪求高手指点!!!!
H=[0.000844 0.0000473 0.000432 0.000613 0.0000577;
0.0000473 0.000812 0.000351 0.000257 -0.00000438;
0.000432 0.000351 0.002329 0.000699 -0.00006;
0.000613 0.000257 0.000699 0.001076 0.0000254;
0.0000577 -0.00000438 -0.00006 0.0000254 0.000078];
>> f=[0 0 0 0 0];
>> A=[-0.04475135 -0.01424 -0.01281096 -0.04500779 -0.042545144];
>> aeq=[1 1 1 1 1];
>> b=[-0.005];
>> beq=[1];
>> lb=[0 0 0 0 0];
>> ub=[1 1 1 1 1];
>> [x,fval]=quadprog(H,f,A,b,aeq,beq,lb,ub)
Warning: Large-scale method does not currently solve this problem formulation,
using medium-scale method instead.
> In quadprog at 267
Optimization terminated.
x =
-0.0000
0.0691
0.0411
0.0000
0.8898
fval =
3.3317e-005