What are Log Returns?

Log Returns are a sophisticated way to measure percentage changes in stock prices that addresses key limitations of simple percentage calculations. Unlike regular returns, log returns provide a more accurate representation of compound growth over time.

Why use log returns instead of regular percentage changes?

  • Makes math easier when dealing with multiple time periods
  • They help us analyze risk and volatility better
  • They follow a normal distribution (bell curve) more closely
  • Banks and financial analysts use them every day

Example: NVDA stock moving from $400 to $440 has the same log return magnitude as moving from $440 to $400.

The Math Behind Log Returns

The formula for log return is simple:

\[r_t = \ln\left(\frac{P_t}{P_{t-1}}\right) = \ln(P_t) - \ln(P_{t-1})\]

Where:

  • \(r_t\) = log return at time \(t\)
  • \(P_t\) = stock price at time \(t\)
  • \(P_{t-1}\) = stock price at previous time
  • \(\ln\) = natural logarithm

Key Property: Log returns can be added together \[\text{Total Return} = r_1 + r_2 + r_3 + ... + r_n\]

NVDA Stock Example: Creating Our Data

# ----------------------------------------------------------------
# For simplicity, I decided to not import any stock tracking API
# ----------------------------------------------------------------

# NVDA simulation
n_days <- 252
initial_price <- 400

# Generate daily log returns
daily_returns <- rnorm(n_days, mean = 0.002, sd = 0.035)

# Convert to stock prices
stock_prices <- numeric(n_days + 1)
stock_prices[1] <- initial_price

for(i in 2:(n_days + 1)) {
  stock_prices[i] <- stock_prices[i-1] * exp(daily_returns[i-1])
}

# Create data frame
stock_data <- data.frame(day = 1:(n_days + 1),
                        price = stock_prices,
                        returns = c(NA, daily_returns))

NVDA Price Over Time

NVDA Log Returns Distribution

Interactive 3D NVDA Risk Analysis

Key Statistics and Risk Measures

NVDA Performance Summary
Measure Value Explanation
Average Daily Return 0.115% Average daily growth
Volatility (Daily) 3.41% Daily risk measure
Annual Return 28.9% Expected yearly growth
Annual Volatility 54.1% Yearly risk measure
Best Day 9.66% Biggest single-day gain
Worst Day -10.28% Biggest single-day loss

Why This Matters in Real Life

For Investors:

  • Risk Management: Log returns help measure an asset’s risk
  • Portfolio Planning: Compare a stock against others
  • Prediction: Use stock patterns for informed decisions

For Companies:

  • Valuation: Understand how market values an asset
  • Timing: Know when to raise money or make announcements

Mathematical Properties:

\[\text{If daily return} = 1\%, \text{ then after 10 days: } 10 \times 1\% = 10\%\]

Conclusion

What we learned:

  • Log returns are a smart way to measure price changes
  • They follow predictable patterns (normal distribution)
  • We can add them up easily over time
  • They help us measure and understand risk

Real-world applications:

  • Banks use this to price loans and investments
  • Investment advisors use this to build portfolios
  • Companies like NVDA use this to understand stock performance