Main Content

Obtaining Portfolios Along the Entire Efficient Frontier

The most basic way to obtain optimal portfolios is to obtain points over the entire range of the efficient frontier.

Given a portfolio optimization problem in a Portfolio object, the estimateFrontier function computes efficient portfolios spaced evenly according to the return proxy from the minimum to maximum return efficient portfolios. The number of portfolios estimated is controlled by the hidden property defaultNumPorts which is set to 10. A different value for the number of portfolios estimated is specified as an input argument to estimateFrontier. This example shows the default number of efficient portfolios over the entire range of the efficient frontier.

m = [ 0.05; 0.1; 0.12; 0.18 ];
C = [ 0.0064 0.00408 0.00192 0; 
      0.00408 0.0289 0.0204 0.0119;
      0.00192 0.0204 0.0576 0.0336;
      0 0.0119 0.0336 0.1225 ];
 
p = Portfolio;
p = setAssetMoments(p, m, C);
p = setDefaultConstraints(p);
pwgt = estimateFrontier(p);

disp(pwgt)
    0.8891    0.7215    0.5540    0.3865    0.2190    0.0515         0         0         0         0
    0.0369    0.1289    0.2209    0.3129    0.4049    0.4969    0.4049    0.2314    0.0579         0
    0.0404    0.0567    0.0730    0.0893    0.1056    0.1219    0.1320    0.1394    0.1468         0
    0.0336    0.0929    0.1521    0.2113    0.2705    0.3297    0.4630    0.6292    0.7953    1.0000

If you want only four portfolios, you can use estimateFrontier with NumPorts specified as 4.

pwgt = estimateFrontier(p, 4);
disp(pwgt)
    0.8891    0.3865         0         0
    0.0369    0.3129    0.4049         0
    0.0404    0.0893    0.1320         0
    0.0336    0.2113    0.4630    1.0000

Starting from the initial portfolio, estimateFrontier also returns purchases and sales to get from your initial portfolio to each efficient portfolio on the efficient frontier. For example, given an initial portfolio in pwgt0, you can obtain purchases and sales:

pwgt0 = [ 0.3; 0.3; 0.2; 0.1 ];
p = setInitPort(p, pwgt0);
[pwgt, pbuy, psell] = estimateFrontier(p);

display(pwgt)
pwgt = 4×10

    0.8891    0.7215    0.5540    0.3865    0.2190    0.0515         0         0         0         0
    0.0369    0.1289    0.2209    0.3129    0.4049    0.4969    0.4049    0.2314    0.0579         0
    0.0404    0.0567    0.0730    0.0893    0.1056    0.1219    0.1320    0.1394    0.1468         0
    0.0336    0.0929    0.1521    0.2113    0.2705    0.3297    0.4630    0.6292    0.7953    1.0000

display(pbuy)
pbuy = 4×10

    0.5891    0.4215    0.2540    0.0865         0         0         0         0         0         0
         0         0         0    0.0129    0.1049    0.1969    0.1049         0         0         0
         0         0         0         0         0         0         0         0         0         0
         0         0    0.0521    0.1113    0.1705    0.2297    0.3630    0.5292    0.6953    0.9000

display(psell)
psell = 4×10

         0         0         0         0    0.0810    0.2485    0.3000    0.3000    0.3000    0.3000
    0.2631    0.1711    0.0791         0         0         0         0    0.0686    0.2421    0.3000
    0.1596    0.1433    0.1270    0.1107    0.0944    0.0781    0.0680    0.0606    0.0532    0.2000
    0.0664    0.0071         0         0         0         0         0         0         0         0

If you do not specify an initial portfolio, the purchase and sale weights assume that your initial portfolio is 0.

See Also

| | | | | | | | | |

Related Examples

More About

External Websites