DSE Price Updates

                              TOL 330.00     TBL 1,800.00     TTP 510.00     TCC 1,640.00     SIMBA 1,780.00     SWISSPORT 650.00     TWIGA 1,340.00 -20.00     NICOL 305.00     DCB 360.00     KA 1,500.00     EABL 2,000.00     JHL 5,860.00    
LAST UPDATE: 24/9/2008 - 5:58PM EAT

Tuesday, August 12, 2008

Portfolio Optimization

One of the most basic traits of (rational) human beings is that we always tend to look for the maximum possible reward we can attain, whilst maximizing whatever risks involved in all our endeavors. The same is certainly true when it comes to the world of finance and investments.

Portfolio Optimization is the part of investment analysis that deals with the problem of selecting investment holdings so as to get the maximal return for a given risk that an investor is willing to incur; or conversely, it is the problem of finding getting the minimal risk in order to guarantee a certain expected1 return. The main problem that investment analysts face is, how do we measure risk.

Economist/Mathematician Harry Markowitz, one of the pioneers of Modern Portfolio Theory, modelled risk of a given asset2 as the standard deviation/variance, σ; in his work in his 1952 paper, "Portfolio Selection".
In Markowitz's Model, the investor has a selection of n risky assets (usually stocks), each with expected return μi and standard deviation σi; i = 1,2,...,n., and one non-risky asset (usually a bond) with expected return μn+1 and standard deviation σn+1 ≡ 0. (i.e., zero-risk). The Portfolio Selection Problem involves allocating a proportion xi ≥ 0 of an investors wealth to the i-th asset (i = 1,2,...,n+1). Clearly Σxi = 1, ⇒ xi ≤ 1, ∀ i.
Our aim is to simultaneously maximize total return, μ = Σ μixi and minimize the total risk σ = Σ Σ σijxixj. Here σij denotes the covariance between asset i and j, and σii = σi2, i.e. the variance (the square of the standard deviation); subject to constraints {Σxi = 1, 0 ≤ xi ≤ 1}. Other constraints may be added, for instance lower bounds li and/or upper bounds ui to all or some of the xi (other than, but not contradicting the trivial bounds 0 and 1); however the objective and constraints given above define a plausible portfolio optimization problem.
NB: The simultaneous maximization and minimization is attained by setting the objective function to f(x) = ½ σ - t μ [where x = (x1, x2, ..., xn, xn+1)]. The objective may also be modified to include transaction costs. t ∈ [0, +∞) is the risk tolerance factor, which is the inverse of the risk aversion factor, λ.
The analysis above is called Mean-Variance analysis.

This is a quadratic programming (QP) problem which does have a minimum since the covariance matrix is positive definite. Current research amongst quantitative analysts is centered around devising specialized QP algorithm for various special cases to guarantee fast and efficient computation. Professor Michael Best of University of Waterloo deals with such kind of research. I took a Portfolio Optimization course with him. Other research is concerned with calculation of t, which is linked to choices of the utility function.

Markowitz's results are highly celebrated and they form the basis of Modern Portfolio Theory. The results are also connected with such concepts like the Efficient Frontier (which is the "best" portfolio one can hold under Markowitz's Model); as well as other concepts like Sharpe ratio; Carpital Marekt Line (CML) and The Market Portfolio; Capital Asset Pricing Model (CAPM).

However, there are some shortcomings to the Quadratic (Markowitz) Model; one being that a more natural way for a layman investor to define risk is not through variance, but rather through other measures such as Value at Risk, VaR. i.e., roughly speaking, an investor usually wants to know, what is the probability of incurring a loss of a fraction α of my investment , for a given portfolio that I chose (say I chose to put TZS 3m in TBL shares, 2m in TCC shares and 5m in 182-day T-Bill). VaR analysis is well researched and there are numerous papers online; and it is a newer concept and more of an in-thing in Quantitative Analysis and Financial Engineering as opposed to Mean-Variance Analysis.

VaR analysis is used not just in investment theory, but also in other areas of economics as well as operations research, management science and project analysis for engineers. The Mathematical analysis of Portfolio Optimization using VaR is a bit more technical than Mean-Variance Analysis and it involves some sophisticated concepts in Convex Analysis and Nonlinear Programming. A not-too-technical presentation can be found here (pdf) or in Power point here. It is from a talk I gave in the research skills seminar at Waterloo. It is based on Rockefeller and Ursayev (1999). The talk was aimed at an audience full of Mathematicians, however only basic points and just sketches of proofs are given so as to ease understanding.

1. Here expected means the Expected value in probability sense, i.e., the mean value
2. Asset means financial asset, e.g. stock, bond, etc.

This article is aimed at helping people not familiar with Quantitative Analysis, and particularly Portfolio Optimization to get a gist of the kind of stuff Quants do. I promise more articles to come. I welcome any questions and comments
-Nalitolela, P. S.


Anonymous said...

Peter, sio mchezo.
In a real world PhD guys are always stack in the back office cranch some numbers. Some of these formular works, but some doesn't. Most of the old theories doesn't works in our time. Reason behind is globalization and correlation between indexes. For the past months Asia index had positive correlation with US indexes. These shows how the mkt has become unpredictable...

Theories like Blackshoe Model which were common to eveluates derivatives in past doesn't provides optmal return in age.

I think guys like you peter, can develop new models which works in our generation. People with IT &Mathematics background are hot cake in this financial world.

Mdau I

Nalitolela, P. S. said...

Thanks Mdau #1,
It's true that Quantitative Models, just like empirical models are not fail-safe. The most fundamental problem is that a lot of Quantitative Models rely on a lot of assumptions in regards to behavioral economics and such concepts like rational choice theory; which time and time again we have come to learn that humans are not always perfectly rational. Moreover you always have to rely on other factors such as politics and current world issue, investor confidence (or lack thereof) in one market or another may render the Mathematical models totally useless at times.

The failure in these models therefore is not necessarily a matter of changing times. I do agree a paradigm shift in fundamental analysis may at times mean some models won't be as useful anymore. However analysts should not be reduced to just plugging numbers into the computers and let the algorithms do the work. Naturally, as a mathematician I do love Mathematical Models and I will always defend them. But I am trying to point out that a slight change in the state of the market means a change in the inputs for the model and this may result in a major change in the optimal solution.
There is always a lot of research put into developing new models. Financial Engineering/Quantitative Analysis is one of the hottest and fastest growing fields in todays world. Mathematicians, Physicists, Computer Scientists, Engineers are increasingly getting involved in developing new models. So don't worry, in corporation with experts from industry, things are always improving.

It is a challenge to myself and fellow African scholars and professionals to develop models that are more relevant to young markets like Tanzania.
By the way, the author of green book in the pic is my MSc supervisor, Prof. Nikolai Dokuchaev. And the red book is by Wilmott; one of the industry leaders in Financial Engineering. That book was used in my introductory course to Financial Mathematics during my undergraduate studies.

Anonymous said...

...but when it comes to real world of investment, sophisticated mathematical models give way to common sense and gut feelings!! Mathematical models are good for a managed, laboratory-like situation where certain variables are held constant in order to get a certain results. Such models are well suited for academic pursuits!! It is very difficult to model how the human being will behave.

One of the great mathematician (I. Newton) could not translate his geniuses into the stock market, thus suffered losses!! As recent as 1998, LTCM threatened to bring the US financial markets to the ground by fancy trading style, despite of being headed by experts (some nobel laurates). 'Formula trading' is argued to be one of the cause of 1987 US stock market crash!! I think you have all witnessed how various risk management technique (VaR included) failed to protect positions of large investment banks during the ongoing credit crisis!!

That is why the world's successful investor (and the richest person on the globe at the moment) once quipped that you only need to master the basic arithmetics: addition, substruction, multiplication, and division!

However, if you are looking for academic credentials, you must be ready go through such mathematical models.

One thing I want to be clear though is: are postings on this blog aimed for technical discussion, or just general discussion??

Anyway, to cut a long story short, master these models, but walk to the market place with larger share of common sense, although one author once said "...unfortunately common sense is always uncommon". Na hakuna shule ya common sense!!

Nalitolela, P. S. said...

I will give you 1 thing, my undergrad Prof who got me into Finance told me a story about when he was doing his PhD at University of Toronto, he audited this one class that was specific to the Master of Mathematical Finance and U of T business students. Now he says during that class, the Prof. decided to have a little fan and engaged the students in a stock trading and investment virtual competition where everyone started with the same capital, and at the end of the semester they saw who made more money. The virtual stock exchange used real time data from the real world TSX. At the end of the day, it was the Business guys with minimal math skills; most of them season traders who did well!!

Nalitolela, P. S. said...

oh, the discussions here are not aimed to be technical; they are aimed at the general audience. However sometimes it is hard to completely avoid throwing a bit of technical language in there to get the point across. Hopefully the audience have at least some basic knowledge to help them grasp the concepts.

My hope is that we will get more authors from disparate backgrounds so that we can all learn different perspectives, different schools of thoughts. So opportunity to call out for interested parties to become authors, again!!
By the way, the discussions are not just limited to finance and investments. The topic could come from any area in Economics as well!!

Anonymous said...

Peter, kwa siku chache nimekuwa busy kidogo, and not laizy. But unajua tupo kwenye new quarter and earning za quarter ya pili zipo out and white people as usual wanatufanyisha kazi kama wehu.

I do respect all models out there, when i was undergrad, we went through all this quantitaves Models. From DVM to some other crazy analyst who i never heard about. However, at the end of the day when i was in the cubicle execute some real buying and selling i fugured out its not about models. It always goes beyond those model, it came to smartness, analytical and full of GOD miracle.

I remember my first bid, i was wanna short crude oil. That moment the crude was around $75, the reason why i was wanna do that was because of some commodities modelist idea. However, in big execution strategy no one going to trust anyone ideas, unless they're solid. So, luckly enough i didnt execute the deal. Also, the gas shoot all the way to the roof.

When to buy, when to sell, and when to hold depends on everything out there and GOD miracle play big part

Mdau # 1.