Documentation

This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

estimateFrontier

Estimate specified number of optimal portfolios on the efficient frontier

Use the estimateFrontier function with a Portfolio, PortfolioCVaR, or PortfolioMAD object to estimate specified number of optimal portfolios on the efficient frontier.

For details on the respective workflows when using these different objects, see Portfolio Object Workflow, PortfolioCVaR Object Workflow, and PortfolioMAD Object Workflow.

Description

example

[pwgt,pbuy,psell] = estimateFrontier(obj) estimates the specified number of optimal portfolios on the efficient frontier. When no value is specified for the optional input argument NumPorts, the default value of 10 is obtained from the hidden property defaultNumPorts.

example

[pwgt,pbuy,psell] = estimateFrontier(obj,NumPorts) estimates the specified number of optimal portfolios on the efficient frontier with an additional option specified for NumPorts.

Examples

collapse all

Obtain 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);
Columns 1 through 7

0.8891    0.7215    0.5540    0.3865    0.2190    0.0515         0
0.0369    0.1289    0.2209    0.3129    0.4049    0.4969    0.4049
0.0404    0.0567    0.0730    0.0893    0.1056    0.1219    0.1320
0.0336    0.0929    0.1521    0.2113    0.2705    0.3297    0.4630

Columns 8 through 10

0         0         0
0.2314    0.0579         0
0.1394    0.1468         0
0.6292    0.7953    1.0000

Starting from the initial portfolio, the estimateFrontier function returns purchases and sales to get from your initial portfolio to each efficient portfolio on the efficient frontier. Given an initial portfolio in pwgt0, you can obtain purchases and sales.

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);
pwgt0 = [ 0.3; 0.3; 0.2; 0.1 ];
p = setInitPort(p, pwgt0);

display(pwgt);
pwgt =

Columns 1 through 7

0.8891    0.7215    0.5540    0.3865    0.2190    0.0515         0
0.0369    0.1289    0.2209    0.3129    0.4049    0.4969    0.4049
0.0404    0.0567    0.0730    0.0893    0.1056    0.1219    0.1320
0.0336    0.0929    0.1521    0.2113    0.2705    0.3297    0.4630

Columns 8 through 10

0         0         0
0.2314    0.0579         0
0.1394    0.1468         0
0.6292    0.7953    1.0000

Columns 1 through 7

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

Columns 8 through 10

0         0         0
0         0         0
0         0         0
0.5292    0.6953    0.9000

display(psell);
psell =

Columns 1 through 7

0         0         0         0    0.0810    0.2485    0.3000
0.2631    0.1711    0.0791         0         0         0         0
0.1596    0.1433    0.1270    0.1107    0.0944    0.0781    0.0680
0.0664    0.0071         0         0         0         0         0

Columns 8 through 10

0.3000    0.3000    0.3000
0.0686    0.2421    0.3000
0.0606    0.0532    0.2000
0         0         0

Obtain 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;

rng(11);

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.8454    0.6847    0.5151    0.3541    0.1902    0.0314    0.0000
0.0599    0.1427    0.2302    0.3165    0.3980    0.4733    0.3513
0.0462    0.0639    0.0945    0.1079    0.1345    0.1583    0.1756
0.0485    0.1087    0.1602    0.2215    0.2773    0.3371    0.4731

Columns 8 through 10

0.0000         0    0.0000
0.1806         0    0.0000
0.1916    0.2212    0.0000
0.6278    0.7788    1.0000

The function rng() resets the random number generator to produce the documented results. It is not necessary to reset the random number generator to simulate scenarios.

Starting from the initial portfolio, the estimateFrontier function returns purchases and sales to get from your initial portfolio to each efficient portfolio on the efficient frontier. Given an initial portfolio in pwgt0, you can obtain purchases and sales.

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;

rng(11);

AssetScenarios = mvnrnd(m, C, 20000);
p = PortfolioCVaR;
p = setScenarios(p, AssetScenarios);
p = setDefaultConstraints(p);
p = setProbabilityLevel(p, 0.95);

pwgt0 = [ 0.3; 0.3; 0.2; 0.1 ];
p = setInitPort(p, pwgt0);

display(pwgt);
pwgt =

Columns 1 through 7

0.8454    0.6847    0.5151    0.3541    0.1902    0.0314    0.0000
0.0599    0.1427    0.2302    0.3165    0.3980    0.4733    0.3513
0.0462    0.0639    0.0945    0.1079    0.1345    0.1583    0.1756
0.0485    0.1087    0.1602    0.2215    0.2773    0.3371    0.4731

Columns 8 through 10

0.0000         0    0.0000
0.1806         0    0.0000
0.1916    0.2212    0.0000
0.6278    0.7788    1.0000

Columns 1 through 7

0.5454    0.3847    0.2151    0.0541         0         0         0
0         0         0    0.0165    0.0980    0.1733    0.0513
0         0         0         0         0         0         0
0    0.0087    0.0602    0.1215    0.1773    0.2371    0.3731

Columns 8 through 10

0         0         0
0         0         0
0    0.0212         0
0.5278    0.6788    0.9000

display(psell);
psell =

Columns 1 through 7

0         0         0         0    0.1098    0.2686    0.3000
0.2401    0.1573    0.0698         0         0         0         0
0.1538    0.1361    0.1055    0.0921    0.0655    0.0417    0.0244
0.0515         0         0         0         0         0         0

Columns 8 through 10

0.3000    0.3000    0.3000
0.1194    0.3000    0.3000
0.0084         0    0.2000
0         0         0

The function rng() resets the random number generator to produce the documented results. It is not necessary to reset the random number generator to simulate scenarios.

Obtain 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;

rng(11);

AssetScenarios = mvnrnd(m, C, 20000);

p = setScenarios(p, AssetScenarios);
p = setDefaultConstraints(p);

pwgt = estimateFrontier(p);

disp(pwgt);
Columns 1 through 7

0.8815    0.7151    0.5487    0.3817    0.2170    0.0499    0.0000
0.0431    0.1282    0.2128    0.2981    0.3825    0.4662    0.3609
0.0389    0.0605    0.0826    0.1053    0.1241    0.1492    0.1786
0.0365    0.0963    0.1559    0.2149    0.2764    0.3348    0.4605

Columns 8 through 10

0    0.0000    0.0000
0.1755         0    0.0000
0.2095    0.2266    0.0000
0.6150    0.7734    1.0000

The function rng() resets the random number generator to produce the documented results. It is not necessary to reset the random number generator to simulate scenarios.

Starting from the initial portfolio, the estimateFrontier function returns purchases and sales to get from your initial portfolio to each efficient portfolio on the efficient frontier. Given an initial portfolio in pwgt0, you can obtain purchases and sales.

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;

rng(11);

AssetScenarios = mvnrnd(m, C, 20000);
p = setScenarios(p, AssetScenarios);
p = setDefaultConstraints(p);

pwgt0 = [ 0.3; 0.3; 0.2; 0.1 ];
p = setInitPort(p, pwgt0);

display(pwgt);
pwgt =

Columns 1 through 7

0.8815    0.7151    0.5487    0.3817    0.2170    0.0499    0.0000
0.0431    0.1282    0.2128    0.2981    0.3825    0.4662    0.3609
0.0389    0.0605    0.0826    0.1053    0.1241    0.1492    0.1786
0.0365    0.0963    0.1559    0.2149    0.2764    0.3348    0.4605

Columns 8 through 10

0    0.0000    0.0000
0.1755         0    0.0000
0.2095    0.2266    0.0000
0.6150    0.7734    1.0000

Columns 1 through 7

0.5815    0.4151    0.2487    0.0817         0         0         0
0         0         0         0    0.0825    0.1662    0.0609
0         0         0         0         0         0         0
0         0    0.0559    0.1149    0.1764    0.2348    0.3605

Columns 8 through 10

0         0         0
0         0         0
0.0095    0.0266         0
0.5150    0.6734    0.9000

display(psell);
psell =

Columns 1 through 7

0         0         0         0    0.0830    0.2501    0.3000
0.2569    0.1718    0.0872    0.0019         0         0         0
0.1611    0.1395    0.1174    0.0947    0.0759    0.0508    0.0214
0.0635    0.0037         0         0         0         0         0

Columns 8 through 10

0.3000    0.3000    0.3000
0.1245    0.3000    0.3000
0         0    0.2000
0         0         0

The function rng() resets the random number generator to produce the documented results. It is not necessary to reset the random number generator to simulate scenarios.

Input Arguments

collapse all

Object for portfolio, specified using Portfolio, PortfolioCVaR, or PortfolioMAD object. For more information on creating a portfolio object, see

Number of points to obtain on the efficient frontier, specified as a scalar integer.

Note

If no value is specified for NumPorts, the default value is obtained from the hidden property defaultNumPorts (default value is 10). If NumPorts = 1, this function returns the portfolio specified by the hidden property defaultFrontierLimit (current default value is 'min').

Data Types: double

Output Arguments

collapse all

Optimal portfolios on the efficient frontier with specified number of portfolios spaced equally from minimum to maximum portfolio return, returned as a NumAssets-by-NumPorts matrix. pwgt is returned for a Portfolio, PortfolioCVaR, or PortfolioMAD input object (obj).

Purchases relative to an initial portfolio for optimal portfolios on the efficient frontier, returned as NumAssets-by-NumPorts matrix.

Note

If no initial portfolio is specified in obj.InitPort, that value is assumed to be 0 such that pbuy = max(0, pwgt) and psell = max(0, -pwgt).

pbuy is returned for a Portfolio, PortfolioCVaR, or PortfolioMAD input object (obj).

Sales relative to an initial portfolio for optimal portfolios on the efficient frontier, returned as a NumAssets-by-NumPorts matrix.

Note

If no initial portfolio is specified in obj.InitPort, that value is assumed to be 0 such that pbuy = max(0, pwgt) and psell = max(0, -pwgt).

psell is returned for Portfolio, PortfolioCVaR, or PortfolioMAD input object (obj).

Tips

• You can also use dot notation to estimate the specified number of optimal portfolios over the entire efficient frontier.

• When introducing transaction costs and turnover constraints to the Portfolio, PortfolioCVaR, or PortfolioMAD object, the portfolio optimization objective contains a term with an absolute value. For more information on how Financial Toolbox™ handles such cases algorithmically, see References.

References

[1] Cornuejols, G., and R. Tutuncu. Optimization Methods in Finance. Cambridge University Press, 2007.

﻿