Professional Documents
Culture Documents
Project Supervisor:
Dr V.N.Sastry
Associate Professor, IDRBT
Submitted by:
JULY 2010
This is to certify that the Summer Internship project work entitled “Study of Portfolio
Optimization Models”, submitted for partial fulfilment of the requirements for the award of
the Integrated Degree of Master of Technology in Mathematics and Computing to the
Indian Institute of Technology Delhi is a record of bonafide project work carried out by Mr.
Chander Prakash Jumrani (Entry No. 2007MT50436) of third year at IDRBT (Institute
for Development and Research in Banking Technology), Hyderabad, for a period of 10 weeks
under my guidance during May-July 2010.
The subject matter embodied in the project report has not been submitted for the award
of any other degree or diploma.
V.N.Sastry
Associate Professor,
IDRBT,
Castle Hills, Masab Tank,
Hyderabad – 500 057.
e-mail: vnsastry@idrbt.ac.in
Abstract:
Portfolio Optimization is the technique of adjusting the ratio of securities in the portfolio to
meet ones needs in the best possible way. The objective of the project is to study the various
single objective and multi-objective based portfolio optimization models which includes:
These models were tested on a basic two stock and three stock portfolios and solved using
quadratic and goal programming techniques. The results were analysed and inference was
made.
The study also included the use of tools such as Solver in MS EXCEL and the Optimization
Toolbox in MATLAB to solve these optimization problems.
CONTENTS OF THE REPORT:
1. Introduction
4. References
INTRODUCTION
Optimization:
It refers to choosing the best element from some set of available alternatives. The decisions
are based on certain conditions that must be met.
Portfolio:
It is a set of investments held by an individual or an organization. It includes risky (stocks,
options and other derivative securities) as well as non -risky (bonds) assets.
Optimization of Portfolio:
It is technique of changing the ratio and quantity of assets present in a portfolio in order to
meet certain objective in the most optimal way. Objectives may include
• Risk Minimization
• Return Maximization
• Other objective includes liquidity, market dynamics etc.
These objectives and constraints may be linear or non-linear; accordingly we may get LPP or
Non-LPP. We have considered Quadratic Programming and Non-linear Multi-objective
portfolio optimization problems.
Chapter 1: Single objective portfolio optimization models
Markowitz Mean Variance Model also known as the Modern portfolio theory (MPT) is a
theory of investment which tries to maximize portfolio expected return for a given amount of
portfolio risk, or equivalently minimize risk for a given level of expected return, by carefully
choosing the proportions of various assets.
Markowitz portfolio shows that as we add assets to an investment portfolio the total risk of
that portfolio - as measured by the variance (or standard deviation) of total return - declines
continuously, but the expected return of the portfolio is a weighted average of the expected
returns of the individual assets. In other words, by investing in portfolios rather than in
individual assets, investors could lower the total risk of investing without sacrificing return.
The fundamental concept behind MPT is that the assets in an investment portfolio cannot be
selected individually, each on their own merits. Rather, it is important to consider how each
asset changes in price relative to how every other asset in the portfolio changes in price.
Investing is a tradeoff between risk and expected return. In general, assets with higher
expected returns are riskier. For a given amount of risk, MPT describes how to select a
portfolio with the highest possible expected return. Or, for a given expected return, MPT
explains how to select a portfolio with the lowest possible risk
MPT is therefore a form of diversification. Under certain assumptions and for
specific quantitative definitions of risk and return, MPT explains how to find the best possible
diversification strategy.
The Markowitz model is based on several assumptions concerning the behaviour of investors
and financial markets:
2. Variability about the possible values of return is used by investors to measure risk.
3. Investors care only about the means and variance of the returns of their portfolios
over a particular period.
4. Expected return and risk as used by investors are measured by the first two
moments of the probability distribution of returns-expected value and variance.
Throughout this chapter, investors are assumed to measure the level of return by
computing the expected value of the distribution, using the probability distribution of
expected returns for a portfolio. Risk is assumed to be measurable by the variability around
the expected value of the probability distribution of returns. The most accepted measures of
this variability are the variance and standard deviation.
Return
Given any set of risky assets and a set of weights that describe how the portfolio
investment is split, the general formula of expected return for n assets is:
n
E (rP ) = ∑ wi E ( ri ) (1)
i =1
Where:
n
∑w
i =1
i = 1.0;
The return computation is nothing more than finding the weighted average return of the
securities included in the portfolio.
Risk
The variance of a single security is the expected value of the sum of the squared
deviations from the mean, and the standard deviation is the square root of the variance. The
variance of a portfolio combination of securities is equal to the weighted average covariance
of the returns on its individual securities:
n n
Var ( rp ) = σ p2 = ∑∑ wi w j Cov ( ri , rj ) (2)
i =1 j =1
Covariance can also be expressed in terms of the correlation coefficient as follows:
where ρij = correlation coefficient between the rates of return on security i, ri , and the rates of
Therefore:
n n
Var ( rp ) = ∑∑ wi w j ρijσ iσ j (4)
i =1 j =1
Overall, the estimate of the mean return for each security is its average value in the
sample period; the estimate of variance is the average value of the squared deviations around
the sample average; the estimate of the covariance is the average value of the cross-product of
deviations.
THEORY:
Two risky asset portfolio means that we are limiting our portfolio to just two stocks say
A(µ 1, σ1) and B(µ 2, σ2).Let the mean and variance of the portfolio be (µ, σ) respectively.
Let us take w1 units of A and w2 units of B such that w1+ w2 = 1.
E ( rP ) = wA E ( rA ) + wB E ( rB ) (5)
It is calculated using the past data and determines the relationship between the two stocks and
its expected behaviors w.r.t the fluctuations in the market. We have
• -1< ƥ < 1
• ƥ< 0 => the stocks are negatively correlated i.e. the increase in the value of one causes
a decrease in the value of the other.
• ƥ>0 => the stocks are positively correlated i.e. the increase in the value of one causes a
increase in the value of the other.
Taking w2=s and w1=1- s and substituting in the equations of µ and σ, we get
µ = µ 1(1-s) + µ 2s …….(A)
Using the above relation and taking s as the parameter a graph is plotted showing the relation
between return and risk for two stocks and for different values of ƥ.
ρ = −1
Expected Return
asset B
ρ =0 ρ =1
0 < ρ <1
asset A
ρ = −1
0 Standard Deviation
Figure.1 Investment opportunity sets for asset A and asset B with various correlation coefficients
1. In Figure.1 the opportunity set with perfect positive correlation – is a straight line
through the component assets. No portfolio can be discarded as inefficient in this case,
and the choice among portfolios depends only on risk preference. Diversification in
the case of perfect positive correlation is not effective.
2. With any correlation coefficient less than 1.0( ρ < 1 ), there will be a diversification
effect, the portfolio standard deviation is less than the weighted average of the
standard deviations of the component securities. Therefore, there are benefits to
diversification whenever asset returns are less than perfectly correlated.
4. With perfect negative correlation, the benefits from diversification stretch to the limit.
Graph points to the proportions that will reduce the portfolio standard deviation all the
way to zero.
5. An investor can reduce portfolio risk simply by holding instruments which are not
perfectly correlated. In other words, investors can reduce their exposure to individual
asset risk by holding a diversified portfolio of assets. Diversification will allow for the
same portfolio return with reduced risk.
Every possible asset combination can be plotted in risk-return space, and the collection
of all such possible portfolios defines a region in this space. The line along the upper edge of
this region is known as the efficient frontier. Combinations along this line represent portfolios
(explicitly excluding the risk-free alternative) for which there is lowest risk for a given level
of return. Conversely, for a given amount of risk, the portfolio lying on the efficient frontier
represents the combination offering the best possible return. Mathematically the efficient
frontier is the intersection of the set of portfolios with minimum variance and the set of
portfolios with maximum return.
Figure2 shows investors the entire investment opportunity set, which is the set of all
attainable combinations of risk and return offered by portfolios formed by asset A and asset B
in differing proportions. The curve passing through A and B shows the risk-return
combinations of all the portfolios that can be formed by combining those two assets. Investors
desire portfolios that lie to the northwest in Figure X.2. These are portfolios with high
expected returns (toward the north of the figure) and low volatility (to the west).
Figure2 Investment opportunity set for asset A and asset B
the portfolio selection problem can be expressed as maximizing the return with respect to the
risk of the investment (or, alternatively, minimizing the risk with respect to a given return,
hold the return constant and solve for the weighting factors that minimize the variance).
For each chosen return and subject to wA + wB = 1, wA ≥ 0, wB ≥ 0 . The last two constraints
simply imply that the assets cannot be in short positions.
Table 1 The mimimum variance portfolio weight of two-assets portfolio without short selling
The correlation of two assets Weight of Asset A Weight of Asset B
σB σ A − 2σ B
ρ= 1 wA = wB =
σ A −σB σ A −σB
σB σA
ρ= -1 wA = wB =
σ A +σB σ A +σ B
σ2 σ 2 − 2σ 2
ρ= 0 wA = 2 B
wB = 2 A B
σ +σ 2
A B
σ +σ 2 A B
Above, we simply use two-risky-assets portfolio to calculate the minimum variance
portfolio weights. If we generalization to portfolios containing N assets, the minimum
portfolio weights can then be obtained by minimizing the Lagrange function C for portfolio
variance.
AIM: To find the optimal portfolio for two given stocks using the data for the last 10 days.
The market data for Aptech Ltd and TCS for the 10 days period is considered.
(Reference:
http://money.rediff.com/companies/aptech-ltd/13020130/bse/month
http://money.rediff.com/companies/tata-consultancy-services-ltd/13020033/bse/month)
Using the above data mean and variance are calculated as shown in the tables below.
TCS
µ=747.065
Similarly the mean and variance are calculated for Aptech as shown in the table below:
APTECH LTD
µ=137.37
The covariance between the stocks is calculated in the table shown below:
Covariance 120.26345
Correlation factor(ƥ) 0.93176
Correlation factor(ƥ)=0.93176
dσ2/ds=0
On Solving we get
s = (σ12- ƥ σ1 σ2)/( σ12+ σ22-2p σ1 σ2)
Short selling is the practice by which we can borrow the stocks and sell them in the market.
Thus in a way we hold a negative share of the stock.’
Substituting we get
s = 1.491
w1= - 0.491
w2= +1.491
µ = -292.421
σ 2=+15.327
w1=0
w2=1
µ=49.8911
σ 2=333.91312
Stock A(µ 1, σ1,w1) and B(µ 2, σ2, w2) Stock C(µ 3, σ3, w3)
Portfolio (µ, σ) and w1+w2+w3 = 1
We obtain the variance covariance matrix C3x3 whose diagonal elements are the variances and
the non-diagonal element (i , j) is the covariance between stock i and stock j.
Thus we have the equation
• µ= ∑ µ iwi
• σ2= wT C w
The market data for Aptech Ltd and TCS and Indian Oil for the past 10 days.
(Reference:
http://money.rediff.com/companies/aptech-ltd/13020130/bse/month
http://money.rediff.com/companies/tata-consultancy-services-ltd/13020033/bse/month)
TCS Aptech Ltd Indian Oil Ltd
Day 1 10th May 769.7 146.65 302.05
Day 2 11th May 755.2 144.15 300.65
Day 3 12th May 758.4 142.45 301.15
Day 4 13th May 765.75 144.05 301.9
Day 5 14th May 768.45 141.25 306.5
Day 6 17th May 744.85 134.6 317.65
Day 7 18th May 737.85 135.35 316.45
Day 8 19th May 721.15 131.85 312.75
Day 9 20th May 730.1 128.95 325.25
Day 10 21st May 719.2 124.4 330.25
The graphs of TCS and Aptech have already been in the two stock problems. The graph of
Indian Oil is shown below
INDIAN OIL
TCS
As calculated in the two stock model we have
µ1=747.065
σ1=18.27329
APTECH LTD
As calculated in the two stock model we have
µ2=49.8911
σ2=7.063363
INDIAN OIL
The calculation of mean and variance are shown in the table below:
µ=137.37
µ3=747.065
σ3=18.27329
Calculation of the COVARIANCE between the stocks
From the above table we obtain the following variance covariance matrix:
min wtCw
s.t w1+w2+w3 = 1
Case2: If we desire a fixed expected return say µ we have an additional constraint and the the
programming problem becomes
min wtCw
s.t w1+w2+w3 = 1
µ= ∑ µiwi
This quadratic programming problem could be solved using the methods for quadratic
optimization such as the Lagrange’s method or the wolves or Bill’s method or by using the
Optimization toolbox in MATLAB.
We use the quadprog function to solve the given QPP.
Equation
H, A, and Aeq are matrices, and f, b, beq, lb, ub, and x are vectors.
Syntax
x=quadprog(H,f,A,b,Aeq,beq,lb,ub)
defines a set of lower and upper bounds on the design variables, x, so that the solution is in
the range lb ≤ x ≤ ub. If no equalities exist, set Aeq = [ ] and beq = [ ].
Solving Case1:
Matlab code:
clc;
clear all;
C=[333.913 120.2635 -155.315;120.2635 49.8911 -69.0262;-155.315 -69.0262 103.5804]
A1=[1 1 1];
b1=[1];
x=quadprog(C,[ ],[ ],[ ],A1,b1,[0 0 0],[1,1,1]);
x
Output:
Thus we have
w1=0
w2=0.5921
w3=0.4079
Risk σ = wtCw
Thus µ = 156.5893
Conclusion: Thus we have using the above ratio of stock (no short selling) the expected
return as 156.5893 with a min risk of 1.3828.
Solving Case 2: Assuming that we desire a fixed µ= 500 .It is solved using MATLAB and the
solution comes out to be w1= 0.4328,w2=0,w3=0.5672 and the minimum risk comes out to be
σ =4.429 and µ= 500.
n n
Min σ 2p = ∑∑ wi w j ρijσ iσ j
i =1 j =1
Subject to w1 + w2 + ... + wN = 1
n n
n
C = ∑∑ wi w j Cov ( ri rj ) + λ1 1 − ∑ Wi
i =1 j =1 i =1
in which λ1 are the Lagrange multipliers, respectively, ρij is the correlation coefficient between
By using this approach the minimum variance can be computed for any given level of
expected portfolio return (subject to the other constraint that the weights sum to one).
One of the goals of portfolio analysis is minimizing the risk or variance of the portfolio.
Previous section introduce the calculation of minimum variance portfolio, we minimum the
variance of portfolio subject to the portfolio weights’ summing to one. If we add a condition
into the equation we can get the optimal risky portfolio.
n n
Min σ p2 = ∑∑ WW
i j ρijσ iσ j
i =1 j =1
n
Subject to ∑W E ( R ) = E
i =1
i i
*
, where E * is the target expected return and
∑W i =1
i = 1.0
The first constraint simply says that the expected return on the portfolio should equal the
target return determined by the portfolio manager. The second constraint says that the weights
of the securities invested in the portfolio must sum to one.
n n
n
n
C = ∑∑ wi w j Cov ( ri rj ) + λ1 E * − ∑ wi E ( ri ) + λ2 1 − ∑ wi
i =1 j =1 i =1 i =1
Taking the partial derivatives of this equation with respect to each of the
variables, w1 , w2 ,...., wN , λ1 , λ2 and setting the resulting equations equal to zero yields the
minimization of risk subject to the Lagrangian constraints. Then, we can solve the weights
and these weights are represented optimal risky portfolio by using of matrix algebra.
n
If there no short selling constraint in the portfolio analysis, second constraint, ∑ w = 1.0 ,
i =1
i
n
should substitute to ∑ wi = 1.0 , where the absolute value of the weights wi allows for a
i =1
given wi to be negative (sold short) but maintains the requirement that all funds are invested or
their sum equals one.
n n
n
n
C = ∑∑ wi w j Cov ( ri rj ) + λ1 E * − ∑ wi E ( ri ) + λ2 1 − ∑ wi
i =1 j =1 i =1 i =1
wi ≥ 0, i = 1,K , N
The addition of this non-negativity constraint precludes negative values for the weights
(that is, no short selling). The problem now is a quadratic programming problem similar to the
ones solved so far, except that the optimal portfolio may fall in an unfeasible region. In this
circumstance the next best optimal portfolio is elected that meets all of the constraints.
Using the above method we get an equations with n+1 variables which has been solved and
we get the results
σ opt2= woptT C w
General market portfolios consist of risky as well as non-risky assets (also called risk-free
asset). The introduction of a risk free security to the Markowitz model changes the efficient
frontier from a curved line to a straight line called the Capital Market Line (CML). This CML
represents the allocation of capital between risk free securities and risky securities for all
investors combined.
The optimal portfolio for an investor is the point where the new CML is tangent to the old
efficient frontier when only risky securities were graphed. This optimal portfolio is normally
known as the market portfolio.
The points on the Capital market Line(CML) represents the optimal portfolio points. The
points of the left are low risk and low return points and the points to the right are high risk and
high return points. To choose between these points we use the concept of indifference curves.
INDIFFERENCE CURVES
One of the factors to consider when selecting the optimal portfolio for a particular investor is
degree of risk aversion, investor’s willingness to trade off risk against expected return. This
level of aversion to risk can be characterized by defining the investor’s indifference curve,
consisting of the family of risk/return pairs defining the trade-off between the expected return
and the risk. It establishes the increment in return that a particular investor will require in
order to make an increment in risk worthwhile. The optimal portfolio along the efficient
frontier is not unique with this model and depends upon the risk/return trade off utility
function of each investor.
• All portfolios that lie on the same indifference curve are equally desirable to the
investor (even though they have different expected returns and variance.).
• An investor will find any portfolio that is lying on an indifference curve that is "further
northwest" to be more desirable than any portfolio lying on an indifference curve that
is "not as far northwest."
• Thus using these indifference curves of different investors we could find the optimal
portfolio as the point that lies on the capital market line and is tangent to the
indifference curve
β, Beta, is the measure of asset sensitivity to a movement in the overall market. Beta is
usually found via regression on historical data:
βk=Cov(rk,rm)/Var(rm) …….(d)
where rk and rm are rate of return of the kth
asset and the market respectively
• Markowitz Model has certain assumption which is not applicable to the practical
world. Some of these assumptions are
• The Markowitz Model considers only single objective i.e. either risk minimization or
profit maximization whereas in real world we need to satisfy both contradicting
objectives simultaneously with certain priority levels.
• Also the market securities rates follow a stochastic behavior which cannot be captured
by the deterministic Markowitz mean variance model.
Chapter 2: Multiple objective portfolio optimization
In such cases we come across solutions which may be optimal in one of the objectives but not
necessarily the optimal solutions. For example in a maximization problem (two objectives
case) we come across solutions as (2,3) and (3,2) which are optimal in one of the objectives
.We cannot say which one is better solutions or there may exist another solution which is
better than these two .These solutions which are optimal is some of the objectives are called
pareto-optimal solutions. But our objective is to find the global optimal solution. Thus to
solve such optimization problems we use techniques such as weighted objectives , goal
programming, stochastic programming etc. In all the methods to solve the multi-objective
optimization problem we first convert it into a single objective programming problem.
n
v v
Minimize F ( x ) = ∑ ai f i ( x ) , ai > 0, i = 1, 2,K , n
i =1
Since investors are interested in minimizing risk and maximizing expected return at the same
time, the portfolio optimization problem can be treated as a multi-objective optimization
problem (Model 5). One can attain Pareto optimality in this case because the formulation of
Model 5 belongs to the category of convex vector optimization, which guarantees that any
local optimum is a global optimum.
Objective Function: Minimizes the sum of the weighted deviations from the target values .
Previously Two stock model of TCS and Indian Oil using the Markowitz risk minimization
model had been solved to obtain the solution µ opt=348.934 and σopt=3.74.
We solve the same example now using the goal programming approach
Problem: Suppose the investor is willing to take more risk in order to get higher return. So he
sets the goal/objectives
• the expected return to be at least 500
• the risk(σ) involved to be less than 5.
Also he assigns priorities to these goals in the ratio 2:1.
Aim: To formulate the goal programming model and to solve it to find optimal expected
return and risk.
SOLUTION:
Step1: Variables: w1= # of units of TCS
w2= # of units of Indian Oil Ltd
Step2: Constraints: w1+w2=1
Step3: Goals:
1. µ 1w1+ µ 2w2 >= 500 Priority=2
2. σ1 w12++
2
σ22w22+2ƥσ1 σ2w1w2 <= 25 Priority=1
Step4: To write the goal inequalities in the equation form with positive and negative
deviations from the goal
µ 1w1+ µ 2w2 + z1- - z1+= 500
σ12w12++ σ22w22+2ƥσ1 σ2w1w2 + z2- - z2+ = 25
Step5: Determine the variables that need to be minimized in the objective function.
Looking at the goal we see that we want z1- and z2+ to be as small as possible.
Step6: Modeling the problem with priorities in the objective function
Min 2z1- + z2+
s.to w1+w2=1
µ 1w1+ µ 2w2 + z1- - z1+ = 500
σ12w12++ σ22w22+2ƥσ1 σ2w1w2 + z2- - z2+ = 25
w1,w2,z1- , z1+, z2- , z2+ >=0
This is now a single objective quadratic programming problem and has been solved using
solver in excel sheet (see excelsheet3.1.)
CONCLUSIONS:
• µ > max(µ 1, µ 2) cannot be achieved . In this case µ>747.065 is not feasible.
• σ is always less than the min (σ1, σ2) . It shows that diversification of portfolio
minimizes risk involved.
• If we desire a lower expected return we get values close to the optimal value as
calculated in Markowitz model.
The analysis done in this project was restricted to prediction of the future through regression
of the past data. But in real world scenario the stocks rates are stochastic and non-
deterministic. It follows a certain probability distribution which is called a geometric
Brownian motion. Thus we could extend portfolio optimization problem to stochastic
programming .It is more realistic approach.
In stochastic programming some or all of the variable or constraints are non-deterministic but
their distributions are known. We convert this to a deterministic programming problem by
taking a threshold value < 1 and converting the constraint into to their respected probabilistic
value to be greater than the threshold values.
AKNOWLEDGEMENT
First and foremost, I would like to thank to our supervisor of this project Dr. V.N.Sastry for
the valuable guidance and advice. He inspired me greatly to work in this project. I would also
like to thank the authority of IDRBT for providing me this is opportunity and providing a
good environment and facilities to complete this project. I would also like to thank the
authority of IIT Delhi for allowing me to pursue a two month summer internship at IDRBT.
REFERENCES
Books:
Operations Research Introduction 8th Edition Hamdy.A.Taha Pearson Publication
Numerical Optimization S.Chandra and Aparna Mehra 1st Edition Narosa Publication
Roman, Steven, Introduction to the Mathematics of Finance: From Risk Management to
Options Pricing. Springer 1 Edition, 2004
Benninga Simon, 1999, Financial Modeling, The MIT press, Combridge, Massachusetts,
London, England 1999.
Cerbone, Duong., and Noe, Tomayko. Multi-objective Optimum Design. Azarm, 1996.
Bodie Z., A. Kane ,and A. J. Marcus, 2003, Essentials of Investment, Fifth edition, McGraw-
Hill.
Bodie Z., A. Kane ,and A. J. Marcus, 2005, Investment, Sixth edition, McGraw-Hill.
Brandimarte Paolo, Numerical Methods in Finance: A MATLAB-Based Introduction, New
York:John Wiley & Sons. Inc.
Cheng F. Lee, Joseph E. Finnerty, Donals H. Wort ,1990, Security Analysis and Portfolio
Management John Wiley & Sons. Inc.
Internet: http://www.wikepedia.org
http://www.money.rediff.com