## Explaining How We Can Estimate And Calculate Investment Performance

This article documents a variety of calculations that can help us calculate the performance of our investments. This is an important process that every investor needs to perform sooner or later!

It is vital to calculate the performance of our investment as it helps us understand whether our investment decisions were good or whether we need to adjust the investment.

This article documents a wide array of metrics that are being used in the industry to measure the performance of the investments.

This article will form the foundation of the investment management concepts which we need to understand before we can start investing our money into company shares.

# Article Aim

In particular, I will be explaining the following measures:

1. Asset Returns
2. Asset Expected Mean Return
3. Asset Weighted Average Return
4. Asset Volatility
5. Portfolio Expected Return
6. Portfolio Volatility
7. Dollar weighted rate of return
8. Time-weighted rate of return
9. Sharpe Ratio
10. Treynor Ratio
11. Jensen’s Alpha
12. Information Ratio

Please read the FinTechExplained disclaimer. Always seek professional financial advisor advise before investing your money.

# Setting The Scene

Let’s consider that your portfolio consists of a number of company shares. Let’s refer to these shares as assets. After a couple of days, naturally, you would want to value your portfolio to assess whether the investment choices were appropriate.

For that, you need to calculate the returns of your portfolio.

One of the simplest ways to calculate the returns is to find the difference in your portfolio value:

However, there are far superior methodologies around which you can use to better understand the returns.

A portfolio holds multiple assets. Let’s take a step back and understand how to compute the returns of each individual asset that a portfolio holds.

# 1. Asset Returns

The first step is to calculate the returns of the assets in your portfolio.

For us to calculate the asset returns, we need to perform the following two steps:

1. We need to get their historical daily prices

2. Then we need to compute geometric returns by calculating the following equation:

As an instance, let’s consider that we have invested in the following company shares:

1. ZM
2. UBER
3. SWI
4. RNG
5. CRWD
6. WORK

The daily stock prices of the assets are:

The stock prices are of different magnitude. To compare the returns, we need to compute their returns so that the amounts are within the same range.

Computing the returns as per the formula above will give us:

The methodology above standardised the returns as now we can compare each of the assets.

We can implement it easily in Python:

`import numpy as npreturns = np.log(stock_prices / stock_prices.shift(1))`

# 2. Asset Expected Mean Returns

The asset returns which were computed above are all 2-dimensional as there is a time axis involved. We now need to compute a single number to represent the returns of the assets. One of the most common ways is to compute the mean of the returns which is known as the expected returns.

To compute the asset expected mean return, we need the mean of the returns of each stock:

As an instance, for the example above, we will get the following expected return for each stock:

If we want to change the frequency of the returns then we need to multiply the expected return with the required frequency.

As an instance, if you wanted to calculate yearly expected return then multiply the expected return by 252 as there are around 252 working days in a year.

We can implement it using Python:

`returns.mean() * 252`

# 3. Asset Weighted Average Return

The problem with the asset expected return is that it assumes every single return has equal importance.

We might want to give higher importance to recent returns. As an example, the returns of the past 5 days are probably more important than last year's returns. Consequently, we can compute the weighted average returns.

We can use the exponentially-weighted moving average (EWMA) methodology with a decay factor which reduces in magnitude as we move further in the past. The more recent returns have, therefore, higher precedence.

We can compute it by using Python’s Pandas library:

`import pandas as pdpd.ewma(returns)`

# 4. Asset Volatility

Once we have computed the asset returns, we need to calculate the volatility of each of the assets. Asset volatility is an indication of how risky the asset is. High volatile assets are usually riskier.

We can calculate the standard deviation to represent the volatility of the assets. Standard deviation measures the dispersion of the values around the mean.

There are three main steps involved:

## 1. Calculate Mean

1. Sum all values.
2. Divide it by the total number of observations.

## 2. Calculate Variance

1. Take the difference between each value and the mean
2. Square this difference.
3. Sum all differences
4. Finally, divide by the total number of observations.

## 3. Take the square root of the variance

Finally, compute the square root of the variance in step 2 above. Standard deviation gives us the dispersion of the values around the mean in the same units as the values (instead of squared value as variance)

# 5. Portfolio Expected Return

Now are ready to compute the expected return of the portfolio. The portfolio holds the assets together and a weight is assigned to each asset. As an instance, the portfolio might hold 40% of asset ABC and 60% of asset DEF.

From the asset expected return, we can compute the expected return of the portfolio. It is calculated by computing the weighted average:

Let’s consider that there are 6 assets in total and we invested 1/6 of the total amount to be invested in each asset.

In the example, we have allocated an equal proportion to each stock, therefore, the portfolio expected return is going to be computed by calculating a product of the expected return of each asset and the weight of the asset:

Python lets us compute the portfolio returns as:

`portfolio_returns = sum(returns * weights)`

# 6. Portfolio Volatility

The volatility of the portfolio is computed by calculating the standard deviation of the returns of each stock along with the covariance between each pair of the stocks:

Volatility in this instance is the standard deviation i.e. the total risk of the portfolio.

We can compute it in Python using:

`import numpy as npcov = returns.cov() * 252return np.sqrt(reduce(np.dot, [weights, cov, weights.T]))`

# 7. Dollar-Weighted Rate of Return

It is also known as the internal rate of return (IRR) on the portfolio. We start the account by depositing the money in. This is therefore considered an inflow. The withdrawals from the account are known as outflows. It is all about taking in the cash inflows and outflows into account. The final value is also an outflow.

The way it works is that we need to:

1. First, mark each cash flow as either an inflow or an outflow.
2. Net the cash flows and find the value of the discounted rate that equates the present value of inflows and outflows.
3. It can be achieved via the IRR function on calculators or excel spreadsheet which stands for the internal rate of return.

# 8. Time-weighted Rate of Return

The measure computes the rate at which \$1 compounds over a time period. It measures compound growth and averages a set of values over time.

1. It involves creating subperiods which are essentially the dates of deposits and withdrawals.
2. For each of the subperiod, we need to compute the ending price of the account and a holding period return from the ending price. The holding period return is computed as (ending price + inflows)/starting price).
3. The product of (1 + holding period return) of all holding periods is calculated. This is known as the annual returns.
4. Finally, we need to compute the geometric mean of the rate of return. This is known as the time-weighted rate of return.

# 9. Sharpe Ratio

We could have invested our money into a savings account (risk-free) and earned a return without taking any risk. How can we decide whether the return we earned is worth the risk we took? As a result, we can compute the Sharpe Ratio.

We need to compute the amount of excess return over the risk-free rate as the relevant measure of risk. This is known as the Sharpe ratio:

# 10. Treynor Measure

Once we add a number of different assets in a portfolio, we start diversifying the risk of our portfolio. If our portfolio is not as diversified as the market portfolio which contains every single possible stock out there then we are essentially taking the systematic risk of the portfolio into account. Hence, we need to compute the excess return over beta as shown below:

# 11. Jenson's Alpha

This measure calculates the difference between the actual return of the market return.

Market return can be computed by CAPM:

# 12. Information Ratio

If we want to compare our portfolio against a benchmark such as Russell 1000, FTSE 100, SNP 500 and so on, then we can compute the information ratio.

Information ratio is also known as the appraisal ratio because it helps us understand the amount of risk taken to achieve the excess return over the benchmark portfolio:

Volatility is calculated by computing the standard deviation.

I have now explained the common measures. The next step is to implement a portfolio investment application in Python. I am preparing an article which will explain how we can compute all of these measures and prepare an optimum portfolio. I will be posting this article in the next few days.

If you want to get a good understanding of investment management then read this article:

# Summary

This article forms the foundation for investment management concepts. It outlined the key measures which we can use to compute the performance of our investment.

I hope it helps.

Written by

## FinTechExplained

#### This blog aims to bridge the gap between technologists, mathematicians and financial experts and helps them understand how fundamental concepts work within each field. Articles

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just \$5/month. Upgrade