模型matlab代码(模型一):
clc,clear
a=0;hold on
while a<0.05
c=[-0.05,-0.27,-0.19,-0.185,-0.185]
A=[zeros(4,1),diag([0.025,0.015,0.055,0.026])];%生成4*5矩阵,x0的风险率为零
b=a*ones(4,1);
Aeq=[1,1.01,1.02,1.045,1.065];
beq=1;
lb=zeros(5,1);
[x,Q]=linprog(c,A,b,Aeq,beq,lb);
Q=-Q;
plot(a,Q,'*k');
a=a+0.001;
end
xlabel('a'),ylabel('Q');
结果:
结论:分界点大概在0.006和0.026.在0.006之前快速上升,0.006和0.026有所减缓。之后几乎不变。