Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Create PortfolioMAD object for mean-absolute deviation portfolio optimization and analysis

The PortfolioMAD object implements mean-absolute deviation portfolio optimization, where MAD stands for “mean-absolute deviation.” PortfolioMAD objects support functions that are specific to MAD portfolio optimization.

The main workflow for MAD portfolio optimization is to create an instance of a PortfolioMAD object that completely specifies a portfolio optimization problem and to operate on the PortfolioMAD object to obtain and analyze efficient portfolios. For more information on the workflow when using PortfolioMAD objects, see PortfolioMAD Object Workflow.

You can use the `PortfolioMAD`

object in several ways. To set up a
portfolio optimization problem in a PortfolioMAD object, the simplest syntax
is:

p = PortfolioMAD;

`p`

, such that all object
properties are empty.
The `PortfolioMAD`

object also accepts collections of name-value pair
arguments for properties and their values. The `PortfolioMAD`

object
accepts inputs for properties with the general
syntax:

p = PortfolioMAD('property1',value1,'property2',value2, ... );

If a PortfolioMAD object exists, the syntax permits the first (and only the first
argument) of the `PortfolioMAD`

object to be an existing object with
subsequent name-value pair arguments for properties to be added or modified. For
example, given an existing PortfolioMAD object in `p`

, the general
syntax
is:

p = PortfolioMAD(p,'property1',value1,'property2',value2, ... );

Input argument names are not case-sensitive, but must be completely specified. In
addition, several properties can be specified with alternative argument names (see Shortcuts for Property Names). The `PortfolioMAD`

object
tries to detect problem dimensions from the inputs and, once set, subsequent inputs can
undergo various scalar or matrix expansion operations that simplify the overall process
to formulate a problem. In addition, a PortfolioMAD object is a value object so that,
given portfolio `p`

, the following code creates two objects,
`p`

and `q`

, that are
distinct:

q = PortfolioMAD(p, ...)

After creating a `PortfolioMAD`

object, you can use the associated
object functions to set portfolio constraints, analyze the efficient frontier, and
validate the portfolio model.

For more detailed information on the theoretical basis for conditional value-at-risk portfolio optimization, see Portfolio Optimization Theory.

`p = PortfolioMAD`

`p = PortfolioMAD(Name,Value)`

`p = PortfolioMAD(p,Name,Value)`

creates an
empty PortfolioMAD object for mean-absolute deviation portfolio optimization
and analysis. You can then add elements to the PortfolioMAD object using the
supported "add" and "set" functions. For more information, see Creating the PortfolioMAD Object.`p`

= PortfolioMAD

creates a PortfolioMAD object (`p`

= PortfolioMAD(`Name,Value`

)`p`

) and sets Properties using name-value
pairs. For example, ```
p =
PortfolioMAD('AssetList',Assets(1:12))
```

. You can specify
multiple name-value pairs.

creates a PortfolioMAD object (`p`

= PortfolioMAD(`p`

,`Name,Value`

)`p`

) using a previously
created PortfolioMAD object `p`

and sets Properties using name-value
pairs. You can specify multiple name-value pairs.

`setAssetList` | Set up list of identifiers for assets |

`setInitPort` | Set up initial or current portfolio |

`setDefaultConstraints` | Set up portfolio constraints with nonnegative weights that sum to 1 |

`estimateAssetMoments` | Estimate mean and covariance of asset returns from data |

`setCosts` | Set up proportional transaction costs |

`addEquality` | Add linear equality constraints for portfolio weights to existing constraints |

`addGroupRatio` | Add group ratio constraints for portfolio weights to existing group ratio constraints |

`addGroups` | Add group constraints for portfolio weights to existing group constraints |

`addInequality` | Add linear inequality constraints for portfolio weights to existing constraints |

`getBounds` | Obtain bounds for portfolio weights from portfolio object |

`getBudget` | Obtain budget constraint bounds from portfolio object |

`getCosts` | Obtain buy and sell transaction costs from portfolio object |

`getEquality` | Obtain equality constraint arrays from portfolio object |

`getGroupRatio` | Obtain group ratio constraint arrays from portfolio object |

`getGroups` | Obtain group constraint arrays from portfolio object |

`getInequality` | Obtain inequality constraint arrays from portfolio object |

`getOneWayTurnover` | Obtain one-way turnover constraints from portfolio object |

`setGroups` | Set up group constraints for portfolio weights |

`setInequality` | Set up linear inequality constraints for portfolio weights |

`setBounds` | Set up bounds for portfolio weights for a portfolio object |

`setMinMaxNumAssets` | Set cardinality constraints on the number of assets invested in a portfolio object |

`setBudget` | Set up budget constraints |

`setCosts` | Set up proportional transaction costs |

`setDefaultConstraints` | Set up portfolio constraints with nonnegative weights that sum to 1 |

`setEquality` | Set up linear equality constraints for portfolio weights |

`setGroupRatio` | Set up group ratio constraints for portfolio weights |

`setInitPort` | Set up initial or current portfolio |

`setOneWayTurnover` | Set up one-way portfolio turnover constraints |

`setTurnover` | Set up maximum portfolio turnover constraint |

`checkFeasibility` | Check feasibility of input portfolios against portfolio object |

`estimateBounds` | Estimate global lower and upper bounds for set of portfolios |

`estimateFrontier` | Estimate specified number of optimal portfolios on the efficient frontier |

`estimateFrontierByReturn` | Estimate optimal portfolios with targeted portfolio returns |

`estimateFrontierByRisk` | Estimate optimal portfolios with targeted portfolio risks |

`estimateFrontierLimits` | Estimate optimal portfolios at endpoints of efficient frontier |

`plotFrontier` | Plot efficient frontier |

`estimatePortReturn` | Estimate mean of portfolio returns |

`estimatePortRisk` | Estimate portfolio risk according to risk proxy associated with corresponding object |

`setSolver` | Choose main solver and specify associated solver options for portfolio optimization |

`setProbabilityLevel` | Set probability level for VaR and CVaR calculations |

`setScenarios` | Set asset returns scenarios by direct matrix |

`getScenarios` | Obtain scenarios from portfolio object |

`simulateNormalScenariosByData` | Simulate multivariate normal asset return scenarios from data |

`simulateNormalScenariosByMoments` | Simulate multivariate normal asset return scenarios from mean and covariance of asset returns |

`estimateScenarioMoments` | Estimate mean and covariance of asset return scenarios |

`estimatePortStd` | Estimate standard deviation of portfolio returns |

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

`Portfolio`

| `PortfolioCVaR`

| `estimateFrontier`

| `plotFrontier`

| `setScenarios`

- Creating the PortfolioMAD Object
- Common Operations on the PortfolioMAD Object
- Working with MAD Portfolio Constraints Using Defaults
- Asset Returns and Scenarios Using PortfolioMAD Object
- Validate the MAD Portfolio Problem
- Estimate Efficient Portfolios Along the Entire Frontier for PortfolioMAD Object
- Estimate Efficient Frontiers for PortfolioMAD Object
- Postprocessing Results to Set Up Tradable Portfolios
- Portfolio Optimization Theory
- PortfolioMAD Object Workflow
- PortfolioMAD Object Properties and Functions
- Working with PortfolioMAD Objects
- Setting and Getting Properties
- Displaying PortfolioMAD Objects
- Saving and Loading PortfolioMAD Objects
- Estimating Efficient Portfolios and Frontiers
- Arrays of PortfolioMAD Objects
- Subclassing PortfolioMAD Objects
- Conventions for Representation of Data