crossbone254 发表于 2016-5-18 11:20 
你不放程序谁能知道你这结果怎么跑出来的
returns=mean(price);
stds=std(price);
correlations=corrcoef(price);
covariances=corr2cov(stds,correlations);
portopt(returns,covariances,100);
weights=rand(3000,10);
total=sum(weights,2);
weights(:,1)=weights(:,1)./total;
weights(:,2)=weights(:,2)./total;
weights(:,3)=weights(:,3)./total;
weights(:,4)=weights(:,4)./total;
weights(:,5)=weights(:,5)./total;
weights(:,6)=weights(:,6)./total;
weights(:,7)=weights(:,7)./total;
weights(:,8)=weights(:,8)./total;
weights(:,9)=weights(:,9)./total;
weights(:,10)=weights(:,10)./total;
[portrisk,portreturn]=portstats(returns,covariances,weights);
plot(portrisk,portreturn,'.r');
xlabel('Risk');
ylabel('Expected Return')