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.
In particular, I will be explaining the following measures:
- Asset Returns
- Asset Expected Mean Return
- Asset Weighted Average Return
- Asset Volatility
- Portfolio Expected Return
- Portfolio Volatility
- Dollar weighted rate of return
- Time-weighted rate of return
- Sharpe Ratio
- Treynor Ratio
- Jensen’s Alpha
- Information Ratio
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.
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:
- 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:
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 np
returns = np.log(stock_prices / stock_prices.shift(1))
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
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 pd
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
- Sum all values.
- Divide it by the total number of observations.
2. Calculate Variance
- Take the difference between each value and the mean
- Square this difference.
- Sum all differences
- 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)
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)
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() * 252
return np.sqrt(reduce(np.dot, [weights, cov, weights.T]))
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:
- First, mark each cash flow as either an inflow or an outflow.
- Net the cash flows and find the value of the discounted rate that equates the present value of inflows and outflows.
- It can be achieved via the IRR function on calculators or excel spreadsheet which stands for the internal 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.
- It involves creating subperiods which are essentially the dates of deposits and withdrawals.
- 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).
- The product of (1 + holding period return) of all holding periods is calculated. This is known as the annual returns.
- Finally, we need to compute the geometric mean of the rate of return. This is known as the time-weighted rate of return.
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:
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:
This measure calculates the difference between the actual return of the market return.
Market return can be computed by CAPM:
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 compute 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:
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.