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 PortfolioCVaR 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 ];
m = m/12;
C = C/12;

AssetScenarios = mvnrnd(m, C, 20000);

p = PortfolioCVaR;
p = setScenarios(p, AssetScenarios);
p = setDefaultConstraints(p);
p = setProbabilityLevel(p, 0.95);

pwgt = estimateFrontier(p);
disp(pwgt)
  Columns 1 through 7

    0.8641    0.6956    0.5319    0.3651    0.1945    0.0212         0
    0.0606    0.1589    0.2551    0.3561    0.4667    0.5748    0.4568
    0.0326    0.0450    0.0503    0.0559    0.0574    0.0671    0.0506
    0.0426    0.1005    0.1627    0.2229    0.2814    0.3368    0.4925

  Columns 8 through 10

         0         0         0
    0.3115    0.1599         0
    0.0253    0.0077         0
    0.6632    0.8325    1.0000

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

pwgt = estimateFrontier(p, 4);
disp(pwgt)
    0.8641    0.3651         0         0
    0.0606    0.3561    0.4568         0
    0.0326    0.0559    0.0506         0
    0.0426    0.2229    0.4925    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.8641    0.6956    0.5319    0.3651    0.1945    0.0212         0         0         0         0
    0.0606    0.1589    0.2551    0.3561    0.4667    0.5748    0.4568    0.3115    0.1599         0
    0.0326    0.0450    0.0503    0.0559    0.0574    0.0671    0.0506    0.0253    0.0077         0
    0.0426    0.1005    0.1627    0.2229    0.2814    0.3368    0.4925    0.6632    0.8325    1.0000

display(pbuy)
pbuy = 4×10

    0.5641    0.3956    0.2319    0.0651         0         0         0         0         0         0
         0         0         0    0.0561    0.1667    0.2748    0.1568    0.0115         0         0
         0         0         0         0         0         0         0         0         0         0
         0    0.0005    0.0627    0.1229    0.1814    0.2368    0.3925    0.5632    0.7325    0.9000

display(psell)
psell = 4×10

         0         0         0         0    0.1055    0.2788    0.3000    0.3000    0.3000    0.3000
    0.2394    0.1411    0.0449         0         0         0         0         0    0.1401    0.3000
    0.1674    0.1550    0.1497    0.1441    0.1426    0.1329    0.1494    0.1747    0.1923    0.2000
    0.0574         0         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