Multiple groups in Portfolio not working properly

2 views (last 30 days)
I have problems using the inbuilt function Portfolio, particular the setGroups/setInequality option. I exactly copied the approach mentioned in the examples and tested the approach on data from the bluechipmoments and everything works fine, except with my dataset.
Mostly, only one bound will be accepted and the others are not working properly. My assets set has 324 assets and a lot of missing values. Here is the code I have so far. The approach setGroups produces the same results.
p=Portfolio( 'Assetlist', Assetlistlong);
p=setAssetMoments(p, portfoliomean,portfoliocov);
AssetBounds = [0, 1.0];
p = setBounds(p, AssetBounds(1), AssetBounds(2));
p = setBudget(p, 1, 1);
firstvector=zeros(1, numberofassets);
firstvector(1,10)=-1;
secondvector=zeros(1, numberofassets);
secondvector(1,11)=-1;
thirdvector=zeros(1, numberofassets);
thirdvector(1,12)=-1;
G=[firstvector;secondvector;thirdvector];
GroupMin = [-0.07; -0.17;-0.27 ];
p = setInequality(p, G, GroupMin);
pwgt = p.estimateFrontier(10);
Here what my dataset provides
0,00371 0,07 -0,0005 -0,0018 -0,0036 -0,0053 -0,007 -0,009 -0,01 0,07
0,17 0,17 0,17 0,0031 0,004 0,005 0,0057 0,0066 0,0075 0,17
0,27 0,27 0,27 0,27 0,27 0,27 0,27 0,27 0,27 0,27
Here what the bluechipmoments dataset provides
0,07 0,07 0,07 0,07 0,07 0,07 0,07 0,07 0,07 0,07
0,17 0,17 0,17 0,17 0,17 0,17 0,17 0,17 0,17 0,17
0,27 0,27 0,27 0,27 0,27 0,27 0,27 0,27 0,27 0,27

Answers (0)

Categories

Find more on Portfolio Optimization and Asset Allocation in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!