Arithmetic and logarithmic returns are two ways of measuring the change in an investment’s value over a period of time.
Arithmetic returns, also known as simple returns, are calculated by taking the difference between the ending value of the investment and the beginning value, and then dividing by the beginning value. The formula is:
$ArithmeticReturn = \dfrac{ClosePrice - OpenPrice}{OpenPrice}$For example, To calculate the arithmetic return for Apple stock, you’ll need the beginning and ending stock prices for a specific period. Let’s say you want to calculate the arithmetic return for Apple stock for the month of January 2023. Here are the hypothetical stock prices:
Now, we can calculate the arithmetic return using the formula mentioned earlier:
$ArithmeticReturn = \dfrac{\$165 - \$150}{\$150}$The arithmetic return for Apple stock in January 2023 is 0.10, or 10%. This means that the stock’s value increased by 10% during that month.
Log returns, also known as continuously compounded returns, are calculated by taking the natural logarithm of the ratio of the ending value to the beginning value. The formula is:
$LogReturn = ln(\dfrac{ClosePrice}{OpenPrice})$Log returns have a few advantages over arithmetic returns. They are additive across time, meaning that the log return of multiple non-overlapping periods can be found by summing the log returns of each period. This property makes log returns particularly useful for analyzing returns over multiple periods or when calculating portfolio returns. Log returns also exhibit better statistical properties, such as being approximately normally distributed in many cases.
For example, to calculate the log return for Apple stock, you’ll need the beginning and ending stock prices for a specific period. Let’s use the same example as before, calculating the log return for Apple stock for the month of January 2023 with these hypothetical stock prices:
Now, we can calculate the log return using the formula mentioned earlier:
$LogReturn = ln(\dfrac{\$165}{\$150})$ $LogReturn = ln(1.10)$ $LogReturn \approx 0.0953$The log return for Apple stock in January 2023 is approximately 0.0953, or 9.53%. This means that the stock’s value increased by about 9.53% during that month, when accounting for the compounding effect.
It’s important to note that while the log return and arithmetic return values are close, they are not identical. The log return is more appropriate for multi-period analysis or when considering compounding effects, while the arithmetic return is easier to understand and suitable for single-period calculations.
The additive property of log returns allows you to calculate the overall return of an investment over multiple non-overlapping periods by simply summing the log returns of each period. Let’s use Apple stock as an example with hypothetical data for three consecutive months:
Date | Price |
---|---|
January 1, 2023 | $150 |
February 1, 2023 | $165 |
March 1, 2023 | $180 |
April 1, 2023 | $190 |
First, we’ll calculate the log returns for each month:
$January 2023 = ln(\dfrac{\$165}{\$150}) \approx 0.0953$ $February 2023 = ln(\dfrac{\$180}{\$165}) \approx 0.0870$ $March 2023 = ln(\dfrac{\$190}{\$180}) \approx 0.0531$Now, we can use the additive property of log returns to calculate the overall return for the three-month period:
$Total Log Return = 0.0953 + 0.0870 + 0.0531 \approx 0.2354$The additive property of log returns simplifies the calculation of returns over multiple periods, making it particularly useful for financial analysis and portfolio management.
The chart below exposes the relationship between arithmetic returns and log returns.
There is no one-to-one relationship between log returns and arithmetic ones; nevertheless you can note that the smaller the return, the more arithmetic and log returns tend to be similar.
In conclusion, understanding the difference between arithmetic and logarithmic returns is essential for any investor who wants to make informed decisions about their portfolio. While arithmetic returns are simple to calculate and provide a clear picture of the average return over a given time period, they can be misleading when it comes to understanding the impact of compounding returns.
On the other hand, logarithmic returns provide a more accurate picture of the actual returns on an investment, by taking into account the impact of compounding. By using logarithmic returns, investors can make better-informed decisions about their investment strategies, and avoid being misled by simple arithmetic calculations.
Ultimately, whether you use arithmetic or logarithmic returns will depend on your investment goals and the specifics of your investment portfolio, but having a clear understanding of the differences between these two methods can help you achieve better long-term investment outcomes.
]]>First, go to Yahoo Finance and search for a stock symbol that is of interest to you. Let’s check how we would do exactly that with Apple stock (AAPL).
We first search for AAPL stock in the search bar:
This article show how to easily obtain publicly available Historical data of a stock. In order to make use of it, check our other blog posts on how to calculate & interpret stock analysis and results.
]]>Go to Yahoo Finance and download any historical data of the stock that you would like to analyze. You can follow the process of how to download the data and load it into Excel sheet in this article: How to download historical stock data from Yahoo Finance?.
Let’s download Apple (AAPL) historical data from Yahoo Finance, and once data is downloaded open it in Excel:
Once we have the data ready and loaded in Excel, we can calculate daily log returns of AAPL stock. We will use the Adjusted Close Price for our analysis, and will calculate log returns using the following formula:
=ln(F3/F2)
Notice that here we’re calculating the log return of date 12/15/1980 by comparing the Adjusted Close Price of the previous trading day which was 12/12/1980.
Now we apply this formula to whole table by double clicking on the edge of Excel cell to copy the formula until the end of the table.
That would calculate the Daily Log returns of AAPL stock for whole history of the stock:
toc: true toc_sticky: true published: true
We now have all log returns ready for AAPL stock, and we would like to do some simple analysis by calculating Average/Mean daily returns & Standard deviation of those daily log returns. We will use the following formula in Excel to calculate Average of returns:
=average(H:H)
Column letter of all daily log returns in our example is H, this formula will calculate the average of all numeric cells in that column, and it will also ignore any non-numeric cell or an empty cell. We can now see that the average daily log return was positive for whole AAPL history and it currently sits at 0.069%. Now that we have our average, we can calculate another important metric - standard deviation of daily log returns by using the following formula in Excel:
=stdev.s(H:H)
This will calculate standard deviation of our sample which is the whole history of AAPL stock data.
This article has shown how to download and calculate daily average log returns and standard deviation for AAPL stock historical data using Excel and Yahoo Finance.
In our next blog post of this series we will continue with explaining how we can interpret this data and what are some guarantees that go along with it. Stay tuned.
]]>This is an important thing to remember. As an individual, in order to learn from history and to assert any kind of informed estimate, your best choice is undoubtedly taking the average of historical data. This does not mean the estimate is useful in all situations.
Imagine being a doctor, and you have statistical knowledge that approximately on average 10% of patients have allergic reaction to penicillin. In decision making, per individual patient, this knowledge is not useful, even though you know that 90% of the time the patient is not going to be allergic, you still need to perform additional checks every time to be sure.
Now imagine being a gambler and having a knowledge on which side roulette wheel is going to stop for an average 90% of the time. This knowledge would make you very rich in a very short period of time.
When building a bridge you should strive to build a firm structure that can withhold some of the most adverse effects of nature. This means that in order to build a resilient bridge structure you should not consider the value of average wind speeds, but the worst possible and then some. Averages can still help to test design resilience. Finding out what is the average wind speed together with it’s standard deviation can still give you some insight and help you test your design.
You can then estimate the worst outcome from available data using average and standard deviation and then ensuring that you’ve covered the cases that go well beyond that point.
Even though Averages cannot be used in individual cases or when designing resilient systems, they still provide some guarantees. In particular, Bienaymé–Chebyshev inequality guarantees that, for a wide class of probability distributions, a minimum of 75% of values are only 2 standard deviations from the mean, conversely 89% of the values are within 3 standard deviations away from the mean.
In 1955, Professor Charles Stein of Stanford University introduced a novel revolutionary concept called “shrinkage”. The concept is unintuitive because it’s stating that somehow measuring the weight of candies, and number of World Cup attendees can improve estimates for basketball players scoring ability - if you use them together.
How is that possible? Obviously, those data points are completely unrelated, still if used together they produce better estimates with less risk than estimated individually.
Let’s use this concept with a basketball players example.
Each basketball player has it’s own average points scored metric. Given that’s the case, we would assume, and rightfully so, that the best estimate for that basketball player is his own average. James-Stein estimator proves that we can get better prediction of individual basketball players by taking a global average of all players in the world and then using a simple formula to calculate individual estimate per player:
$z = {\bar y + c{(y-\bar y)}}.$Using this simple formula where $z$ is the new estimate for each player, $\bar y$ is the grand average of all players, $c$ is the “shrinkage” factor and $y$ is the players average.
There are only a handful phenomena in this universe that remain constant for a longer period of time. Most of the things we see around us change, some need more time, some change a lot faster. We should expect things to change, therefore we should not be surprised when that happens.
Averages change. Fortunately, there are some easy and quick test to compare old conclusions with new data and to confirm what statisticians call goodnes of fit
, which means that new data still matches the old one. The test is called Kolmogorov–Smirnov test
and it’s named after Andrey Kolmogorov and Nikolai Smirnov. Using this test we can answer the following question: “How likely is it that we would see two sets of samples like this if they were drawn from the same (but unknown) probability distribution?”, which would help us to determine if the data has changed over time and if it’s time to move on from old conclusions.
Averages have been a friend of ours for a very long time. It made our lives easier, our calculations more accurate, and gave us a tool to reduce huge amount of complexity to a single number.
In order to use it wisely, we’ve discussed some of the interesting aspects of taking an average from an array of data in this post.
This is a start of the Average
series of blog posts where we will dive deeper into the fascinating world of measurement, and therefore future predictions.
Kritzman and Li (2010) present “a mathematical measure of financial turbulence” based on the Mahalanobis Distance.
Qualitatively: financial turbulence is a condition where
This chart is useful to objectively assess current market turbulence conditions.
]]>It’s simply a change in price expressed as percentage. You often hear S&P 500 is up today by 0.5%. A log return of S&P 500 for today would be 0.5%.
First you’ll need some data, you can get it for free on Yahoo! Finance website. Here in our example we’ll use BTC/USD, you can download it here.
When you download the file, it will be a CSV file which you can open with Excel like any other CSV file. It will look like this:
Now, that you have the data ready, we start calculating log returns. In calculating returns we always skip the first data point, because we need to calculate the difference between current day and previous day.
The formula in Excel for calculating our fist log return in our example is:
=ln(f3/f2)
Pasting that formula will give you similar result like the this screenshot:
Now, we just apply this formula for all the following cells in the H column, and we apply some formatting to get it to look like this:
We now have our log returns ready, but what can we do with them?
Check these tutorials to continue:
]]>Value of a Bitcoin is usually expressed by comparing it to USD, and a value of one BTC is currently at the time of this writing around 33 000$ (06/21/2021). Now, no one can predict the future, BTC might go up or go down - we don’t know that.
What variance is telling us how it feels to ride the BTC chart.
Everyone knows that BTC is a wild ride, but can we express that in a single number? Yes, we can, it’s called price variance.
Simple, first you need price data. You can get one for free from Yahoo here. By clicking on a download button, you’ll get a CSV file that you can open in Excel like this:
When we have the log returns column ready, we can start calculating variance by using the following Excel formula:
=VAR.S(H3:H2466)
Variance on it’s own does not tell us a lot about data, but we can transform it to standard deviation and also compare with other assets to get a clear picture which asset is more volatile. Standard deviation is just a square root of variance, as shown with Excel formula here:
=SQRT(J3)
Now, a standard deviation is a metric on it’s own, it’s often called volatility of an asset. You can learn more about it standard deviation.
Standard deviation of log returns can also be expressed with percentages, like here:
A measured volatility of daily log returns for BTC/USD on a day of writing this tutorial is: 3.96%.
Now, you can calculate standard deviation (volatility) of other assets and compare them to see which is more volatile between them.
]]>Variance is a measure how volatile some data stream is. It tries to give us an answer in a form of a number on the following questions:
- What is the spread between data points?
- By how much those data points on average jump around?
Financial asset price (or any other metric) is just a stream of data. It’s a stream because we get new data point each second/minute. If the price of an asset changes a lot, and jumps up and down a lot - we would consider that to be a volatile (high variance) asset price.
Example of high (blue line) and small variance (red line) in amplitudes shown in this image Image source
Now, that doesn’t mean that all variances are bad. For example, a price can jump, but always jump up - that is a very desirable situation for someone who bought the asset at the right time.
Variance is best explained through examples:
]]>