Vous êtes sur la page 1sur 12

Department of Chemical & Biomolecular Engineering

National University of Singapore

Optimization of Portfolio Asset Allocation

CN5111 Ad Interim Report
Group 11

David (A0074327E)
Jansen Gunardi (U094220X)
Russell Mahmood (U094794H)
Valentino Yonathan Febianto D (U094281L)
I. Motivations

There has been a massive interest in optimization study of financial investment in the
past decades. The promise of substantial return appeals many investors despite the
underlying risk level of investment (Elton et al, 1998). To manage the risk, an investor
typically resorts to diversification in the form of a portfolio (Yitzhaki, 1982), that is, a
collection of investments owned by an investment company, a financial institution or an

Our main objective in this project can be summarized as follows:
1. To build different portfolio of different types of investors, i.e from risk-averse to
aggressive investors, from short-term to long-term investors.
2. Simulate the optimized asset in a particular timeline.
3. Comparison of different optimization solvers in the financial modeling context.

II. Background information about investment concepts

Long and short positions
In general, investors can be categorized according to the position they hold: long or
short (Jacobs,1993).

Long position refers to an investor who buys an asset with an expectation that the price
of the asset will rise in the future, earning him a profit. This is the conventional way of
investing in the financial market.

Short position, on the other hand, is a more unorthodox type of investment. An investor
(lets call him Peter) might predict that the value of a particular asset class would
decrease in the future. Therefore, it will not make sense for Peter to buy the asset now,
only to see its value shrinking. There is, however, an arrangement to take advantage of
this situation; Peter could borrow the asset from another investor who already owns the
asset and he can sell the borrowed asset now, earning him a certain amount of money
(say $100,000). After a certain period has passed, as predicted by Peter, the value of the
asset has in fact really gone down (say, to $70,000). The reader might recall that the
initial $100,000 proceeds came from the sales of a borrowed asset. Naturally, Peter has
to return this borrowed asset to the due owner. Hence, Peter could buy the asset back
with a price of $70,000 and return it to the original owner. Effectively, Peter has just
earned himself a profit of $30,000 ($100,000 minus $70,000). This is really the idea
behind a short position.

Thus, in terms of profit-making approach, both positions (long and short) starkly
contrast with each other. These positioning strategies are important in portfolio
investment and in our optimization modeling project.

Risk and return
Different types of asset classes have their own unique potential-risk-and-potential-return
profiles. As a rule of thumb, the higher the potential return of a certain investment, the
higher the potential risk will be. In our study, we have defined potential return and
potential risk as follows:
Potential return is defined as the average historical return that a certain asset
has displayed over the years. For example, if a particular asset has historically
had a yearly return of 10%, 8%, 5%, and 12% in year 2009, 2010, 2011 and 2012
respectively (and assuming that this asset only began to exist in year 2009), we
will say that this asset will offer a potential return of 8.7% annually.
Potential risk is defined as the standard deviation of the historical return
distribution. The higher the standard deviation, the riskier the investment is
(Karacabey, 2007). This is because high standard deviation implies the lack of
stability of profits to be earned from a particular investment (Artzner et al, 1999).
To illustrate, asset A had yearly returns of 15%, 30%, -10%, 5%, and -20% over
the past 5 years and asset B had yearly returns of 4%, 5%, 4.5%, 6% and 5%. It
can be easily observed that asset B offers much more stability than asset A and
hence, asset B has a lower risk associated with it.

Leveraged portfolio
An investor can in practice borrow a certain amount of money from his broker to
leverage his portfolio (Fama, 1965). An example will best explain this concept. Lets
come back to Peter, our investor friend. Say, he has $1,000,000 to be invested at his
disposal. Upon doing the calculations, his portfolio is expected to return him 20%
annually. If Peter only uses his initial capital, his wealth is expected to grow to
$1,200,000 next year.

Here comes the interesting part. Supposing Peter borrow $500,000 from his broker (with
an interest rate of 5% annually), he would now have $1,500,000 to be invested and with
20% expected return, his investment is expected to grow to $1,800,000 next year. He
will then pay $525,000 back to the broker (with the 5% interest), leaving him with
$1,275,000. Peter has just successfully earned $75,000 additional profit from leveraging.

The caveat, however, is that if the portfolio unexpectedly becomes unprofitable, the
amount of losses that Peter will incur will be higher. In the example above, if the
portfolio loses 10% next year, Peters investments worth will decrease to $1,350,000
and he still needs to return the borrowed $525,000 with interest. After paying all of his
obligations, Peter will be left with $825,000 (versus his initial net worth of $1,000,000).

III. Typical Constraints in Investment Optimization Problem

1. Acceptable risk level: Covariance.
As explained above, standard deviation is an indicator of risk that is inherent in an
investment. As a part of risk management, investors typically set a maximum value to
indicate the risk level they are ready to embrace (Leyffer et al, 2005).

In order to calculate the overall standard deviation of the combined portfolio, it is not
sufficient to only consider each individual assets historical standard deviation alone.
This is because an assets behaviour might be correlated to the others. For example, the
price of gold and stocks tend to be negatively correlated; and the price of gold and silver
tend to be positively correlated.

Therefore, to calculate the overall standard deviation of the combined asset, covariance
) that reflects the correlations between any two assets must be introduced.
Covariance measures how much two variables change together. If the price of a stock
rises as the other falls, they are said to have negative covariance. Conversely, if the price
of two stocks rise or fall together, they are said to have positive covariance.
For example: From 25
July to 8
August, SPDR S&P 500 depreciated in value while a
Barclays Treasury Bond appreciated in value. Therefore, they are said to have a negative
correlation within that time span.

Figure 01: The graph showed that in the time spanning from 25
July to 8
August, the Portfolio
(SPY/SPDR S&P 500) has a negative correlation (i.e. negative covariance) with the Bond (IEF/
iShares Barclays 7-10 Year Treasury Bond Fund).

2. Maximum investment amount.
No investor has an infinite fund for investment. For portfolio planning, investors usually
state the amount they are going to spend for investment.

3. Positioning Constraint
When an investor can only adopt one position given a type of asset, i.e. if he goes short
for gold, he cannot go long for gold. The constraint only allows an investor to take either
one position or not to take any at all. This will be modeled using binary variables.



Price of IEF & SPY over 11 July 2011 to 8
August 2011
4. Piece-wise function of transaction cost:
Every time an investor makes an investment, the broker typically charges a transaction
cost. The transaction cost changes with the volume of transaction. At lower transaction
value, a fixed price is charged and at higher transaction value, a percentage value is
applied as the transaction cost (Konno, 1990).

In this project, the transaction cost used is illustrated by Figure 02, and is
mathematically described as the following piece-wise function:
) = 50, 0 < x
150, $5,000 < x
(0.5% x
), $20,000 < x
(0.4% x
), $100,000 < x

Figure 02: Plot of the Transaction Cost (in Dollars) versus Transaction Volume (in thousands of
Dollars) used in this project.

5. Upper and Lower Bound
Investors usually place upper and lower bound of the amount of money invested in
various assets of their portfolio. Lower bound is usually set at zero while upper bounds
will typically depend on the investors appetite of risk. For example, high-risk investors
generally have higher upper bound for risky investments while low risk investors will
have lower upper bound on the risky investment.

6. Regulation-T constraint
Although leveraged portfolio can potentially multiply the returns earned, excessive
leverage can prove detrimental (Mulvey, 1999). As such, various governments have
regulated the amount of leverage that an investor could incur. In the United States, this
is governed by Regulation T; which governs the extension of credit by securities
brokers and dealers in the United States. It controls the margin requirements for stocks
bought on margin. Essentially, Regulation T only allows 50% of the asset purchase to be
done on credit.

These constraints will be mathematically expressed in Model Development section
below. For the ease of perusal, the mathematical expression of the constraints to which
the optimizations model is subjected are numbered corresponding to the sequence of
discussion in this section.

IV. Model Development
: Expected rate of return of asset j.

: Covariance of asset j and asset k.
: Maximum amount invested in asset j.
M : Maximum investment amount.
: allowable level of risk (overall portfolios standard deviation.
: Expected rate of return of riskless asset
j : index of an asset type.

: Amount invested in a long asset j.
: Amount invested in a short asset j.
: cash balance.
: amount borrowed.
) : cost of purchasing x
b : Initial amount of cash in riskless asset (e.g. T-bill).

: Binary variable whether to go long (1) or not (0).

Sj :
Binary variable whether to go short (1) or not (0).
, d
, d
, d
4 :
Binary variable for determination of transaction cost function
Objective function

Maximize (expected total return total cost):

j = 1, 2, n

subject to:

1. Portfolios overall standard deviation

When j = k,
= 1 (i.e. covariance of the same asset is 1)

2. Sum of Investments

3. Piece-wise function of transaction cost.

To model the piecewise function mathematically, binary variables d
, d
, d
and d

are introduced:

4. Binary Variables Constraint


5. Upper and Lower Bound




6. Regulation-T constraint.

V. Methodology

The model will be solved in GAMS with four different solvers: CPLEX, GUROBI,
DICOPT and Couenne. CPLEX and GUROBI (MILP solvers) will solve the linearized
version of the model. DICOPT and Couenne will solve the original model, which is
mixed integer and nonlinear (MINLP solvers). This allows us to compare the linearized
model with the original nonlinear problem and also the performance between the
different solvers.

a. MILP solvers:
CPLEX: Cplex is a powerful Linear Programming (LP) and Mixed Integer
Programming (MIP) solver. For solving LP models, the following algorithms are used:
Primal Simplex algorithm
Dual Simplex algorithm
Network algorithm
Barrier algorithm
Sifting algorithm
CPLEX is a very stable and reliable LP solver and the default settings are almost always
sufficient to get an optimum solution with excellent solution time. However, the user
can also finetune the algorithm by changing the tuning parameters.

The MIP algorithm of CPLEX is an implementation of branch-and-bound search with
modern algorithmic features such as cuts and heuristics.

GUROBI: Gurobi solves LP problems using several alternate algorithms such as: dual
simplex algorithm, primal simplex algorithm etc. Gurobi solves MILP problem by
decomposing it into a series of LP sub-problems and then solve each sub-problem using
Branch and cut algorithm. Gurobi is currently the performance benchmark winner, as it
provides the fastest solving times. It exploits the modern multi core processors. The
disadvantage of Gurobi is the interface. It allows only the usage of restricted set of
functions, parameters and attributes, which can be accessed via the programming
languages C, C++, Java, .NET, Python or GAMS. Despite these restrictions its a
powerful solver.

b. MINLP solvers:
DICOPT: DICOPT program is used to solve mixed integer non-linear programming
that involves linear binary or integer variables and linear and non-linear continuous
variables. The program is based on the extensions of the outer-approximation algorithm
for the equity relaxation strategy. The MINLP algorithm inside DICOPT solves a series
of NLP and MIP sub-problems. These sub-problems can be solved using any NLP
(Nonlinear Programming) or MIP (Mixed Integer Programming) solver that runs under
Couenne: Couenne is a branch and bound algorithm to solve Mixed Integer Nonlinear
Programming (MINLP) problems. It aims at finding global optima of non-convex
MINLPs. It implements linearization, and branching methods within a branch and bound

VI. Future Works
The next steps of our project will mainly consist of five parts.

Firstly, we will process the historical prices of various asset classes in different period
and we will process the data to obtain the parameters needed for our optimization
analysis e.g., average historical return, average historical standard deviation,
covariance between any two assets, etc.

Secondly, we will attempt to introduce other constraints to make our model as realistic
as possible. For example, other risk measures such as Value at Risk (VaR) and
conditional Value at Risk (CvaR) will be introduced in our model, in addition to overall
standard deviation of the portfolio; so that the risk profile of the investment portfolio
could be accurately depicted (Uryasev,2000).

Thirdly, we will write the optimization programs and solve them using the
abovementioned solvers. Subsequently, we will compare and analyse the performance of
the different solvers to determine the suitability of these solvers for our particular

Fourthly, we will simulate our optimized portfolio in a particular timeline to test the
performance and robustness of our optimized assets.

Last but not least, we will also discuss about potential applications of our model outside
the realm of finance.

VII. References

Artzner, P., Delbaen, F., Eber, J. M., and Heath, D. (1999). Coherent measures of risk.
Mathematical Finance 9, 203228.
Elton, J.E. and Gruber, M.J. (1998), Modern Portfolio Theory and Investment Analysis
(6th edition), John Wiley & Sons, New York.
Fama, E. F. (1965), The Behavior of Stock-Market Prices, The Journal of Business,
38, No. 1, 34-105.
Jacobs, B. I., and Levy, K. N. (1993). Long/short equity investing. Journal of Portfolio
Man- agement 20, 5263.
Karacabey, A. A. (2007), Risk and Investment Opportunities in Portfolio
Optimization, European Journal of Finance and Banking Research, 1, No. 1.
Konno, H. (1990), Piecewise linear risk functions and portfolio optimization, Journal of
the Operations Research Society of Japan 33, 139156.
Leyffer, S., and Pang, J. S. (2005). On the global minimization of the value-at-risk.
Optimization Methods and Software 19, 611631.
Mulvey, J.M. (1999), Incorporating transaction costs in models for asset allocation. In:
Ziemba, W. et al., (eds.), Financial Optimization, Cambridge University Press, New
York pp. 243259.
Uryasev, S. (2000), Conditional Value-at-Risk: Optimization Algorithms and
Applications, Computational Intelligence for Financial Engineering, 49-57.
Yitzhaki, S. (1982). Stochastic dominance, mean variance and Ginis mean difference.
American Economic Review 72, 178185.