# Portfolio risk calculator and formula

We often say that risk and return are two sides of the same coin. So, when assessing the performance of a portfolio, we need to consider its risk as well as its return. In the previous lesson, we focused on portfolio return. Now, we turn our attention to portfolio risk.

## Portfolio risk calculator

You can use the portfolio risk calculator below for portfolios containing up to three assets. Please note the following instructions:

• For Asset 1, enter its variance (σ12) and its covariances with Asset 2 (σ12) and Asset 3 (σ13).
• For Asset 2, enter its variance (σ22) and its covariance with Asset 3 (σ23).
• Finally, for Asset 3, enter its variance (σ32) only.
• If your portfolio consists of 2 assets only, just leave 0s in the fields that you don’t need.
• Make sure that investment weights add up to 100% (see the “sum of weights (%)” in the last row).
• The calculator allows for both positive investment weights and negative investment weights (i.e., short selling).

## Portfolio risk formula

In the previous lesson, we explained that a portfolio’s return is simply a weighted average of the returns of assets that constitute the portfolio. And, the weights are determined by the amount invested in each asset. This led us to the formula for portfolio return RP:

where wi is the investment weight for asset i and Ri is the realized return for asset i. In an earlier lesson, we introduced the variance of returns (let’s denote that as σi2 for asset i) as a measure of risk. Could we then calculate the variance of returns on a portfolio σP2 as a weighted average of the variance of assets in that portfolio? In other words, would the following equation capture portfolio risk?

The answer is no. When calculating σP2, we need to consider not only the variance of each asset but also the covariance between each pair of assets. To understand why, imagine a portfolio with two assets only. Suppose that when the price of one asset goes up, the price of the other tends to go down. These opposite movements would partially cancel out each other, reducing the volatility of portfolio returns. So, the portfolio risk formula is:

where wi is the investment weight for asset iwj is the investment weight for asset j, and σij is the covariance between assets i and j.

### Portfolio variance with two assets

For a portfolio containing two assets (A and B), the general portfolio risk formula simplifies into:

So, in a two-asset portfolio, σP2 depends on:

• The variance of returns for each asset (σA2 and σB2).
• The covariance between the returns of asset A and asset B (σAB).
• And, the investment weights (wA and wB).

### Portfolio variance with three assets

If a third asset (C) is added to the portfolio, we have:

Then, in a three-asset portfolio, σP2 depends on:

• The variance of returns for each asset (σA2, σB2, and σC2).
• The covariance between each pair of assets (σAB, σAC, and σBC).
• And, the investment weights (wA, wB, and wC).

### Portfolio variance with N assets

If we kept adding assets to the portfolio, we’d end up with the following formula:

This means that for a portfolio of any size, portfolio risk depends on the individual risk of each asset in the portfolio (σ12, σ22, …, σN2), the covariance terms (σ12, σ13, …, σN-1 N) and investment weights (w1, w2, …, wN).

##### Summary

In this lesson, we have explained the portfolio risk formula, highlighting the importance of covariances between asset pairs. We have also provided a handy portfolio risk calculator.