The PortfolioMAD object implements mean absolute-deviation (MAD)
portfolio optimization and is derived from the abstract class
Every property and function of the PortfolioMAD object is public,
although some properties and functions are hidden. 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 functions associated with MATLAB objects.
The PortfolioMAD object and its functions are an interface for mean absolute-deviation portfolio optimization. So, almost everything you do with the PortfolioMAD object can be done using the functions. The basic workflow is:
Design your portfolio problem.
to create the PortfolioMAD object or use the various set functions
to set up your portfolio problem.
Use estimate functions to solve your portfolio problem.
In addition, functions 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
PortfolioMAD function to set the properties
for the PortfolioMAD object.
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 functions 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 Creating the PortfolioMAD Object.
You can set properties of a PortfolioMAD object using either
PortfolioMAD function or
various set functions.
Although you can also set properties directly, it is not recommended since error-checking is not performed when you set a property directly.
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
in an existing PortfolioMAD object
p, use the syntax:
p = PortfolioMAD(p,'LowerBound', 0,'Budget',1);
In addition to the
which lets you set individual properties one at a time, groups of
properties are set in a PortfolioMAD object with various “set”
and “add” functions. For example, to set up an average
turnover constraint, use the
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” functions that
obtain groups of properties from a PortfolioMAD object. The
PortfolioMAD function and set functions
have several useful features:
and set functions try to determine the dimensions of your problem
with either explicit or implicit inputs.
and set functions try to resolve ambiguities with default choices.
and set functions perform scalar expansion on arrays when possible.
The PortfolioMAD functions try to diagnose and warn about problems.
The PortfolioMAD object uses the default display function provided
by MATLAB, where
a PortfolioMAD object and its properties with or without the object
Save and load PortfolioMAD objects using the MATLAB
Estimating efficient portfolios and efficient frontiers is the primary purpose of the MAD portfolio optimization tools. A collection of “estimate” and “plot” functions provide ways to explore the efficient frontier. The “estimate” functions obtain either efficient portfolios or risk and return proxies to form efficient frontiers. At the portfolio level, a collection of functions estimates efficient portfolios on the efficient frontier with functions 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 functions 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 functions 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 functions 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
For example, to create a 3-by-2 array of PortfolioMAD objects:
p = repmat(PortfolioMAD, 3, 2); disp(p)
p(i,j) = PortfolioMAD(p(i,j), ... );
PortfolioMADfunction for the (
j) element of a matrix of PortfolioMAD objects in the variable
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
element of a 3-D array of PortfolioMAD objects with
p(i,j,k) = setBounds(p(i,j,k),lb, ub);
[lb, ub] = getBounds(p(i,j,k));
You can subclass the PortfolioMAD object to override existing
functions or to add new properties or functions. To do so, create
a derived class from the
PortfolioMAD class. This
gives you all the properties and functions of the
along with any new features that you choose to add to your subclassed
PortfolioMAD class is derived from an
abstract class called
of this, you can also create a derived class from
implements an entirely different form of portfolio optimization using
properties and functions of the
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).