Workshop 1, Investment Theory

Author

Alberto Dorantes, Ph.D.

Published

April 1, 2024

Abstract
This is an INDIVIDUAL workshop. In this workshop we review a) the concept of financial return, b) measures of dispersion of return variables and c) measures of linear relationship between a pair of return variables.

1 What is financial return?

In Finance we are always interested in learning how much the value of an investment can change in the future. We are usually concern about the possible loss of value of an investment (negative percentage change). The change in percentage value of an investment is called financial return.

In Financial markets we can invest in different instruments. We can invest in stocks, bonds, currency exchanges, indexes such as market indexes, funds such as ETFs, derivatives, crypto-currencies, etc. The concept of financial return can be applied to any of these instruments.

The return of a financial instrument is usually measured as a percentage change of its value from one period to the next period:

Return_{t}=\frac{(Value_{t}-Value_{t-1})}{Value_{t-1}}= \frac{Value_{t}}{Value_{t-1}} -1 Note that we compare the value of the investment value today (t) vs its own value in the previous period (t-1). Then, the base of comparison to calculate the percentage is its previos value at (t-1).

This is called simple return. We will review the concept of continiuously compounded return or logaritmic return later.

It depends on the financial instrument, we might use different measures of value. For example, for a stock we need to take into consideration its closing price and any dividend payment in the period.

We will use the stock instrument to illustrate how we can calculate returns.

A financial simple return for a stock in period t (R_{t}) is usually calculated as the closing stock price in t plus any dividend payment at t, and then divide this sum by the previous closing price. It is calculated as a percentage change from the previous period (t-1) to the present period (t):

R_{t}=\frac{\left(price_{t}-price_{t-1}+ dividend_t\right)}{price_{t-1} }=\frac{price_{t}+dividend_t}{price_{t-1}}-1

When a stock pays dividends or do a stock split, the financial exchange make an adjustment to the historical stock prices. This adjustment to the stock prices is made so that we do not need to use dividends nor splits to calculate simple stock returns. Then, it is always recommended to use adjusted prices to calculate stock returns, unless you have information about all dividends payed in the past.

Then, with adjusted prices the formula for simple returns is easier:

R_{t}=\frac{\left(Adjprice_{t}-Adjprice_{t-1}\right)}{Adjprice_{t-1} }=\frac{Adjprice_{t}}{price_{t-1}}-1

For example, if the adjusted price of a stock at the end of January 2021 was $100.00, and its previous (December 2020) adjusted price was $80.00, then the monthly simple return of the stock in January 2021 will be:

R_{Jan2021}=\frac{Adprice_{Jan2021}}{Adprice_{Dec2020}}-1=\frac{100}{80}-1=0.25

We can use returns in decimal or in percentage (multiplying by 100). We will keep using decimals.

Although the arithmetic mean of simple returns R gives us an idea of average past return, in the case of multi-period average return, this method of calculation can be misleading. Let’s see why this is the case.

Imagine you have only 2 periods and you want to calculate the average return of an investment per period:

Returns over time
Period Investment value (at the end of the period) Simple period Return (R)
0 $100 NA
1 $50 -0.50
2 $75 +0.50

Calculating the average simple return of this investment:

\bar{R}=\frac{-0.5+0.5}{2}=0%

Then, the simple average return gives me 0%, while I end up with $75, losing 25% of my initial investment ($100) over the first 2 periods. If I lost 25% of my initial investment over 2 periods, then the average mean return per period might a midpoint between 0 and 25%. The accurate mean return of an investment over time (multi-periods) is the “Geometric Mean” return.

The total return of the investment in the whole period -also called the holding-period return (HPR)- can be calculated as:

HPR=\left(1+R_{1}\right)\left(1+R_{2}\right)...\left(1+R_{N}\right)-1

Using the example, the HPR for this investment is:

HPR=\left(1-0.50\right)\left(1+0.50\right)-1=0.75 - 1 = -0.25

And the formula for the geometric average of returns will be:

\bar{R_{g}}=\sqrt{\left(1+R_{1}\right)\left(1+R_{2}\right)...\left(1+R_{N}\right)}-1

Caculating the geometric average for this investment:

\bar{R_{g}}=\sqrt{\left(1-0.5\right)\left(1+0.5\right)}-1= -0.13397

Then, the right average return per year is about -13.4% and the HPR for the 2 years is -25%.

However, if we use continuosuly compounded returns (r) instead of simple returns (R), then the arithmetic mean of r is an accurate measure that can be converted to simple returns to get the geometric mean, which is the accurate mean return. Let’s do the same example using continuously compounded returns:

Continuously compounded returns
Period Investment value (at the end) Continuously compounded return (r)
0 $100 NA
1 $50 =log(50)-log(100)=-0.6931
2 $75 =log(75)-log(50)=+0.4054

In Finance it is very recommended to calculate continuously compounded returns (cc returns) and using cc returns instead of simple returns for data analysis and estimation of models such as the CAPM model.

One way to calculate cc returns is by subtracting the natural log of the current adjusted price (at t) minus the natural log of the previous adjusted price (at t-1):

r_{t}=log(Adjprice_{t})-log(Adjprice_{t-1})

This is also called as the difference of the log of the price.

We can also calculate cc returns as the log of the current adjusted price (at t) divided by the previous adjusted price (at t-1):

r_{t}=log\left(\frac{Adjprice_{t}}{Adjprice_{t-1}}\right)

cc returns are usually represented by small r, while simple returns are represented by capital R.

But why we use natural logarithm to calculate cc returns? First we need to remember what is a natural logarithm.

1.1 Reviewing the concept of natural logarithm

What is a natural logarithm?

The natural logarithm of a number is the exponent that the number e (=2.71…) needs to be raised to get another number. For example, let’s name x=natural logarithm of a stock price p. Then:

e^x = p The way to get the value of x that satisfies this equality is actually getting the natural log of p:

x = log_e(p) Then, we have to remember that the natural logarithm is actually an exponent that you need to raise the number e to get a specific number.

The natural log is the logarithm of base e (=2.71…). The number e is an irrational number (it cannot be expressed as a division of 2 natural numbers), and it is also called the Euler constant. Leonard Euler (1707-1783) took the idea of the logarithm from the great mathematician Jacob Bernoulli, and discovered very astonishing features of the e number. Euler is considered the most productive mathematician of all times. Some historians believe that Jacob Bernoulli discovered the number e around 1690 when he was playing with calculations to know how an amount of money grows over time with an interest rate.

How e is related to the grow of financial amounts over time?

Here is a simple example:

If I invest $100.00 with an annual interest rate of 50%, then the end balance of my investment at the end of the first year (at the beginning of year 2) will be:

I_2=100*(1+0.50)^1

If the interest rate is 100%, then I would get:

I_2=100*(1+1)^1=200 Then, the general formula to get the final amount of my investment at the beginning of year 2, for any interest rate R can be:

I_2=I_1*(1+R)^1 The (1+R) is the growth factor of my investment.

In Finance, the investment amount is called principal. If the interests are calculated (compounded) each month instead of each year, then I would end up with a higher amount at the end of the year.

Monthly compounding means that a monthly interest rate is applied to the amount to get the interest of the month, and then the interest of the month is added to the investment (principal). Then, for month 2 the principal will be higher than the initial investment. At the end of month 2 the interest will be calculated using the updated principal amount. Putting in simple math terms, the final balance of an investment at the beginning of year 2 when doing monthly compounding will be:

I_2=I_1*\left(1+\frac{R}{N}\right)^{1*N}

For monthly compounding, N=12, so the monthly interest rate is equal to the annual interest rate R divided by N (R/N). Then, with an annual rate of 100% and monthly compounding (N=12):

I_2=100*\left(1+\frac{1}{12}\right)^{1*12}=100*(2.613..)

In this case, the growth factor is (1+1/12)^{12}, which is equal to 2.613.

Instead of compounding each month, if the compounding is every moment, then we are doing a continuously compounded rate.

If we do a continuously compounding for the previous example, then the growth factor for one year becomes the astonishing Euler constant e:

Let’s do an example for a compounding of each second (1 year has 31,536,000 seconds). The investment at the end of the year 1 (or at the beginning of year 2) will be:

I_2=100*\left(1+\frac{1}{31536000}\right)^{1*31536000}=100*(2.718282..)\cong100*e^1

Now we see that e^1 is the GROWTH FACTOR after 1 year if we do the compounding of the interests every moment!

We can generalize to any other annual interest rate R, so that e^R is the growth factor for an annual nominal rate R when the interests are compounded every moment.

When compounding every instant, we use small r instead of R for the interest rate. Then, the growth factor will be: e^r

Then we can do a relationship between this growth rate and an effective equivalent rate:

\left(1+EffectiveRate\right)=e^{r}

If we apply the natural logarithm to both sides of the equation:

ln\left(1+EffectiveRate\right)=ln\left(e^r\right)

Since the natural logarithm function is the inverse of the exponential function, then:

ln\left(1+EffectiveRate\right)=r In the previous example with a nominal rate of 100%, when doing a continuously compounding, then the effective rate will be:

\left(1+EffectiveRate\right)=e^{r}=2.7182

EffectiveRate=e^{r}-1 Doing the calculation of the effective rate for this example:

EffectiveRate=e^{1}-1 = 2.7182.. - 1 = 1.7182 = 171.82\%

Then, when compounding every moment, starting with a nominal rate of 100% annual interest rate, the actual effective annual rate would be 171.82%!

1.2 Comparing prices vs log of prices

Real historical adjusted monthly stock prices and log prices for the company Nvidia (NVDA) are shown in the following time plot:

[1] "NVDA"

We can see that the stock price changes from about 30 to more than 800! While its log price only moves from around 3.5 to 6.5 since the log price is actually an exponent.

An interesting view of the log plot is that we can quickly estimate percentage growth of price between any pairs of periods by looking at the difference in log price from one period to another one.

For example, in Jan 2021 the log price was about 4.9, while in Jan 2022 the log price was about 5.5. Taking the difference of these log prices (5.5 - 4.9 = 0.6), then this means that the stock prices grew about 60% (in continuously compounded return) from Jan 2021 to Jan 2022.

2 CHALLENGE 1 - Return calculation

Challenge: In Excel:

  1. Calculate Nvidia log monthly adjusted prices, simple monthly returns and continuously compounded returns. Use monthly adjusted prices from Jan 2019 to March 2024 from Yahoo Finance. You can download adjusted monthly prices from Yahoo Finance. You have to end up with one column for each calculation.

  2. Plot adjusted prices and simple returns over time

3 Review of dispersion measures

3.1 Variance of returns

Variance of any variable is actually the arithmetic mean of squared deviations. A squared deviation is the value resulting from subtracting the value of the variable minus its mean, and the square the value.

The mean of returns is estimated as:

\bar{r} =\frac{r_{1}+r_{2}+...+r_{N}}{N}

The variance is estimated as:

VAR(r)=\frac{(r_{1}-\bar{r})^{2}+(r_{2}-\bar{r})^{2}+...+(r_{N}-\bar{r})^{2}}{N}

Variance is a measure of dispersion. The higher the variance, the more dispersed the values from its mean. It is hard to interpret the magnitude of variance. That is the reason why we need to calculate standard deviation, which is basically the squared root of the variance.

3.2 Standard deviation of returns - volatility

Standard deviation of a variable is the squared root of the variance of the variable:

SD(r)=\sqrt{VAR(r)}

Then, the standard deviation of returns can be interpreted as the average distance of all values of the variable from their mean. In other words, standard deviation tells us how much on average the historical returns moves (above or below) from the mean return.

The standard deviation of returns is called volatility. Then, volatility of returns tells us an idea of how much on average (above or below) the period returns move from their mean.

We can calculate volatility of a single stock, or volatility of a portfolio composed of 2 or more stocks.

3.3 Estimating Annual return and volatility using monthly data

3.3.1 Annual average return from monthly average return

It is usually informative to report annual returns and annual volatility when we work with monthly or daily data.

We can report an estimation of annual average return once we calculate monthly average return just by multiplying the monthly average return times 12:

AvgAnnualccReturn = \overline{AvgAnnualccReturn}=12*\overline{AvgMonthlyccReturn} This calculation works better if we use continuously compounded return (ccReturn). If we use cc returns, then we can easily calculate its corresponding simple average return by the formula we review before to calculate simple returns from cc returns:

If we have daily data, then we just replace the 12 by the # of days in the year. In the case of stocks, we usually use 250 business days in a year.

AvgAnnualReturn=e^{AvgAnnualccReturn} - 1

3.3.2 Annual average volatility from average monthly volatility

It is very informative to report annual volatility when we work with monthly or daily data.

Unlike average returns, the conversion of volatility (standard deviation of returns) from monthly to annual, we need to multiply the monthly average return times the squared root of the number of periods in the year:

AnnualVolatility = \overline{AnnualVolatility}=\sqrt{12}*\overline{MonthlyVolatility}

Although we can use simple returns for this calculation, it is recommended to use continuously compounded returns to do this calculation. There are statistical reasons for using compounded returns (cc returns) vs simple returns. But an important reason is that for negative returns, cc returns are more negative than simple returns, and for positive returns, cc returns are less than simple returns. Our human brain usually assign more importance for losses vs gains, so cc returns are more in tandem with the way our brain interprets possible losses vs gains.

4 CHALLENGE 2 - Calculate variance and volatility

Challenge: Using the Excel sheet you used for Nvidia and manually calculate monthly variance of returns and volatility. Use continuously compounded returns to do these calculations.

  1. Add a column for deviations of returns

  2. Add a column for squared deviations of returns

  3. Calculate the population monthly variance as the mean of squared deviations

  4. Calculate monthly volatility as the population monthly standard deviation

  5. Convert the annual historical volatility from monthly volatility

  6. Using Excel formulas, calculate population and sample standard deviations of Nvidia returns. Compare with your manual calculations. Learn about the difference between population and sample standard deviation and briefly explain this in your Excel.

5 Review of Variance and Covariance of returns

5.1 What is covariance of 2 stock returns?

Covariance is a measure of linear relationship between 2 variables.

The covariance of 2 stock returns is calculated as the arithmetic mean of the product return deviations. A deviation is the difference between the stock return in a period t and its mean. Here is the formula:

COV(r_{1},r_{2})=\frac{(r_{(1,1)}-\bar{r_{1}})(r_{(2,1)}-\bar{r_{2}})+(r_{(1,2)}-\bar{r_{1}})(r_{(2,2)}-\bar{r_{2}})+(r_{(1,3)}-\bar{r_{1}})(r_{(2,3)}-\bar{r_{2}})+...}{N}

Were:

r_{(1,1)} is the return of stock 1 in the period 1

r_{(2,1)} is the return of stock 2 in the period 1

Then:

r_{(i,j)} is the return of stock i in the period j

\bar{r_{1}} is the average return of stock 1

\bar{r_{2}} is the average return of stock 2

Then, in the numerator we have a sum of product deviations. Each product deviation is the deviation of the stock 1 return multiplied by the deviation of the stock 2 return.

The covariance is a measure of linear relationship between 2 variables. If covariance between stock return 1 and stock return 2 is positive this means that both stock returns are positively related. In other words, when stock 1 return moves up it is likely that stock 2 return moves up and vice versa; both returns move in the same direction (not always, but mostly).

If covariance is negative that means that stock 1 return is negatively related to stock 2 return; when stock 1 return moves up it is likely that stock 2 return moves down.

Covariance can be a negative or positive number (it is not limited to any number). It is very difficult to interpret the magnitude of covariance. It is much more intuitive if we standardize covariance.

The standardization of the covariance is called correlation.

5.2 What is correlation of 2 stock returns?

Correlation of 2 stock returns is also a measure of linear relationship between both returns. The difference compared to covariance is that the possible values of correlation is between -1 and +1, and the correlation gives us a percentage of linear relationship.

Correlation between 2 returns is the covariance between the 2 returns divided by the product of standard deviation of return 1 and standard deviation of return 2.

We calculate correlation as follows:

CORR(r_{1},r_{2})=\frac{COV(r_{1},r_{2})}{SD(r_{1})SD(r_{2})}

Correlation has the following possible values:

-1<=CORR(r_{1},r_{2})<=+1

6 CHALLENGE 3 - Covariance and Correlation calculations

In the same Excel file, download the stock monthly data (also from Jan 2019 to March 2023) for WalMart, Inc (WMT).

Manually calculate the covariance and correlation of monthly returns between Nvidia and WalMart. Use continuously compounded returns.

  1. Calculate monthly continuously compounded returns
  2. Calculate deviations of returns for WMT
  3. Calculate the product of deviations of NVDA and WMT
  4. Calculate covariance as the mean of the product deviations
  5. Calculate correlation between NVDA and WMT returns by taking the square root of its covariance

7 Quiz 1 and W1 submission

You have to submit your Excel file for Workshop 1 through Canvas.

Also, you have to respond Quiz 1 in Canvas. You will be able to try this quiz up to 3 times. Questions in this Quiz are related to concepts of the readings related to this Workshop. The grade of this Workshop will be the average between Quiz 1 grade and the grade of your Excel.

Remember that you have to submit your Excel file through Canvas BEFORE THE FIRST CLASS OF THE NEXT WEEK.