This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Optimal capital allocation to efficient frontier portfolios


[RiskyRisk,RiskyReturn,RiskyWts,RiskyFraction,OverallRisk,OverallReturn] = portalloc(PortRisk,PortReturn,PortWts,RisklessRate,BorrowRate,RiskAversion)



Standard deviation of each risky asset efficient frontier portfolio. A number of portfolios (NPORTS-by-1 vector).


Expected return of each risky asset efficient frontier portfolio. An NPORTS-by-1 vector.


Weights allocated to each asset. An NPORTS by number of assets (NASSETS) matrix of weights allocated to each asset. Each row represents an efficient frontier portfolio of risky assets. Total of all weights in a portfolio is 1.


Risk-free lending rate. A decimal number.


(Optional) Borrowing rate. A decimal number. If borrowing is not desired, or not an option, set to NaN (default).


(Optional) Coefficient of investor's degree of risk aversion. Higher numbers indicate greater risk aversion. Typical coefficients range from 2.0 through 4.0 (Default = 3).

    Note:   Consider that a less risk-averse investor would be expected to accept much greater risk and, consequently, a more risk-averse investor would accept less risk for a given level of return. Therefore, making the RiskAversionargument higher reflects the risk-return tradeoff in the data.


[RiskyRisk,RiskyReturn,RiskyWts,RiskyFraction,OverallRisk,OverallReturn] = portalloc(PortRisk,PortReturn,PortWts, RisklessRate,BorrowRate,RiskAversion) computes the optimal risky portfolio, and the optimal allocation of funds between the risky portfolio and the risk-free asset.

RiskyRisk is the standard deviation of the optimal risky portfolio.

RiskyReturn is the expected return of the optimal risky portfolio.

RiskyWts is a 1-by-NASSETS vector of weights allocated to the optimal risky portfolio. The total of all weights in the portfolio is 1.

RiskyFraction is the fraction of the complete portfolio allocated to the risky portfolio.

OverallRisk is the standard deviation of the optimal overall portfolio.

OverallReturn is the expected rate of return of the optimal overall portfolio.

portalloc generates a plot of the optimal capital allocation if you invoke it without output arguments.


collapse all

This example shows how to compute the optimal risky portfolio by generating the efficient frontier from the asset data and then finding the optimal risky portfolio and allocate capital. The risk-free investment return is 8%, and the borrowing rate is 12%.

ExpReturn = [0.1 0.2 0.15]; 

ExpCovariance = [0.005   -0.010    0.004 
                -0.010    0.040   -0.002 
                 0.004   -0.002    0.023];
[PortRisk, PortReturn, PortWts] = portopt(ExpReturn,... 

RisklessRate  = 0.08;
BorrowRate    = 0.12;
RiskAversion  = 3;

[RiskyRisk, RiskyReturn, RiskyWts, RiskyFraction, ... 
OverallRisk, OverallReturn] = portalloc(PortRisk, PortReturn,... 
PortWts, RisklessRate, BorrowRate, RiskAversion)
RiskyRisk = 0.1283
RiskyReturn = 0.1788
RiskyWts = 

    0.0265    0.6023    0.3712

RiskyFraction = 1.1898
OverallRisk = 0.1527
OverallReturn = 0.1899


Bodie, Kane, and Marcus. Investments. Second Edition. Chapters 6 and 7.

Introduced before R2006a

Was this topic helpful?