Documentation Center |
The PortfolioMAD object implements mean absolute-deviation (MAD) portfolio optimization and is derived from the abstract class AbstractPortfolio. Every property and method of the PortfolioMAD object is public, although some properties and methods are hidden. See PortfolioMAD Object Properties and PortfolioMAD Object Methods for the properties and methods of a PortfolioMAD object. The PortfolioMAD object is a value object where every instance of the object is a distinct version of the object. Since the PortfolioMAD object is also a MATLAB^{®} object, it inherits the default methods associated with MATLAB objects.
PortfolioMAD Object Properties
Property | Description | Characteristics |
---|---|---|
AEquality | Matrix for equality constraints | Matrix |
AInequality | Matrix for inequality constraints | Matrix |
AssetList | List of asset names or identifiers | Vector cell array of strings |
bEquality | Vector for equality constraints | Vector |
bInequality | Vector for inequality constraints | Vector |
BuyCost | Cost to purchase assets | Vector |
BuyTurnover | Turnover constraint on purchases | Scalar |
GroupA | Base group ratio constraint matrix | Boolean matrix or matrix |
GroupB | Comparison group ratio constraint matrix | Boolean matrix or matrix |
GroupMatrix | Group membership matrix | Boolean matrix or matrix |
InitPort | Initial or current portfolio | Vector |
LowerBound | Lower-bound constraint | Vector |
LowerBudget | Lower-budget constraint | Scalar |
LowerGroup | Lower-group constraint | Vector |
LowerRatio | Lower-group ratio constraint ratio | Vector |
Name | Name for instance of PortfolioMAD object | String |
NumAssets | Number of assets in universe | Scalar positive integer |
NumScenarios | Number of scenarios (read only) | Scalar integer |
RiskFreeRate | Period return of riskless asset | Scalar |
SellCost | Cost to sell assets | Vector |
SellTurnover | Turnover constraint on sales | Scalar |
Turnover | Upper-bound portfolio turnover | Scalar |
UpperBound | Upper-bound constraint | Vector |
UpperBudget | Upper-budget constraint | Scalar |
UpperGroup | Upper-group constraint | Vector |
UpperRatio | Upper-group ratio constraint ratio | Vector |
PortfolioMAD Object Methods
Method | Description |
---|---|
Add equality constraints for portfolio weights to existing constraints. | |
Add group ratio constraints for portfolio weights to existing constraints. | |
Add group constraints for portfolio weights to existing constraints. | |
Add inequality constraints for portfolio weights to existing constraints. | |
Determine if portfolios are members of the set of feasible portfolios. | |
Determine if the set of feasible portfolios is nonempty and bounded. | |
Estimate portfolios on the entire efficient frontier. | |
Estimate portfolios on the efficient frontier with targeted returns or return proxies. | |
Estimate portfolios on the efficient frontier with targeted risks or risk proxies. | |
Estimate portfolios at the extreme ends of the efficient frontier (minimum risk and maximum return). | |
Estimate the return or return proxy for specified portfolios. | |
Estimate the risk or risk proxy for specified portfolios. | |
Estimate standard deviation of portfolio returns. | |
Estimate mean and covariance of scenarios. | |
Get lower and upper bounds from object. | |
Simulate multivariate normal asset return scenarios from data. | |
Simulate multivariate normal asset return scenarios from a mean and covariance of asset returns. | |
Get lower and upper budget constraints from object. | |
Get purchase and sales proportional transaction costs from object. | |
Get equality constraint matrix and vector from object. | |
Get base matrix, comparison matrix, and lower and upper bounds for group ratio constraints from object. | |
Get group matrix and lower and upper bounds for group constraints from object. | |
Get inequality constraint matrix and vector from object. | |
Get one-way portfolio turnover constraints. | |
Obtain scenarios from PortfolioMAD object. | |
Plot efficient frontier and optionally obtain risks and returns for portfolios on the efficient frontier. | |
Set up a list of asset names and symbols to be associated with assets in universe. | |
Set up lower and upper bounds for portfolio weights. | |
Set up lower and upper budget constraints for portfolio weights. | |
Set up purchase and sale proportional transaction costs for assets in universe. | |
Set up default constraints for portfolio weights (nonnegative weights that must sum to 1). | |
Set up equality constraints for portfolio weights. | |
Set up group ratio constraints for portfolio weights. | |
Set up group constraints for portfolio weights. | |
Set up inequality constraints for portfolio weights. | |
Set up initial portfolio weights. | |
Set up one-way portfolio turnover constraints. | |
Set up hidden control properties in object (not implemented). | |
Set asset returns scenarios by direct matrix. | |
Set up solver to estimate efficient portfolios. | |
Set up average turnover constraints for portfolio weights. |
The PortfolioMAD object and its methods are an interface for mean absolute-deviation portfolio optimization. Consequently, almost everything you do with the PortfolioMAD object can be done using the methods. The basic workflow is:
Design your portfolio problem.
Use the portfolio constructor (PortfolioMAD) to create the PortfolioMAD object or use the various set methods to set up your portfolio problem.
Use estimate methods to solve your portfolio problem.
In addition, methods are available to help you view intermediate results and to diagnose your computations. Since MATLAB features are part of a PortfolioMAD object, you can save and load objects from your workspace and create and manipulate arrays of objects. After settling on a problem, which, in the case of MAD portfolio optimization, means that you have either scenarios, data, or moments for asset returns, and a collection of constraints on your portfolios, use the portfolio constructor to set the properties for the PortfolioMAD object.
The PortfolioMAD constructor lets you create an object from scratch or update an existing object. Since the PortfolioMAD object is a value object, it is easy to create a basic object, then use methods to build upon the basic object to create new versions of the basic object. This is useful to compare a basic problem with alternatives derived from the basic problem. For details, see Constructing the PortfolioMAD Object.
You can set properties of a PortfolioMAD object using either the constructor (PortfolioMAD) or various set methods.
Note: Although you can also set properties directly, it is not recommended since error-checking is not performed when you set a property directly. |
The PortfolioMAD constructor supports setting properties with name-value pair arguments such that each argument name is a property and each value is the value to assign to that property. For example, to set the LowerBound and Budget properties in an existing PortfolioMAD object p, use the syntax:
p = PortfolioMAD(p,'LowerBound', 0,'Budget',1);
In addition to the PortfolioMAD constructor, which lets you set individual properties one at a time, groups of properties are set in a PortfolioMAD object with various "set" and "add" methods. For example, to set up an average turnover constraint, use the setTurnover method to specify the bound on portfolio turnover and the initial portfolio. To get individual properties from a PortfolioMAD object, obtain properties directly or use an assortment of "get" methods that obtain groups of properties from a PortfolioMAD object. The PortfolioMAD object constructor and set methods have several useful features:
The constructor and set methods try to determine the dimensions of your problem with either explicit or implicit inputs.
The constructor and set methods try to resolve ambiguities with default choices.
The constructor and set methods perform scalar expansion on arrays when possible.
The methods try to diagnose and warn about problems.
The PortfolioMAD object uses the default display method provided by MATLAB, where display and disp display a PortfolioMAD object and its properties with or without the object variable name.
Save and load PortfolioMAD objects using the MATLAB save and load commands.
Estimating efficient portfolios and efficient frontiers is the primary purpose of the MAD portfolio optimization tools. A collection of "estimate" and "plot" methods provide ways to explore the efficient frontier. The "estimate" methods obtain either efficient portfolios or risk and return proxies to form efficient frontiers. At the portfolio level, a collection of methods estimates efficient portfolios on the efficient frontier with methods to obtain efficient portfolios:
At the endpoints of the efficient frontier
That attain targeted values for return proxies
That attain targeted values for risk proxies
Along the entire efficient frontier
These methods also provide purchases and sales needed to shift from an initial or current portfolio to each efficient portfolio. At the efficient frontier level, a collection of methods plot the efficient frontier and estimate either risk or return proxies for efficient portfolios on the efficient frontier. You can use the resultant efficient portfolios or risk and return proxies in subsequent analyses.
Although all methods associated with a PortfolioMAD object are designed to work on a scalar PortfolioMAD object, the array capabilities of MATLAB enables you to set up and work with arrays of PortfolioMAD objects. The easiest way to do this is with the repmat function. For example, to create a 3-by-2 array of PortfolioMAD objects:
p = repmat(PortfolioMAD, 3, 2); disp(p)
After setting up an array of PortfolioMAD objects, you can work on individual PortfolioMAD objects in the array by indexing. For example:
p(i,j) = PortfolioMAD(p(i,j), ... );
This example calls the PortfolioMAD object constructor for the (i,j) element of a matrix of PortfolioMAD objects in the variable p.
If you set up an array of PortfolioMAD objects, you can access properties of a particular PortfolioMAD object in the array by indexing so that you can set the lower and upper bounds lb and ub for the (i,j,k) element of a 3-D array of PortfolioMAD objects with
p(i,j,k) = p(i,j,k).setBounds(lb, ub);
and, once set, you can access these bounds with
[lb, ub] = p(i,j,k).getBounds;
PortfolioMAD object methods work on only one PortfolioMAD object at a time.
You can subclass the PortfolioMAD object to override existing methods or to add new properties or methods. To do so, create a derived class from the PortfolioMAD class. This gives you all the properties and methods of the PortfolioMAD class along with any new features that you choose to add to your subclassed object. The PortfolioMAD class is derived from an abstract class called AbstractPortfolio. Because of this, you can also create a derived class from AbstractPortfolio that implements an entirely different form of portfolio optimization using properties and methods of the AbstractPortfolio class.
The MAD portfolio optimization tools follow these conventions regarding the representation of different quantities associated with portfolio optimization:
Asset returns or prices for scenarios are in matrix form with samples for a given asset going down the rows and assets going across the columns. In the case of prices, the earliest dates must be at the top of the matrix, with increasing dates going down.
Portfolios are in vector or matrix form with weights for a given portfolio going down the rows and distinct portfolios going across the columns.
Constraints on portfolios are formed in such a way that a portfolio is a column vector.
Portfolio risks and returns are either scalars or column vectors (for multiple portfolio risks and returns).
AbstractPortfolio | PortfolioMAD