The second major component of modern portfolio theory is the risk of a security. We looked at what the expected returns are, but do we expect the actual return to be different from what we expect it to be? That's what risk is, risk represents the chance that the actual return is different from what we expected it to be. Another way to think about risk is that it's synonymous with volatility. The greater the portfolio volatility, the greater the risk. So what is volatility? It refers to the amount of risk or uncertainty related to the size of the changes and the value of the security. One of the most common measures of volatility of a security's return are the variance or standard deviation. Next, we want to consider, what is the volatility of a portfolio? There are two things we need to consider or calculate when we determine the volatility of a portfolio. First is the variance of the expected returns of one security, and then the covariance matrix of the covariances between the securities. We have noted that observations indicated that the variance of the portfolio decreases or the risk of the portfolio decreases as the number of assets increases, and that's something that's known as diversification. This calculation is just like any standard deviation calculation. We have the difference between the actual returns and your expected returns. We square that difference. Remember that's a distance measurement, how far away are you from, as your expected from the actual, and then you divide that by N. In order to get the standard deviation from the variance, all you have to do is take the square root. The other component that we needed was the correlation or the related covariance matrix. The correlation and covariance measures indicate the strength of the relationship between two assets. Are they moving together, up and down together, or are they moving in different directions? That's something we might be interested when analyzing a portfolio. The correlation, denoted Row, between Assets A and B can be written in this formula. Here, we're taking the distance away from our actual and expected of Asset A and then at the same time, taking the distance between the return and expected values of Asset B, and then we multiply them and then add them up. Here, we're taking that difference and squaring it and adding them up. Then here, we're doing the same thing with Asset B, taking the difference between the returns and the expected returns, squaring them and then adding them up. Then we divide the square root into the summation to get the correlation. The covariance is related to the correlation. Covariance is related to correlation to this formula here. So the covariance between two assets is equal to the correlation times the standard deviation of Asset A times the standard deviation of Asset B. Another way to think about it is if you take the covariance of two assets and divide by the standard deviations of A, standard deviation of B, you'll get the correlation. The other thing to remember is that the correlation ranges from minus one to positive one. Correlation is less than one or less than, greater than or equal to. One indicates a perfect positive correlation and negative indicates a perfect negative correlation. So let us consider an example on how to calculate the volatility. Let's assume that we have, again, two assets in our portfolio; Asset A and B, with the standard deviations. Asset A has an expected return of 12 percent with a 20 percent standard deviation, and Asset B has an expected return of 16 percent with a 35 percent standard deviation. Also note, I've added that the correlation between these assets is 0.6, and let's assume the same weights for our portfolio. That is $6,000 will be invested in Asset A, $4,000 in Asset B, and we have a sum total of $10,000 to invest. So how do you calculate the volatility of a portfolio? In our two asset case, here's the example, the volatility of the portfolio denoted V_P is this equation here. First, we calculate the weight of Asset A squared times the variance of Asset A plus the weight of Asset B squared, times the weight of Asset B, times 2 times the correlation of A and B, times the standard deviation of A times the standard deviation of B times the weight of A times the weight of B. If you plug in the numbers into this formula, you have six squared, which are the weights of A, times the expected return squared plus the weight of B times the expected return of B times 2 times the correlation times the standard deviations of A and B along with their weights. Do the arithmetic, and in this case, we get an answer of 0.05416. That is how you do the volatility calculation.