All right. Welcome back. Where we left off last time, was we constructed this Efficient Frontier. The efficient frontier is simply the space of portfolios that we would want to hold because there is no way of getting a higher return for the same level of volatility or for you to get a portfolio with equivalent return, but lower volatility. In other words, all of the portfolios on the efficient frontier are portfolios that you cannot improve on without changing either the volatility or the return. All right? So now that we've figured out what that is, we want to find a way of plotting it or drawing it, and the solution to this is in two parts. The first part we're going to have to walk through a certain amount of theory, and the theory is just a bunch of equations that it helps to understand. Then we're going to plug that information into an optimizer and an optimizer is going to basically tell us the construction of the exact space, where the efficient frontier lies. What does it involve? We have to find out what is the point in that mean-variance space that the efficient frontier passes through. So if we could find a series of points in that risk-return space, then we've basically plotted the efficient frontier; that's the background. So let's start by looking at the expressions. So remember to plot a point on it, we need two things; we need the x and the y coordinate. The x is basically the volatility, the y is the return. So the return part is actually very simple. If you've got a bunch of assets, the returns of any weighted combination of those assets is just the weighted average of the returns. So that's essentially what that formula there says, that the return on a portfolio is nothing more than the weighted average returns of the constituents of that portfolio. No surprise there. The next step, is the one that was a little surprising, and that was an expression for the variance and this is the generalized form of the equation that you already saw with two assets. It is an expression that says that to compute the volatility of this portfolio, where you've got a bunch of assets and you've put in some capital in some weights, if you've got an asset i you're going to, let say, put wi is the weight that you've given that asset in your portfolio. Well then, the variance of that portfolio is this double summation. It is the sum of W for every possible of combination of i and j. So every possible pair of assets in your portfolio is the weight of i times the weight of j, times the volatility of i times the volatility of j, multiplied by the correlation between i and j. All right? That last three terms (the sigma i, sigma j, rho ij) is nothing more than this thing that we call the covariance. So if you've heard this phrase in statistics that's great. If not, all you need to know is, the volatility of i times the volatility of j, times the correlation between i and j is called the Covariance. It measures how much these things co-vary. So I can make that equation a little bit more compact by basically saying it's the double summation over every combination of i and j of Wi times Wj times sigma ij, where sigma ij is the covariance between i and j. What we can do is improve on this a little bit, this notation, which is by using matrix notation. Some people really like matrix notation. Some people hate it. I'm going to put it out there just so you have the choice, there's no question that matrix notation is a lot more compact. So what is the return of a portfolio? Well, it's nothing more than the WTR, where WT is basically the transpose of the Weight Vector. So the weight vector is all the weights in the form of, let say, k by one vector, where k is the number of assets. So if you take the transpose of the weight matrix and you multiply it by the return vector, which is again the k by its column vector of the returns of those assets, well, you've got your weighted return. That's just a fancy way of saying weighted average return. The covariance is the one that really benefits a lot from this very compact notation and what we showed you in that previous one. If you use sigma and that's the typical symbol that we use for the covariance matrix, the covariance matrix is just a k by k matrix, where the ijth entry is the covariance between i and j. The diagonal is the covariance of the ith element with itself, so it's sigma ii. Well, that is nothing more than the volatility of i. Why? Because it is sigma i times sigma i again, times rho of i and j, but i and j are both i here. So it is sigma i times sigma i times rho ii, but rho ii is one because every asset is perfectly correlated with itself. So bottom line is that the diagonal elements of this covariance matrix are nothing more than the variances. So the diagonal is nothing more than the variance of those assets and the off-diagonal elements (this is a symmetric matrix) elements are the covariances. So some people call this the variance-covariance matrix. Some people just call it the covariance matrix. So I'm just going to call it the covariance matrix. What have you got now? You have got the covariance matrix, you've got the weight vector and what we're trying to do now is figure out what the plot of that efficient frontier looks like. The way you do this, is that what you want to do is start by taking some portfolio that you know lies on the efficient frontier. We know that at least one of these things lies on the efficient frontier, which is whatever the asset is that has the lowest return. Why? Because there's no way to get a lower return than that. So that is clearly at least on the curve. It's maybe not on the efficient frontier but it's on the curve. So what you do is you start with that and then you know one other asset that's on this curve, but maybe not on the efficient frontier but on the curve. That is the asset with the highest return because there is no way without leverage of getting a higher return than that. So we know at least two points on this curve. What the point on the curve is, if you put all of your money in the lowest returning asset, that's the bottom of this curve. If you put all of your money on the highest returning asset, that is the top of this curve. So we know two things on the curve. Now, what you can do is you can start building portfolios that essentially lie between this and every single time what we want to do is, we want to run the optimizer to find the minimum possible variance portfolio you can get for a certain level of return. So you start with the minimum return. You know you want to go up to the maximum return, so what you do is you take that space between the minimum return and the maximum return and you split it into a grid. Then at every point on that grid, what you want to do is run the optimizer to try and find the set of weights that gives you the portfolio that minimizes the volatility for that level of return. The expression for that is this, and we've already seen that minimizing the volatility is basically minimizing the variance which is minimizing W transpose sigma W, but that's the same as minimizing half of that. So minimizing a value is the same as minimizing half of that value. Why do we do this weird half thing? Because that particular format of half W transpose sigma W, is something that is known as Quadratic Form. Quadratic form is exactly the input that you want to hand over to a quadratic optimizer. So what do we need? We need a quadratic optimizer, we supply a set of constraints and an objective function to the quadratic optimizer. What is the objective function? Minimize the variance. What are the constraints? Well, the first constraint is the return must be at that certain level and we're going to run it over and over again across that grid of return values so that you can plot each point along the curve. Other constraints are, typically, you want all the weights to be greater than zero. So in other words, no shorting and the final constraint that typically you'll want is that the weights all add up to one. Both of these are essentially linear constraints and so the quadratic optimizer will very happily take these linear equality and inequality constraints and that is exactly what we're going to be doing in the lab. What is important here is for you to understand that because the expression for the variance is perfectly suited for an quadratic optimizer, it's a very simple problem to be able to plot the points along that curve and therefore that will allow us to actually draw out the efficient frontier. That's what we're going to do in the lab section. Thank you very much.