MATLAB Answers

0

Multiple groups in Portfolio not working properly

Asked by Elham Noorzai on 13 Aug 2018 at 4:17

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

  0 Comments

Sign in to comment.

0 Answers