我希望通过最小化VaR来找到多资产组合中的最佳权重。 这是为目标回报提供最小风险的代码。
p = PortfolioCVaR('ProbabilityLevel', .99, 'AssetNames', names);
p = p.setScenarios(R); % R= asset returns
p = p.setDefaultConstraints();
wts = p.estimateFrontier(20);
portRisk = p.estimatePortRisk(wts);
portRet = p.estimatePortReturn(wts);
clf
visualizeFrontier(p, portRisk, portRet);
%% Compute portfolio with given level of return
tic;
wt = p.estimateFrontierByReturn(.05/100);
toc;
pRisk = p.estimatePortRisk(wt);
pRet = p.estimatePortReturn(wt);
权重之和= 1 ..我的问题是如何添加约束,使得任何资产的权重都不能超过60%。 感谢您提供的任何帮助
答案 0 :(得分:1)
使用对象的setBounds
属性
>> p = setBounds(p,LowerBoundsVector,UpperBoundsVector);
见
>> doc setBounds
了解更多信息。