cov = [0.2 0.05 -0.01 0.03;0.05 0.3 0.015 0.01;-0.01 0.015 0.1 0.02;0.03 0.01 0.02 0.1];
>> [std corr] = cov2corr(cov)
std =
0.4472 0.5477 0.3162 0.3162
corr =
1.0000 0.2041 -0.0707 0.2121
0.2041 1.0000 0.0866 0.0577
-0.0707 0.0866 1.0000 0.2000
0.2121 0.0577 0.2000 1.0000
>> ExpReturn = [0.2 0.14 0.12 0.05];
>> portopt(ExpReturn,cov)
>> hold on
>> constr = [1 1 1 1 1;0 0 0 1 0.2;0 0 0 -1 0];
>> portopt(ExpReturn,cov,[],[],constr)
Warning: No finite bound constraints for one or more assets. Must use slower QP algorithm. To use faster LCP algorithm, problem should have at least one finite bound constraint. > In portopt at 226 Error using portopt (line 256)No portfolios satisfy all input constraints for maximum-return portfolio. Possibly unbounded problem. 求赐教 为什么无法显示出来有效前沿


雷达卡




京公网安备 11010802022788号







