%% Construct a PortfolioCVaR Object and Determine Efficient Portfolios
% Create efficient portfolios:

load CAPMuniverse

p = PortfolioCVaR('AssetList',Assets(1:12));
p = simulateNormalScenariosByData(p, Data(:,1:12), 20000 ,'missingdata',true);
p = setDefaultConstraints(p);
p = setProbabilityLevel(p, 0.95);

plotFrontier(p);

pwgt = estimateFrontier(p, 5);

pnames = cell(1,5);
for i = 1:5
	pnames{i} = sprintf('Port%d',i);
end

Blotter = dataset([{pwgt},pnames],'obsnames',p.AssetList);

disp(Blotter);

% Copyright 2015 The MathWorks, Inc.