Documentation

estimateFrontier

Class: Portfolio

Estimate specified number of optimal portfolios on the efficient frontier

Syntax

[pwgt,pbuy,psell] = estimateFrontier(obj)
[pwgt,pbuy,psell] = estimateFrontier(obj,NumPorts)

Description

[pwgt,pbuy,psell] = estimateFrontier(obj) estimates a default number of optimal portfolios on the efficient frontier.

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

Tips

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

 	[pwgt, pbuy, psell] = obj.estimateFrontier(NumPorts);

Input Arguments

obj

Portfolio object [Portfolio].

NumPorts

(Optional) Number of points to obtain on the efficient frontier [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 method returns the portfolio specified by the hidden property defaultFrontierLimit (current default value is 'min').

Default: 10

Output Arguments

pwgt

Optimal portfolios on the efficient frontier with specified number of portfolios spaced equally from minimum to maximum portfolio return [NumAssets-by-NumPorts matrix].

pbuy

Purchases relative to an initial portfolio for optimal portfolios on the efficient frontier [NumAssets-by-NumPorts matrix].

psell

Sales relative to an initial portfolio for optimal portfolios on the efficient frontier [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).

Attributes

Accesspublic
Staticfalse
Hiddenfalse

To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.

Examples

expand all

Obtain the Default Number of Efficient Portfolios

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

Obtain Purchases and Sales for Portfolios on the Efficient Frontier

Starting from the initial portfolio, the estimateFrontier method 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);
[pwgt, pbuy, psell] = estimateFrontier(p);

display(pwgt);
display(pbuy);
display(psell);
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


pbuy =

  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


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

Was this topic helpful?