In this module, we are going to define the efficient frontier for a mean version

portfolio selection problem. We are going to walk through how to

compute the efficient frontier for a 2-asset market, and then for a general

d-asset market. And the main punchline is that the d-asset

market is no different from a 2-asset market.

If you remember what we said was for a given level of risk, the efficient

frontier gives you the maximum possible return.

So, this is the efficient frontier, this, this particular point corresponds to the

return of a portfolio, which is an efficient portfolio, or it's a frontier

portfolio, all of these things are synonymous.

It's a, it's a portfolio that for a given level of risk, gives you the maximum

return, or another way to look at the same point is that for a given value of return,

this portfolio gives you the minimum risk. So, any investor wanting to hold a certain

amount of risk or wanting to hold a certain amount of return, will want to be

on this efficient frontier. And in this module, we're going to walk

you through the calculation of how this, this particular curve is computed.

We're going to work with a very simple example first, just of two assets, two

risky assets. And then, in the later part of the module,

we'll show you that, that is the most general.

In fact, if you have any number of assets, you will end up using only two mutual

funds to construct the efficient frontier. So, here's my problem.

I want to do mean-variance optimal portfolio selection for a 2-asset market.

Asset 1 has mean return mu 1, it has variance sigma 1 squared.

Asset 2 has mean return mu 2 and variance sigma 2 squared, and the correlation

between the two assets is rho. What's nice about a 2-asset market is that

the portfolio constraint is very simple to write.

A portfolio, remember, was the fractions invested in the different assets.

So, in a 2-asset market, there's only one unknown x.

Suppose, x is the fraction that you invest in asset 1, then 1 minus x will be the

amount you will invest in asset 2. And therefore, the return of this

portfolio x1 minus x is going to be the mu 1 times x because that's the amount that

you invest in asset 1, mu 2 times 1 minus x because that's the amount that you

invest in asset 2. What is the variance of this portfolio?

It's going to be sigma 1 squared times x squared, that's the variance coming from

asset 1, sigma 2 squared times 1 minus x squared which is the variance coming from

asset 2 plus 2 times rho sigma 1 sigma 2. And if you go back, this is nothing but

the covariance sigma 1, 2 between the two assets, times x, the amount invested in

asset 1, times 1 minus x, the amount invested in asset 2.

It's very simple. It's one-dimensional in the sense that the

only thing, only unknown is x. And that's why 2-asset markets are very

easy to describe. So, I want to solve minimize risk

formulation for the mean-variance portfolio selection problem.

So, what I want to do is specify a target return.

And then, find a portfolio that achieves the target return, but has the minimum

risk corresponding to that target return. This is the return of the portfolio

that's, this is mu of x. We wanted that to be greater than or equal

to r. Here, we are saying that this is exactly

equal to r. So, there's a difference between these

two. We wanted it to be greater than or equal

to r, and we are now wanting it to be equal to r.

The reason we made it equal to r because it's now, it's very easy to compute.

One equation, one unknown, I can solve for x.

I can plug that x into the form, into the expression for the variance, and I'll get

the efficient frontier. But this fact that I wanted equal to r

will come and affect us in the final solution and we'll have to reinterpret

what that means. So for now, let me erase all of these so

that it becomes clear what we are trying to do.

What we're saying is, among all those portfolios that give me a return exactly

equal to r, find me one which has the minimum variance.

For a 2-asset market, this becomes trivial because there's only one unknown x, and I

can solve for it. So, there's only one portfolio that gives

me the desired return r. And what's the value of x?

It's simply r minus mu 2 divided by mu 1 minus mu 2.

You simply solve this one-dimensional equation and you'll get the answer.

So, I know the portfolio x that is going to give me the target return, I'm going to

plug it into the equation for the variance.

So, if x is r minus mu 2 times mu 2 minus mu 1, 1 minus x, which is the amount that

you invest in asset 2, is going to be mu 1 minus r divided by mu 1 minus mu 2.

You can just do the algebra and it'll turn out to be right.

So, what I've done in this line, is that here I've just set x, so it's sigma 1

squared x squared. Here I, put in 1 minus x so it's sigma 2

squared 1 minus x squared. This is x, this is 1 minus x.

If you plug in the answers, you'll exactly get this expression.

If you expand it out, you'll end up getting that sigma r squared is ar squared

plus br plus c. So, these are just numbers that depend on

sigma 1, mu 1, and rho, and sigma 2, mu 2, and so on but these are numbers, r is the

only unknown. So, what does this tell me?

It tells me two things. If I know the target return r that I want

to get to, the variance, the minimum variance corresponding to that target

return is explicitly given by a formula. In fact, it's by, given by a parabola.

So, what am I drawing here? I'm taking the value of r, and how was

this computed? I plugged this value of r into that

formula. I calculated out what sigma 1, sigma r

squared is going to be, took a square root of that.

That's going to be volatility. So, I'm plotting r in percentages here.

I'm plotting volatility in percentages. And this is exactly for the same set of

assets that I showed you on the spreadsheet.

When we are down to this module, I'm going to go back and show you how to do the same

computation on the spreadsheet. I compute out what sigma r is going to be,

it's going to be this number and I'm going to plug this for all possible values of r.

Notice on this slide, I'm plotting two different curves, one in blue, one is red.

The red curve is not efficient. If you take a point here, this has a

return of minus 2%. It has a volatility of, let's say,

approximately 8%. We can get another portfolio with the same

risk level, 8%, with much higher return. This particular portfolio up here has the

same risk level, 8%, and has much higher return than this minus 2.

So, this entire red curve, in fact, is not efficient and that is what we marked out,

it says, it's inefficient. So, why did we end up getting it?

We ended up getting it because when we set up the optimization problem, we insisted

that the target return should be exactly equal to the return that I specify.

If I had made it greater than or equal to, and you have specified a return minus 2,

the optimization problem would have discover that for that particular target

return, the best portfolio, best risk is this 8%, but for the same 8%, I can give

you a much higher return and therefore this bottom line would never have

appeared. The bottom line appeared only because of

the equality constraints. It's sometimes convenient to put the

equality constraints because we can solve the optimization problem simply, but later

on, we'll have to come back and then argue that certain parts of the curve cannot be

efficient. Alright.

Now, I want to extend it to a d asset problem, and see how far can I push it.

So, here's a mean-variance problem that I want to solve.

Same thing, I want to minimize my variance, but now here's the expression

for the variance. It's the covariance matrix sigma ij times

xi and xj. I need to make sure that the x's that I

consider is a portfolio, so the sum of the x's is equal to 1.

And again, as before, instead of putting greater than or equal to r here, I am

putting equal to r, for the same reason because I have equality constraints and I

can solve this more efficiently. In the prerequisite modules for nonlinear

optimization, we had introduced this idea of Lagrange multipliers.

The problem with this optimization problem is that it has two constraints and I don't

know how to deal with these constraints effectively.

So, the easiest way to do it is to construct something called the Lagrangian

and the way to construct the Lagrangian is to take the objective function.

So, this box here is just the objective function, take the constraints.

So, this particular constraint is the target return constraint except that the

r, which is on the right-hand side, I said, is equal to minus r inside the

bracket. This constraint is the constraint that

says that the some of the x's should be equal to 1, that is, they must be a

portfolio. And again, the 1 on the right-hand side, I

moved it into the left-hand side with the minus 1 and then I multiply it by two

multipliers, u and v, which I call the Lagrange multipliers.

Now, having put the constraints into the objective by multiplying by the Lagrange

multipliers, I'm going to completely ignore the constraints.

I'm going to say that this is now an unconstrained problem.

And we know that for the optimal solution of an unconstrained problem, we have to

compute its gradient and set it equal to 0.

Now, this particular objective function, assuming that u and v for the moment are

just multipliers, they are not unknowns. The, the decision is in terms of these x's

and there are b of different x's so I have to take the partial derivative of this

expression with respect to all of them, and set it equal to 0.

If you take the partial derivative with respect to i, you'll get two times sigma

ij, xj, that's the derivative that's coming from this term.

You'll get v times mu i, which is a term that is coming from here, and minus u,

which is the term that's coming from there and then set it equal to 0.

I'll have one equation for all i's going from 1 through d.

So, I get d equations from here. I have two other equations from here.

I need to make sure that my portfolio satisfies the target return.

And I need to make sure that it satisfy, it's a portfolio.

So, I have two equations here, I have d equations here, and how many unknowns do I

have? I have actually d plus 2 unknowns.

Why the 2 extra unknowns? The 2 Lagrange multipliers, u and v.

So, here are the original set of unknowns, here are the new unknowns that I

introduced, I have d plus 2 unknowns, d plus 2 equations I can solve.

And in the next slide, I'll show you how to set up the linear equations to solve

it. Here, I'm going to encapsulate this story

into a theorem which says that a portfolio x is mean-variance optimum, if and only if

its feasible, it satisfies the constraints, and there exists u and v.

Multipliers u and v would satisfy these constraints star, which satisfy all of

these gradient conditions. And this will become important in a few

slides. Alright, so here, all I've done is I've

taken these equations that are there, these d equations, and the extra two

conditions on the portfolios, and set them up as one large matrix.

So, up here, all of these equations are the gradient equations.

This equation is the target return equation.

This equation is the portfolio equation. So, there are d plus 2 equations here, d

plus 2 unknowns. All these zeros corresponds to the

gradient conditions that they must all be zero, this r is, of course, the target

return, and this 1 is the fact that it's the portfolio 1.

So, that's some vector b this is some, I'm just calling this matrix A and we, just

simple Linear Algebra tells me that if I take all of these portfolios this vector,

I can compute it by simply taking the inverse of A and multiplying it to this

vector b. Done.

In the rest of this module, what I want to do is give you a little bit more structure

of what do these portfolios look like. Is there any interesting structural

properties underneath, which we'll use later to derive something like the capital

asset pricing model? So, we got to walk through a couple of

slides, which will end up showing something called the two fund theorem.

The two fund theorem says, that the entire efficient frontier can be generated by

just looking at two portfolios or two mutual funds.

So suppose we fix two different target returns, r1 and r2, and I go and solve for

the optimum solution for r1. What do I mean by solving from the optimum

solution? I go to this set of equations, plug in r1

over here and compute the optimum portfolio.

That's port, optimum portfolio, I'm going to label it as x superscript 1.

And when I solve for that portfolio and also compute out the corresponding

Lagrange multipliers, v and u, I'm calling them in this light, v1 and u1.

I take the other return r2, do the same thing.

The optimum portfolio, I'm going to label it as x superscript 2 and the Lagrange

multiplier as v2 and u2. Okay, now, we take any target return r

that we want. I'm going to arbitrarily create for you

another position y and argue to you that this position y, in fact, is the optimal

solution for that new target return. And here's how it's going to be

constructed. You take a target return and you choose a

number beta, which is r minus r1 divided by r2 minus r1.

And if you remember back, we, in the 2-asset market, the x was simply r minus

mu 1 divided by mu 2 minus mu 1. So, this should somehow give you an idea

that we are going back slowly to this 2-asset market, which is effectively what

this two fund theorem says. I'm going to create a new position y.

I don't know whether it's a portfolio for now.

And the way I'm going to construct this y is I'm going to take 1 minus beta times

x1, which I know, and beta times x2. I'm going to add them up.

This will give me some positions in all the b assets.

And let's walk through and see what, what happens.

The first thing that I'm going to do is compute out the sum of all the components

of y. Sum of this yi is nothing but 1 minus

beta, the sum of the corresponding coefficients of x1.

Beta times the corresponding coefficients of x2.

X is a, x1 is a portfolio, x2 is a portfolio.

So this sum is equal to 1, that sum is equal to 1.

1 minus beta times 1 plus beta times 1 if you add it up, you get 1.

So, after this calculation, we know that this y, which was just a position right

now, is now a portfolio. It's a set of numbers that adds up to one.

Now, let's calculate out what is the expected return on this portfolio y.

That's mu i times yi, expand it out again, it's 1 minus beta times mu i times x1 i.

Sum from i equals 1 to d, beta times the sum of mu i times x2 i sum from 1 is to d.

This one, remember, x1 is feasible for a target return, and so it's actually equal

to r1. This quantity is feasible for a target

return r2, so it's equal to r2. So, it's 1 minus beta times r1 plus beta

times r2. Plug in the value of beta that it was

computed, you get exactly equal to r. And if you connect back to the

one-dimensional or the 2-asset case, this is exactly saying 1 minus x times mu 1

plus x times mu 2, must equal r, which is exactly the equation that we solved there.

Now, we are going to argue in the next slide, that this y, in fact, is optimum.

And how are we going to do that? I am going to use the theorem which says

if I can find multipliers u and v for which the equations hold, then y must be

optimal, because y is feasible, it is a portfolio, it has a right target return if

I can find u multipliers such that all the gradient conditions hold, it must be the

optimal portfolio. So, I know v1 and v2.

So, I take a guess, and say that the v variable corresponding to this new

position is just the same multiplication. 1 minus beta times v1, beta times v2.

1 minus beta times u1, beta times u2 is going to be u.

Here's my sigma ijy, ij minus v mu i minus u.

This is the gradient condition that corresponds to asset i.

So, this is the partial derivative of the Lagrangian with respect to the asset i.

I plug in the values for what y, this is nothing but a plug in for what yj is going

to be. Here, I'm plugging in my guess value of v.

Here, I'm plugging in my guess value of u. You rearrange them.

Take all the 1 minus beta terms together. You end up getting something that just

depends on the asset 1, the multipliers, v1 and u1.

But x1 was optimum, therefore, all of this bracket must be equal to 0.

Similarly, if you collect terms for beta, you'll get terms that correspond to x2.

But x2 was optimum, so therefore, this must be equal to 0.

1 minus beta times 0 plus beta times 0, gives you zero.

So, I have constructed for you multipliers, v and u, v and u, such that

all the gradient conditions hold. Therefore, y must be optimal for the

target return r. And we have this theorem which says, that

all efficient port, portfolios, all the portfolios that are there on the efficient

frontier can be constructed by diversifying between any two efficient

portfolios with different expected returns.

The only condition that we needed on x1 and x2 is that they have different

returns. So, everybody, whoever is going to be

investing in this market, they're happy if I just give them two mutual funds and say,

okay, you just invest what you like on these two mutual funds.

So, why are there so many mutual funds in the market?

There are over 6,000 of them floating around.

Why are they there? You might want to pause your video here

for a second and think about it. So, the reason those different mutual

funds are there is because we're assuming in the background here that all the

investors have the same expected return, mu, and have the same covariance matrix

sigma. What do I mean by they have?

Meaning they estimate what is going to happen in the future by the same mean

vector and the same covariance matrix. That's never going to be true.

So, even if they are all mean-variance investors, they might have different

estimates, which means that their efficient frontiers would look different,

which means that a portfolio or a mutual fund which will be efficient for one

investor may be completely inefficient for another investor.

There's also no reason to believe that everybody is a mean-variance investor.

This is another topic that we are going to talk about towards the very end of this

module. And so, although this, this theorem is

very interesting and important and, in fact, led to the development of the

industry as a whole you should take it with a, a grain of salt that there is a

gap between what theory is and what practice its going to be.

Alright, returning back to the theory. The theorem says that all efficient

portfolios being constructed by diversifying between two efficient

portfolios which means effectively, it's a 2-asset market.

If I'm talking about investors, they don't need more, anything more than two assets.

And therefore, since y star can be written as a combination of x1 and x2, all I've

done is rearranged terms. I took the r outside, I put x2 minus x1

divided by r2 minus r here. Call this a new position g, call this a

new position h. So therefore, every component can be

rewritten as r times gi plus hi. Plug it into the expression for variance

and you'll end up getting again that the efficient frontier has a same structure as

a 2-asset efficient frontier. And therefore, we'll just end this module

by showing you that the efficient frontier looks the same.

Again, the same story. This bottom is enef, inefficient.

And the reason we had this because instead of putting target greater than or equal to

r, we set target equal to r. And this, this equal to ends up giving

this the inefficient frontier at the bottom and we'll stop.