Documentation

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.

Portfolio

Portfolio object for mean-variance portfolio optimization and analysis

Description

The Portfolio object implements mean-variance portfolio optimization. Portfolio objects support functions that are specific to mean-variance portfolio optimization.

The main workflow for portfolio optimization is to create an instance of a Portfolio object that completely specifies a portfolio optimization problem and to operate on the Portfolio object using supported functions to obtain and analyze efficient portfolios. A mean-variance optimization problem is completely specified with the following three elements:

  • A universe of assets with estimates for the prospective mean and covariance of asset total returns for a period of interest.

  • A portfolio set that specifies the set of portfolio choices in terms of a collection of constraints.

  • A model for portfolio return and risk, which, for mean-variance optimization, is either the gross or net mean of portfolio returns and the standard deviation of portfolio returns.

After you specify these three elements in an unambiguous way, you can solve and analyze portfolio optimization problems. The simplest mean-variance portfolio optimization problem has:

  • A mean and covariance of asset total returns

  • Nonnegative weights for all portfolios that sum to 1 (the summation constraint is known as a budget constraint)

  • Built-in models for portfolio return and risk that use the mean and covariance of asset total returns

Given mean and covariance of asset returns in the variables AssetMean and AssetCovar, this problem is completely specified by:

p = Portfolio('AssetMean', AssetMean, 'AssetCovar', AssetCovar,...
'LowerBound', 0, 'UpperBudget',1, 'LowerBudget',1)
or equivalently by:
p = Portfolio;
p = setAssetMoments(p, AssetMean, AssetCovar); 
p = setDefaultConstraints(p);

For more information on the workflow when using Portfolio objects, see Portfolio Object Workflow and for more detailed information on the theoretical basis for mean-variance optimization, see Portfolio Optimization Theory.

Properties

Portfolio PropertiesManage Portfolio object for mean-variance portfolio optimization and analysis

Object Functions

setAssetListSet up list of identifiers for assets
setInitPortSet up initial or current portfolio
setDefaultConstraintsSet up portfolio constraints with nonnegative weights that sum to 1
getAssetMomentsObtain mean and covariance of asset returns from Portfolio object
setAssetMoments Set moments (mean and covariance) of asset returns for Portfolio object
estimateAssetMomentsEstimate mean and covariance of asset returns from data
setCostsSet up proportional transaction costs
addEqualityAdd linear equality constraints for portfolio weights to existing constraints
addGroupRatioAdd group ratio constraints for portfolio weights to existing group ratio constraints
addGroupsAdd group constraints for portfolio weights to existing group constraints
addInequalityAdd linear inequality constraints for portfolio weights to existing constraints
getBoundsObtain bounds for portfolio weights from portfolio object
getBudgetObtain budget constraint bounds from portfolio object
getCostsObtain buy and sell transaction costs from portfolio object
getEqualityObtain equality constraint arrays from portfolio object
getGroupRatioObtain group ratio constraint arrays from portfolio object
getGroupsObtain group constraint arrays from portfolio object
getInequalityObtain inequality constraint arrays from portfolio object
getOneWayTurnoverObtain one-way turnover constraints from portfolio object
setGroupsSet up group constraints for portfolio weights
setInequalitySet up linear inequality constraints for portfolio weights
setBoundsSet up bounds for portfolio weights
setBudgetSet up budget constraints
setCostsSet up proportional transaction costs
setDefaultConstraintsSet up portfolio constraints with nonnegative weights that sum to 1
setEqualitySet up linear equality constraints for portfolio weights
setGroupRatioSet up group ratio constraints for portfolio weights
setInitPortSet up initial or current portfolio
setOneWayTurnoverSet up one-way portfolio turnover constraints
setTurnoverSet up maximum portfolio turnover constraint
setTrackingPortSet up benchmark portfolio for tracking error constraint
setTrackingErrorSet up maximum portfolio tracking error constraint
checkFeasibilityCheck feasibility of input portfolios against portfolio object
estimateBoundsEstimate global lower and upper bounds for set of portfolios
estimateFrontierEstimate specified number of optimal portfolios on the efficient frontier
estimateFrontierByReturnEstimate optimal portfolios with targeted portfolio returns
estimateFrontierByRiskEstimate optimal portfolios with targeted portfolio risks
estimateFrontierLimitsEstimate optimal portfolios at endpoints of efficient frontier
plotFrontierPlot efficient frontier
estimateMaxSharpeRatio Estimate efficient portfolio to maximize Sharpe ratio for Portfolio object
estimatePortMoments Estimate moments of portfolio returns for Portfolio object
estimatePortReturnEstimate mean of portfolio returns
estimatePortRiskEstimate portfolio risk according to risk proxy associated with corresponding object
setSolverChoose main solver and specify associated solver options for portfolio optimization

Examples

expand all

Create efficient portfolios:

load CAPMuniverse

p = Portfolio('AssetList',Assets(1:12));
p = estimateAssetMoments(p, Data(:,1:12),'missingdata',true);
p = setDefaultConstraints(p);
plotFrontier(p);

pwgt = estimateFrontier(p, 5);

pnames = cell(1,5);
for i = 1:5
	pnames{i} = sprintf('Port%d',i);
end

Blotter = dataset([{pwgt},pnames],'obsnames',p.AssetList);

disp(Blotter);
            Port1        Port2       Port3       Port4      Port5
    AAPL     0.017926    0.058247    0.097816    0.12955    0    
    AMZN            0           0           0          0    0    
    CSCO            0           0           0          0    0    
    DELL    0.0041906           0           0          0    0    
    EBAY            0           0           0          0    0    
    GOOG      0.16144     0.35678     0.55228    0.75116    1    
    HPQ      0.052566    0.032302    0.011186          0    0    
    IBM       0.46422     0.36045     0.25577    0.11928    0    
    INTC            0           0           0          0    0    
    MSFT      0.29966     0.19222    0.082949          0    0    
    ORCL            0           0           0          0    0    
    YHOO            0           0           0          0    0    

References

[1] For a complete list of references for the Portfolio object, see Portfolio Optimization.

Introduced in R2011a


Was this topic helpful?