Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Chapter 2 — Returns and Financial Data

Financial markets generate enormous amounts of time series data.

Every trading day produces new observations on:

But financial analysts rarely work directly with prices alone.

Instead, they usually focus on returns.

This chapter introduces the basic structure of financial data and the logic of financial returns.

We study:

We also begin working directly with real financial data using Python and Yahoo Finance.


Learning Objectives

By the end of this chapter, you should be able to:


2.1 Financial Prices

A financial price represents the market value of an asset at a particular moment in time.

Examples include:

We often denote the price at time tt as:

PtP_t

For example:

DayPrice
Monday100
Tuesday103
Wednesday101

Why Prices Alone Are Not Enough

Suppose:

Both increased by 1 unit.

But the economic significance is very different.

This motivates the concept of returns.


2.2 Simple Returns

For a price series PtP_t, the simple return is:

Rt=PtPt1Pt1=PtPt11R_t = \frac{P_t-P_{t-1}}{P_{t-1}} = \frac{P_t}{P_{t-1}}-1

Simple returns measure proportional price change.

Example

Suppose:

Pt1=100,Pt=105P_{t-1}=100, \quad P_t=105

Then:

Rt=105100100=0.05R_t = \frac{105-100}{100} = 0.05

or:

5%5\%

2.3 Positive and Negative Returns

Returns may be positive or negative.

Price MovementReturn
price risespositive return
price fallsnegative return

Example:

Pt1=100,Pt=95P_{t-1}=100, \quad P_t=95

Then:

Rt=95100100=0.05R_t = \frac{95-100}{100} = -0.05

or:

5%-5\%

2.4 Gross Returns

Sometimes it is useful to work with the gross return:

1+Rt=PtPt11+R_t = \frac{P_t}{P_{t-1}}

Examples:

Simple ReturnGross Return
5%1.05
-3%0.97

Gross returns are especially useful for compounding.


2.5 Compounding Intuition

Suppose an investment earns:

Starting from:

100100

After year 1:

100(1.10)=110100(1.10)=110

After year 2:

110(1.10)=121110(1.10)=121

Overall growth is therefore:

1.10×1.10=1.211.10 \times 1.10 = 1.21

or:

21%21\%

2.6 Why You Cannot Simply Average Returns

Consider the following price series:

YearPrice
2020100
202180
2022100

The price:

The simple returns are:

PeriodReturn
2021-20%
2022+25%

Now notice something interesting:

20%+25%=5%-20\% + 25\% = 5\%

But the investment did not earn 5%.

The final price returned exactly to the starting value.

Total return is therefore:

0%0\%

This is one of the main motivations for log returns.


2.7 Log Returns

Financial analysts often work with log returns instead of simple returns.

The log return is:

rt=log(PtPt1)r_t = \log\left(\frac{P_t}{P_{t-1}}\right)

Equivalently:

rt=log(1+Rt)r_t = \log(1+R_t)

where:

Rt=PtPt1Pt1R_t = \frac{P_t-P_{t-1}}{P_{t-1}}

denotes the simple return.

Example

Suppose:

Pt1=100,Pt=105P_{t-1}=100, \quad P_t=105

Then:

rt=log(105100)0.04879r_t = \log\left(\frac{105}{100}\right) \approx 0.04879

or approximately:

4.88%4.88\%

2.8 Why Log Returns Matter

At first glance, log returns may seem unnecessarily complicated.

Why not simply use percentage returns?

The answer lies in compounding.

Suppose returns over multiple periods are:

R1,R2,,RTR_1,R_2,\dots,R_T

The compounded gross return is:

t=1T(1+Rt)=PTP0\prod_{t=1}^{T}(1+R_t) = \frac{P_T}{P_0}

Taking logs:

log(t=1T(1+Rt))=log(PTP0)\log\left( \prod_{t=1}^{T}(1+R_t) \right) = \log\left( \frac{P_T}{P_0} \right)

Using logarithm rules:

t=1Tlog(1+Rt)=logPTlogP0\sum_{t=1}^{T}\log(1+R_t) = \log P_T - \log P_0

This property is called:

time additivity

and is one of the main reasons log returns are widely used in finance and econometrics.


2.9 Simple Returns vs Log Returns

FeatureSimple ReturnsLog Returns
intuitive
additive through time
commonly used in finance
natural for continuous compounding


2.10 Small-Return Approximation

For small returns:

log(1+Rt)Rt\log(1+R_t) \approx R_t

This approximation is usually very accurate for daily financial returns.

Example

Simple ReturnLog Return
1%0.995%
5%4.88%
10%9.53%

As returns become larger, the difference becomes more important.


2.11 Long Positions and Short Selling

Most investors profit when prices rise.

This is called a long position.

Long Position

Buy first, sell later.

Profit if price rises.

Short Selling

Short selling reverses the logic.

The investor:

  1. borrows an asset,

  2. sells it,

  3. later buys it back.

Profit occurs if the price falls.

Example

Suppose:

Profit:

10090=10100 - 90 = 10

Risk of Short Selling

Losses from a long position are limited because prices cannot fall below zero.

But short-selling losses can theoretically be unlimited if prices rise dramatically.


2.12 Downloading Financial Data with Python

We now download real financial data using Python.

import yfinance as yf
import matplotlib.pyplot as plt

aapl = yf.download("AAPL", start="2020-01-01", auto_adjust=False)

print(aapl.head())

We use auto_adjust=False to get the Adjusted Closing price.

Understanding the Columns

Yahoo Finance typically provides:

VariableMeaning
Openopening price
Highhighest price
Lowlowest price
Closeclosing price
Adj Closeadjusted closing price
Volumetrading volume

2.13 Adjusted Prices

One of the most important concepts in financial data is the adjusted price.

Stock prices may change because of:

Raw prices therefore may not accurately reflect investor returns.

Example: A 2-for-1 Stock Split

Suppose a company’s stock price evolves as follows:

DateClose PriceShares HeldInvestor Wealth
Day 11001000100,000
Day 21021000102,000
Day 31051000105,000

Now suppose the company announces a:

2-for-1 stock split

Each shareholder receives:

After the split:

DateClose PriceShares HeldInvestor Wealth
Day 452.52000105,000

Notice:

52.5×2000=10500052.5 \times 2000 = 105000

Investor wealth is unchanged.

Why Raw Prices Become Misleading

If we looked only at raw prices, we might incorrectly conclude that the stock experienced a:

50%50\%

price crash:

10552.5105 \rightarrow 52.5

But this is economically incorrect.

The investor is neither richer nor poorer after the split.

Adjusted Prices

Adjusted prices correct for stock splits and other corporate actions.

An adjusted price series might therefore look like:

DateClose PriceTrader’s QuantityNet WorthAdjusted CloseDaily Return
Day 1100.01000100,00050.0
Day 2102.01000102,00051.02.0%
Day 3105.01000105,00052.52.9%
Day 452.52000105,00052.50.0%
Day 554.02000108,00054.02.9%

Now the artificial price break disappears.

Why Adjusted Prices Matter

Using raw prices incorrectly can produce misleading returns.

Most empirical financial analysis therefore uses:

Adjusted Close

rather than raw closing prices.


2.14 Calculating Returns in Python

We now calculate both simple and log returns.

import numpy as np
import pandas as pd

price = [100, 80, 100, 115, 125]
year = [2020, 2021, 2022, 2023, 2024]

df = pd.DataFrame({"price": price}, index=year)

df["simple_return"] = df["price"].pct_change()

df["log_return"] = np.log(
    df["price"] / df["price"].shift(1)
)

df
yearpricesimple_returnlog_return
2020100NaNNaN
202180-0.200000-0.223144
20221000.2500000.223144
20231150.1500000.139762
20241250.0869570.083382

2.15 Cumulative Returns

To compute cumulative growth from simple returns, we compound.

cum_gross = (df["simple_return"] + 1).cumprod()

cum_gross
yearcumulative returns
2020NaN
20210.80
20221.00
20231.15
20241.25

Cumulative Log Returns

With log returns, we simply add.

cum_log = df["log_return"].cumsum()

cum_log
yearcumulative log_return
2020NaN
2021-0.2231436
20225.551115e-17
20230.1397619
20240.2231436

Consistency Check

The cumulative log return should equal:

logPTlogP0\log P_T - \log P_0

We verify this directly.

np.log(df["price"].iloc[-1]) - np.log(df["price"].iloc[0])

np.float64(0.2231435513142097)

Returning to Gross Returns

Exponentiating cumulative log returns recovers total growth.

np.exp(cum_log.iloc[-1])

np.float64(1.25)


2.16 Stylized Facts of Financial Returns

Financial returns display several recurring empirical patterns.

These are called stylized facts.

Stylized Fact 1: Returns Are Noisy

Asset returns fluctuate substantially from day to day.

Short-run movements are often difficult to predict.

Stylized Fact 2: Volatility Clustering

Large movements tend to cluster together.

Calm periods are followed by calm periods.

Volatile periods are followed by volatile periods.

This observation motivates ARCH and GARCH models later in the book.

Stylized Fact 3: Fat Tails

Extreme movements occur more often than predicted by the normal distribution.

Examples include:

Stylized Fact 4: Asymmetry

Financial markets sometimes fall faster than they rise.

Negative shocks may generate stronger volatility responses than positive shocks.

2.17 Example: Comparing Prices and Returns

import yfinance as yf
import matplotlib.pyplot as plt

aapl = yf.download("AAPL", start="2020-01-01", auto_adjust=False)

prices = aapl["Adj Close", "AAPL"]

returns = prices.pct_change()

fig, ax = plt.subplots(2,1, figsize=(10,7))

ax[0].plot(prices)
ax[0].set_title("Apple Adjusted Prices")

ax[1].plot(returns)
ax[1].set_title("Apple Daily Returns")

plt.tight_layout()

plt.savefig("figs/ch2/aapl.png", dpi=300, bbox_inches="tight")
plt.close()   # replace with plt.show()
Apple

2.18 Gretl Example: Importing Financial Data

Gretl can import financial datasets directly from CSV or Excel files.

Step 1: Download Data

Download data from Yahoo Finance as CSV.


[GRETL Screenshot Placeholder: Yahoo Finance download page]

Step 2: Import into GRETL

Menu:

File → Open data → Import

Choose the downloaded CSV file.


[GRETL Screenshot Placeholder: GRETL import window]

Step 3: Plot the Series

Select the variable and choose:

Variable → Time series plot


[GRETL Screenshot Placeholder: Financial time series plot]

2.19 Common Mistakes


2.20 Looking Ahead

This chapter introduced the foundations of financial time series data.

In the next chapter, we briefly review key ideas from probability and statistics that will be useful throughout the book.

We will study:

Key Takeaways

Concept Check

Basic

  1. What is the difference between a price and a return?

  2. What is a simple return?

  3. What is a log return?


Intuition

  1. Why are returns often preferred over prices in financial analysis?

  2. What does compounding mean in a financial context?

  3. Why do investors care about percentage changes rather than absolute changes?


Intermediate

  1. How do simple returns and log returns differ in interpretation?

  2. Why are log returns often used in time series modeling?

  3. What is meant by “stylized facts” of financial returns?


Challenge

  1. Suppose a stock price doubles over a year.


Interpretation & Practice

  1. Consider the following:

    Price today = 100
    Price tomorrow = 105

    • What is the simple return?

    • What does this return represent economically?


  1. A stock increases from 100 to 110, then falls back to 100.

    • What are the simple returns in each period?

    • What is the total return over the two periods?

    • What does this illustrate about compounding?


  1. You observe a time series of stock prices that trends upward over time.

    • What happens to returns when you transform prices into returns?

    • Why might this be useful?


  1. A histogram of returns shows:

    • many small values,

    • a few very large positive and negative values.

    • What feature of financial data does this illustrate?

    • Why is this important for modeling?


  1. A time series plot of returns shows periods of calm followed by periods of large fluctuations.

    • What is this phenomenon called?

    • Why is it important for risk measurement?


Challenge

  1. Suppose two assets have the same average return, but one has much higher volatility.

    • Which asset is riskier?

    • Why might an investor still prefer the lower-volatility asset?


Numerical Practice

Basic

  1. Suppose a stock price moves from 100 to 105.

    • Compute the simple return.

    • Express your answer as a percentage.


  1. Suppose a stock price moves from 50 to 55.

    • Compute the simple return.

    • Is this higher or lower than in Question 1?


Intermediate

  1. A stock price evolves as follows:

    DayPrice
    0100
    1110
    2121
    • Compute the simple return from Day 0 → Day 1.

    • Compute the simple return from Day 1 → Day 2.

    • What do you notice?


  1. Using the same data:

    • Compute the cumulative return from Day 0 → Day 2.

    • Verify that it matches compounding.


Log Returns

  1. Suppose a stock price moves from 100 to 110.

    • Compute the log return:

    log(PtPt1)\log\left(\frac{P_t}{P_{t-1}}\right)
    • Is it larger or smaller than the simple return?


  1. A stock moves:

    • 100 → 110 → 100

    • Compute the two simple returns.

    • Compute the total compounded return.

    • What do you observe?


Challenge

  1. Suppose returns are:

    • Day 1: +10%

    • Day 2: −10%

    • Compute the final price (starting from 100).

    • Why is the final value not equal to the initial value?


  1. Suppose daily log returns are:

    • 0.05

    • 0.02

    • −0.01

    • Compute the total log return.

    • What is the advantage of using log returns here?


Appendix 2A — A More Technical Look at Log Returns

This appendix provides a slightly more formal explanation of why log returns are so important in finance and econometrics.


A.1 Continuous Compounding

Suppose wealth evolves according to:

Wt=W0ertW_t = W_0 e^{rt}

where:

Taking logs:

logWt=logW0+rt\log W_t = \log W_0 + rt

Thus:

r=logWtlogW0tr = \frac{\log W_t - \log W_0}{t}

This motivates the use of log returns as continuously compounded growth rates.


A.2 Additivity Through Time

Suppose:

P0P1P2P_0 \rightarrow P_1 \rightarrow P_2

Then:

r1=log(P1P0)r_1 = \log\left(\frac{P_1}{P_0}\right)

and:

r2=log(P2P1)r_2 = \log\left(\frac{P_2}{P_1}\right)

Adding:

r1+r2=log(P1P0)+log(P2P1)r_1+r_2 = \log\left(\frac{P_1}{P_0}\right) + \log\left(\frac{P_2}{P_1}\right)

Using logarithm rules:

r1+r2=log(P2P0)r_1+r_2 = \log\left(\frac{P_2}{P_0}\right)

Thus log returns aggregate exactly across time.


A.3 Connection to Statistical Models

Many financial models assume:

logPt\log P_t

follows a stochastic process.

For example:

logPt=logPt1+μ+wt\log P_t = \log P_{t-1} + \mu + w_t

where:

Taking first differences gives:

logPtlogPt1=μ+wt\log P_t - \log P_{t-1} = \mu + w_t

which is simply:

This shows why log returns naturally appear in many time series and financial models.


Appendix 2B — Adjusted Prices and Total Returns

Raw stock prices can be misleading because firms may:

Adjusted prices attempt to correct for these changes.


Dividends

Suppose:

The investor is not necessarily worse off.

The dividend compensates for part of the price decline.


Stock Splits

Suppose a 2-for-1 stock split occurs.

The stock price may mechanically change:

10050100 \rightarrow 50

while the number of shares doubles.

Economic wealth is unchanged.


Total Return Perspective

Adjusted prices attempt to measure:

capital gains + reinvested dividends

This gives a better measure of investor performance.



Appendix 2C — Returns with Long and Short Positions

In practice, trading strategies often switch between:

Returns therefore depend not only on price movements, but also on the trading position.

Example: Long to Short Position

Suppose a trader initially buys a stock at:

100100

and later sells at:

103103

The return is:

103100100=0.03\frac{103-100}{100} = 0.03

or:

3%3\%

Now suppose the trader opens a short position at:

103103

and later closes the short position at:

9898

The return becomes:

103981030.0485\frac{103-98}{103} \approx 0.0485

or approximately:

4.9%4.9\%

Tracking Positions Through Time

Trading systems often maintain a position variable:

PositionMeaning
+1long
0no position
-1short

Returns therefore depend jointly on:

Why This Matters

Correct return calculation becomes especially important in:

Incorrect handling of short positions can produce misleading performance measures.