Paul Cox CQF Final Project with MatLab code

31
PORTFOLIO CONSTRUCTION USING THE BLACK-LITTERMAN MODEL: AN ANALYSIS OF THE I VYBYTES RECOMMENDED PORTFOLIO Paul Cox CQF FINAL PROJECT

Transcript of Paul Cox CQF Final Project with MatLab code

Page 1: Paul Cox CQF Final Project with MatLab code

PORTFOLIO CONSTRUCTION USING

THE BLACK-LITTERMAN MODEL:

AN ANALYSIS OF THE IVYBYTES

RECOMMENDED PORTFOLIO

Paul Cox

CQF FINAL PROJECT

Page 2: Paul Cox CQF Final Project with MatLab code

Abstract This paper demonstrates the Black-Litterman approach to creating

stable, mean-variance efficient portfolios that incorporate analyst

views into portfolio optimization. The diverse, multi asset class

portfolio recommended in the IvyBytes guide to investing will form

the basis of a prior and expected posterior returns will be estimated

based on sensible views.

Introduction

Black-Litterman’s asset allocation model overcomes many of the shortcomings of

the classic Markowitz model where optimal asset allocations are not well behaved. This

paper demonstrates the Black-Litterman framework for incorporating analyst views into

portfolio construction by looking at a very specific portfolio. The portfolio examined is

the diverse group of assets recommended to beginning investors in the IvyBytes Guide

to investing. Mean-variance analysis based on sample estimates alone is shown to

have little value, leading to corner solutions in optimization where portfolios are highly

concentrated and change wildly based on small changes to inputs. Following the

methods outlined by BL a suitable prior is developed using robust inputs - exponential

smoothing of returns and reverse optimization using global market index weights to

estimate market equilibrium returns. Optimizations with respect to indices of satisfaction

will also be considered. Plausible views regarding investment opportunities are

constructed and incorporated into reasonable looking portfolios.

IvyBytes Guide

IvyBytes is a start-up company that allows authors to self-publish concise and

accessible guides on topics in which they have expertise. Founded in 2011 by Alex Frey

Page 3: Paul Cox CQF Final Project with MatLab code

of Harvard, IvyBytes seeks to provide unbiased information about important topics

which may be surrounded by contradictory advice. In “A Beginner’s Guide to

Investing: How to Grow Your Money the Smart and Easy Way – An IvyBytes Guide” Frey

attempts to filter though the noise of much of the investment advice that is already out

there. The book goes further than most investment books in that a specific portfolio -

complete with ticker symbols and portfolio weights - is recommended.

The IvyBytes guide to investing is a good book for beginners. Basic investing for

retirement concepts are covered including: the power of compound interest,

explanation of stocks and bonds in terms of ownership vs. lending and the concepts of

alpha returns vs. beta returns. Diversification of assets beyond simply owning a

diversified portfolio of U.S. stocks is encouraged and the diverse global mix of asset

classes used by managers of Ivy League endowments is examined. ETF’s are discussed

and the following diversified one-stop portfolio is ultimately recommended.

Asset Class Weight Ticker

U.S. Stocks 25% VTI

International stocks

(developed markets) 14% VEA

Emerging Markets

stocks 14% VWO

U.S. Real Estate 9% VNQ

Foreign Real Estate 7% VNQI

TIPS 12% TIP

Commodities 6% DBC

U.S. Total Bond

Market 7% BND

Gold 6% GLD

Table 1. IvyBytes recommended portfolio. Source: A Beginner’s Guide to Investing by

Alex Frey, Table 6.

This IvyBytes recommended portfolio will be our focus.

Page 4: Paul Cox CQF Final Project with MatLab code

The Data and Mean-Variance

Data for each of the nine asset classes are shown in Figure 1. Specifically, daily

adjusted close prices from May 30, 2011 through May 29, 2015 are plotted. The MatLab

code for these time series plots is in the ‘Paul_Cox_CQF_Project_fts_plots.m’ file.

Figure 1. Daily adjusted close prices for each of the nine asset classes in the IvyBytes

recommended portfolio – 5/30/11-5/29/15. Source: Yahoo Finance.

Putting aside the IvyBytes recommended weights for a moment, let us consider

the portfolio selection problem among these nine risky assets using the mean-variance

optimization criterion first proposed by Markowitz. In this case the portfolio optimization

is defined as the following minimization problem:

min�

12�

�Σ�

A. C.

��D = F

Page 5: Paul Cox CQF Final Project with MatLab code

퉐ҫ

And,

��� = 1

Where µ is the vector of asset expected returns, w is the vector of weights and Σ

is the covariance matrix obtained by pre and post multiplying the correlation matrix by

the diagonal standard deviation matrix. This minimizes the variance of the portfolio

(scaled by ½) subject to a return objective, m and the budget equation where the sum

of all weights must equal 1. At this point there is no risk-free asset and all our wealth

must be fully invested in a combination of the 9 assets. This is a minimization problem

with equality constraints and we can solve it by using the method of Lagrange:

���, �, �� = 12��Σ� + ��F − ��D� + ��1 − ����

Solving for the first-order condition and noting that the second-order condition is

the covariance matrix which is positive definite we get w*, the optimal weight vector:

���� ��, �, �� = Σ� − �D − �� = 0

�∗ =Σ����D + ���

In the problem at hand, Σ-1 ≈

314.8569

-129.786 -36.4128 -78.4726 4.334775 49.18255 -20.4729 114.1341 18.31203

-129.786 243.4848 -29.4895 8.587049 -110.034 6.197318 -7.26272 48.25263 -9.69668

-36.4128 -29.4895 120.0844 -1.91062 -68.592 5.304265 -10.4257 -33.8259 -5.4227

-78.4726 8.587049 -1.91062 90.95625 -24.7135 -0.37697 5.985156 -102.038 0.216958

4.334775 -110.034 -68.592 -24.7135 228.0567 -37.9958 0.455646 16.81511 2.356732

49.18255 6.197318 5.304265 -0.37697 -37.9958 940.5886 -33.0412 -1266.79 -14.6392

-20.4729 -7.26272 -10.4257 5.985156 0.455646 -33.0412 82.41821 69.34746 -22.6943

114.1341 48.25263 -33.8259 -102.038 16.81511 -1266.79 69.34746 2993.343 -41.648

18.31203 -9.69668 -5.4227 0.216958 2.356732 -14.6392 -22.6943 -41.648 41.26716

Page 6: Paul Cox CQF Final Project with MatLab code

ψ

And µ ≈

0.131373

0.05051

-0.01117

0.096225

0.063823

0.024071

-0.13384

0.029942

-0.06779

where the vector of returns is in the same order as Table 1.

Now we need to find λ and γ. We can express the constraints as:

D�� = F

1�� = 1

Substituting w* into these constraints:

D′Σ����D + ��� = �D�Σ��D + �D�Σ��� = F

�′Σ����D + ��� = ���Σ��D + ���Σ��� = 1

Defining the scalars A, B, and C for convenience:

= �′Σ���

! = D′Σ���

" = D′Σ��D

And are equal to:

Page 7: Paul Cox CQF Final Project with MatLab code

�ϋ

The constraint equations become:

"� + !� = F

!� + � = 1

Then, solving for λ and γ:

� = F − ! " −!#

� = " − !F " −!#

Substituting these values back in to the equation for w* we can define the risk

minimizing portfolio for a given level of return. The MatLab code for this base case

mean-variance optimization in the ‘Paul_Cox_CQF_Project_Part_1.m’ file. Figure 2

graphs the efficient frontier for the nine risky asset classes in the IvyBytes portfolio (curve

in red).

Page 8: Paul Cox CQF Final Project with MatLab code

堊ω

Figure 2. Markowitz analysis of IvyBytes recommended portfolio.

Figure 2 also pinpoints the global minimum variance portfolio. The global

minimum variance portfolio is obtained by solving the unconstrained problem:

min$

%&#�F�

where %&# expressed as a function of m is:

%&# = F2 − 2!F + "

" − !2

Solving for the first-order condition we get:

'%(2�F�'F =2 F − 2!

" − !# = 0

Efficient

Frontier

for 9 risky

assets

Global Minimum Variance Portfolio

Capital

Market

Line

Tangency Portfolio

Page 9: Paul Cox CQF Final Project with MatLab code

And solving for m we get:

F) =!

where mg is a minimum given that the second-order condition is positive (2A/(AC-B2)>0)

specifically, in our IvyBytes problem mg ≈ 0.039475. Knowing mg we can solve for the

vector of weights in the global minimum variance portfolio as:

�) =���

And for the IvyBytes analysis, wg ≈

0.148923

0.012797

-0.03835

-0.06431

0.006751

-0.22216

0.040637

1.135892

-0.02019

For the variance,

%)# =1

Giving a standard deviation of σg ≈ 0.02514 for the global minimum variance portfolio.

This point is shown by the blue asterisk in Figure 1.

Taking into account borrowing and lending at the risk-free rate the optimization

problem becomes:

min�

12�

�Σ�

Subject to:

* + ���D − *�� = F

Page 10: Paul Cox CQF Final Project with MatLab code

ϊ

Any wealth that is not invested in the risky assets will be invested in the risk-free

asset. The Lagrangian for this problem is:

���, �, �� = 12��Σ� + ��F − * − ���D − *���

Solving for the first-order condition by taking the derivative with respect to the

vector w we can solve for the optimal weight vector w*:

���� = Σ� − ��D − *�� = 0

�∗ =λΣ���D − *��

Plugging this equation into the constraint we get:

� = F − *�μ − *��′Σ���μ − *��

Finally we get the equation for w*:

�∗ = �F − *�Σ���μ − *���μ − *��′Σ���μ − *��

This equation along with the risk-free rate traces out the Capital Market Line

(shown in blue in Figure 1) for various levels of returns. The CML is drawn from the risk-

free rate on the y-axis through the Tangency Portfolio on the efficient frontier. In the

Markowitz paradigm all investors hold a combination of the risk-free asset and the

tangency portfolio. In this analysis the risk-free rate is assumed to be the average of the

five year Treasury note rate over the same period (5/30/11 – 5/29/15). In this IvyBytes

analysis the risk-free rate r ≈ 0.0120224. The vector of weights in the tangency portfolio

wt is given by:

�- =Σ−1�μ − *��! − *

Where wt for the IvyBytes problem is, wt ≈

Page 11: Paul Cox CQF Final Project with MatLab code

σ

0.718318 VTI

-0.17583 VEA

-0.24327 VWO

-0.12282 VNQ

0.165604 VNQI

-0.03208 TIP

-0.26055 DBC

0.923641 BND

0.026987 GLD

The mean and standard deviation of this portfolio are given by:

D- = ��D = " − !*! − * ≈ 0.1469

And,

%- = 2�′-Σ�- ≈ 0.055715

Taking a closer look at these weights we see that the optimal portfolio is

unintuitive and somewhat of a corner solution. In this example where short selling is

allowed the optimization is heavily long U.S. stocks and U.S. Bonds and (with the

exception of some minor holdings in foreign real estate and gold) this optimum portfolio

sells short every other asset class to do it. If we impose a restriction on short-selling the

optimal frontier reduces to holding only some combination of U.S. stocks and U.S. bonds

and has zero weights in the remaining 7 asset classes as shown in Figure 3 below.

Page 12: Paul Cox CQF Final Project with MatLab code

Figure 3. Composition of optimal IvyBytes recommended portfolio with no short-selling.

Clearly the Markowitz asset allocations are not well behaved.

Black-Litterman

“How can we make the standard portfolio optimizer better

behaved?” - Litterman1

1 Modern Investment Management – An Equilibrium Approach by Bob Litterman and the

Quantitative Resources Group, Goldman Sachs Asset Management, p. 76.

Page 13: Paul Cox CQF Final Project with MatLab code

This is the financial engineering question that Fisher Black and Bob Litterman

asked themselves as they began to develop their model. Their solution was a market

equilibrium based approach that still allowed portfolio managers to incorporate analyst

views about investment opportunities. In the BL model, optimal portfolios are a

weighted combination of the market capitalization equilibrium portfolio and an

“investor views” portfolio. Rather than starting with a vector of asset returns, BL starts

with the equilibrium expected returns that would lead to the optimal portfolio having

the observed global market capitalization weights – a reverse optimization. In the

following paragraphs we will develop robust inputs for the IvyBytes portfolio using

exponentially weighted moving averages (EWMA) of returns. We will establish a prior by

solving the reverse optimization problem. We will examine alternatives to mean-

variance. We will consider 2 views on asset classes that differ from the views of the

market. Finally, we will demonstrate a posterior optimal portfolio from revised excess

returns by using the BL formula.

Robust Inputs

BL starts with the market model of N asset classes whose returns are normally

distributed:

5~7�8, 9�

Using econometric methods we can make covariance matrix input more robust.

One way is by using exponential smoothing of past returns with a EWMA model. The

MatLab code for robust inputs and the implementation of BL is in the

‘Paul_Cox_CQF_Project_Part_2.m’ file.

We will focus on weekly excess returns (returns over the risk-free rate) of the

IvyBytes portfolio. In this case we have 208 observations for each asset class. EWMA for

the variances is calculated as shown in the following example for VTI.

Page 14: Paul Cox CQF Final Project with MatLab code

宐τ

This EWMA is a conditional variance for VTI. The calculation in the above

example reduces to an equation in which each week’s variance is a function of the

previous week’s variance times the parameter λ (which we take as 0.94 as used in

RiskMetrics) plus (1 – λ) times the previous week’s squared return. Coding this example

in MatLab we can calculate robust standard deviations of all 9 asset classes, as seen

below.

Page 15: Paul Cox CQF Final Project with MatLab code

EWMA can be used to calculate a correlation matrix. In the following example

the excess returns of VTI compared to VEA has a correlation coefficient of

approximately 0.8094. The correlation coefficient is the sum of VTI’s excess returns times

VEA’s excess returns times the weights all divided by the product of their standard

deviations as shown below.

Page 16: Paul Cox CQF Final Project with MatLab code

ω

Looping these calculations in MatLab we can derive the correlation matrix:

1 0.809391 0.722357 0.3933 0.631727 -0.16239 0.289406 -0.25575 -0.17514

0.809391 1 0.762654 0.389605 0.834978 0.004093 0.47363 -0.15145 0.060109

0.722357 0.762654 1 0.402022 0.834254 0.089992 0.478214 -0.02854 0.185929

0.3933 0.389605 0.402022 1 0.374828 0.404116 -0.04906 0.556909 0.326653

0.631727 0.834978 0.834254 0.374828 1 0.059208 0.458337 -0.10391 0.264173

-0.16239 0.004093 0.089992 0.404116 0.059208 1 0.154493 0.857016 0.429692

0.289406 0.47363 0.478214 -0.04906 0.458337 0.154493 1 -0.14578 0.209124

-0.25575 -0.15145 -0.02854 0.556909 -0.10391 0.857016 -0.14578 1 0.416895

-0.17514 0.060109 0.185929 0.326653 0.264173 0.429692 0.209124 0.416895 1

Which can be pre and post-multiplied by the diagonalized matrix of standard

deviations to form the robust covariance matrix of excess returns, Σ ≈

0.011825 0.01067 0.014277 0.006305 0.008348 -0.00106 0.004479 -0.00101 -0.00267

0.01067 0.014697 0.016805 0.006963 0.012301 2.97E-05 0.008173 -0.00067 0.00102

0.014277 0.016805 0.033034 0.010772 0.018425 0.00098 0.012371 -0.00019 0.00473

0.006305 0.006963 0.010772 0.021732 0.006715 0.003568 -0.00103 0.002988 0.00674

0.008348 0.012301 0.018425 0.006715 0.014766 0.000431 0.007927 -0.00046 0.004493

-0.00106 2.97E-05 0.00098 0.003568 0.000431 0.003588 0.001317 0.001868 0.003602

0.004479 0.008173 0.012371 -0.00103 0.007927 0.001317 0.020259 -0.00076 0.004166

-0.00101 -0.00067 -0.00019 0.002988 -0.00046 0.001868 -0.00076 0.001325 0.002124

-0.00267 0.00102 0.00473 0.00674 0.004493 0.003602 0.004166 0.002124 0.019589

Page 17: Paul Cox CQF Final Project with MatLab code

Reverse Optimization and the Prior

Now that we have the covariance matrix, Σ, we need to get the prior expected

excess returns. The BL model uses market equilibrium returns as a neutral starting point.

BL states that µ is normally distributed with mean π and standard deviation τΣ.

8~7�:, ;9�

Where π is the implied vector of excess returns that clear the market and τΣ is the

estimation error on µ. To get π we solve the following maximization problem:

argmax@

{@�: − �@�9@}

Setting the derivative of this with respect to w and doing the reverse optimization by

solving for π using market weights wMKT we get:

ΠDEF = 2�G�DEF

Now we just need a source for global market capitalization rates of the asset classes in

the IvyBytes portfolio. One such source is a report titled “Global Invested Capital

Market” released by Hewitt EnnisKnupp, An Aon Company. Their June, 2014 study lists

asset classes along with their proportions of the global invested capital market. Note

that the Hewitt study considers more asset classes than the IvyBytes portfolio so we will

have to adjust the weights accordingly.2 Table 2 below shows the market weights used

for our estimation of the prior.

2 Comparing the IvyBytes portfolio to the asset classes in the Hewitt study shows that the only

large asset class missing from the IvyBytes portfolio is non U.S. Bonds (Developed) which,

according to the Hewitt study, 22.4% of the global invested capital market.

Page 18: Paul Cox CQF Final Project with MatLab code

ω

Asset Class

Weight

from

Hewitt

study

Adjusted

Weight for

IvyBytes

Portfolio

U.S. Stocks 18.00% 27.78%

International stocks

(developed markets) 13.70% 21.14%

Emerging Markets

stocks 4.00% 6.17%

U.S. Real Estate 6.10% 9.41%

Foreign Real Estate 5.00% 7.72%

TIPS 2.50% 3.86%

Commodities 0.15% 0.23%

U.S. Total Bond

Market 15.20% 23.46%

Gold 0.15% 0.23%

Total 64.80% 100.00%

Table 2. Market weights for the asset classes in IvyBytes recommended portfolio. Source

for weights: Global Invested Capital Market, June, 2014 published by Hewitt EnnisKnupp, An Aon

Company, Table 2.

Substituting these weights into the reverse optimization and for various levels of

risk aversion, λ, ΠMKT ≈

λ = 0.01 λ = 1.2 λ = 6 λ = 2.71

0.000148 0.017725 0.088626 0.04003

0.000172 0.020589 0.102947 0.046498

0.000241 0.028864 0.144319 0.065184

0.000146 0.01753 0.087648 0.039588

0.000155 0.018638 0.09319 0.042091

1.46E-05 0.001752 0.008762 0.003957

8.36E-05 0.010034 0.050169 0.02266

3.95E-06 0.000474 0.002372 0.001071

2.88E-05 0.003457 0.017285 0.007807

λ = 0.01 corresponds to the near Kelly investor, λ = 1.2 is the risk aversion level

used by BL and λ = 6 is for a very risk-averse investor. The last one, λ = 2.71 is that level of

Page 19: Paul Cox CQF Final Project with MatLab code

며ϊ

risk aversion that sets the risk premium of U.S. stocks to approximately 4% and this is the

one we will use. This is the method of estimating λ is used by Litterman in his book

Modern Investment Management when he discusses the risk aversion coefficient as a

scaling factor of excess returns. With these inputs the composition of the Prior for our

IvyBytes mean-variance optimization problem is shown below.

We can see that this set of optimal portfolios is much more reasonable. It is not a

corner solution as all nine assets are represented at some point along the volatility

vector.

In addition to mean-variance we can optimize by maximizing the Sharpe ratio as

shown below:

Page 20: Paul Cox CQF Final Project with MatLab code

Views and Calculation of Posterior

BL assumes that the views are normally distributed by:

H8~7�I,J�

where P is a “pick” matrix with 1 row for each view and 1 column for each asset we will

have 2 views so P will be 2 X 9. And,

J = 'KLM�H�;9�H��

Is the uncertainty on the views. In the IvyBytes problem, let’s assume we have 2 views.

The first view is that, perhaps due to the Fed raising rates, TIPS outperform the U.S. total

bond market by 1%. The second view is that, perhaps due to a stronger dollar,

Page 21: Paul Cox CQF Final Project with MatLab code

ϊ

International developed stocks do 4% better than U.S. stocks. We will assume full

confidence in our views although BL allows us to set various confidence levels.

Therefore,

H =N0 0 0 0 0 −1 0 1 01 −1 0 0 0 0 0 0 0O

I = N−0.01−0.04O

BL takes advantage of Bayes’ formula for updating probabilities based on new

information:

P�Q|S� = P{S|Q}P�S� × P�Q�

for event E and information I. This says that the Posterior probability P{Q|S} (probability of

event E given information I) is equal to the updating weight UVSWQXU�Y� x P(E), the prior

probability. Through much tedious working Meucci (2010) shows that the posterior

market model is:

5|I;J ∼ 7�D\] , Σ\]�

Where,

D\] = ( + ;ΣP��;PΣP� +Σ����^ − P(�

Σ\] = �1 + ;�Σ −;2ΣP′�;PΣP� + Ω���PΣ

This is the model that incorporates the views. Figure 4 shows the comparison of

the Prior compared to the Posterior.

Page 22: Paul Cox CQF Final Project with MatLab code

䨀�

Note how the optimal weights have incorporated the information of the views.

The area for VTI is reduced as VEA is viewed as more of an opportunity. Also, the area

for TIP is larger at the expense of BND. Also note that the BL efficient frontiers are

reasonable and lack corner solutions.

In summary, the largest drawback to the Markowitz model is that a straight

mean-variance optimization leads to unintuitive portfolios concentrated in just a few

assets. Mathematically the solutions are correct but they are highly sensitive estimations

of returns which are also the hardest input to estimate. BL doesn’t use sample data of

returns. By solving the reverse optimization problem and backing into the equilibrium

returns that give observed market weights, BL allows portfolio managers to construct

Page 23: Paul Cox CQF Final Project with MatLab code

reasonable prior without corner solutions. Informed views that differ from the market

can then be incorporated into well balanced, reasonable looking posterior portfolios.

Page 24: Paul Cox CQF Final Project with MatLab code
Page 25: Paul Cox CQF Final Project with MatLab code
Page 26: Paul Cox CQF Final Project with MatLab code
Page 27: Paul Cox CQF Final Project with MatLab code
Page 28: Paul Cox CQF Final Project with MatLab code
Page 29: Paul Cox CQF Final Project with MatLab code
Page 30: Paul Cox CQF Final Project with MatLab code
Page 31: Paul Cox CQF Final Project with MatLab code