Systemicalpha

Daily Log Return

systemic:core-dlrIndicatorsfunction1 cr

Inputs

NameTypeDescription
PricefloatarrayThe Price Data input receives the time series of asset prices used to calculate daily log returns.

Outputs

NameTypeDescription
DLRfloatarrayThe DLR output provides the logarithmic return for each period, expressed as a **percentage**, enabling robust quantitative analysis.

The Daily Log Return transforms price movements into the language of continuous compounding—the mathematical foundation of modern quantitative finance. While a simple return asks "what percentage did I gain?", the log return asks "at what continuous rate did my investment grow?"

This seemingly subtle distinction unlocks powerful mathematical properties that make log returns the preferred metric for volatility modeling, risk management, and statistical analysis across institutional finance.


The Formula

rtlog=ln⁡(PtPt−1)=ln⁡(Pt)−ln⁡(Pt−1)r_t^{log} = \ln\left(\frac{P_t}{P_{t-1}}\right) = \ln(P_t) - \ln(P_{t-1})

Where:

  • PtP_t = Price at time tt (current period)
  • Pt−1P_{t-1} = Price at time t−1t-1 (previous period)
  • ln⁡\ln = Natural logarithm (base e≈2.718e \approx 2.718)

The second form of the equation—subtraction of log prices—reveals the elegant simplicity: log returns are simply the difference of log-transformed prices.

This module's output is scaled ×100 (a percent, not the raw ratio): DLR = ln(P_t / P_{t-1}) × 100. A value of 1.98 means the log return is 1.98%. Every formula and figure below states the underlying academic ratio; multiply by 100 to match what this module actually emits.


Log Returns vs Simple Returns

Understanding why log returns matter requires comparing them to simple (arithmetic) returns:

PropertySimple ReturnLog Return
Formulart=Pt−Pt−1Pt−1r_t = \frac{P_t - P_{t-1}}{P_{t-1}}rtlog=ln⁡(PtPt−1)r_t^{log} = \ln\left(\frac{P_t}{P_{t-1}}\right)
Multi-period aggregationMultiply: ∏(1+rt)−1\prod(1 + r_t) - 1Add: ∑rtlog\sum r_t^{log}
Support (range)[−1,+∞)[-1, +\infty)(−∞,+∞)(-\infty, +\infty)
SymmetryAsymmetricSymmetric
Portfolio aggregation✅ Directly additive❌ Not additive

The Taylor Approximation

For small returns (typically daily movements), log and simple returns are nearly identical. This relationship emerges from the Taylor series expansion:

ln⁡(1+r)≈r−r22+r33−…≈rwhen ∣r∣≪1\ln(1 + r) \approx r - \frac{r^2}{2} + \frac{r^3}{3} - \ldots \approx r \quad \text{when } |r| \ll 1

For a 1% simple return (r=0.01r = 0.01):

  • Log return: ln⁡(1.01)=0.00995\ln(1.01) = 0.00995 (0.995%)
  • Difference: only 0.005%

For a 10% simple return (r=0.10r = 0.10):

  • Log return: ln⁡(1.10)=0.0953\ln(1.10) = 0.0953 (9.53%)
  • Difference: 0.47%

Implication: For typical daily price movements (< 3%), log and simple returns are nearly interchangeable, making their distinct mathematical properties a "free" benefit.


Key Mathematical Properties

1. Time Additivity (The Crown Jewel)

The most valuable property of log returns is their additive nature across time:

r0→Tlog=∑t=1Trtlog=ln⁡(PT)−ln⁡(P0)r_{0 \to T}^{log} = \sum_{t=1}^{T} r_t^{log} = \ln(P_T) - \ln(P_0)

This means the cumulative log return over any period is simply the sum of individual log returns—no compounding calculation needed.

flowchart LR
    subgraph "Simple Returns (Multiply)"
        P0s["$100"] -->|"×1.05"| P1s["$105"]
        P1s -->|"×0.97"| P2s["$101.85"]
        P2s -->|"×1.02"| P3s["$103.89"]
    end
    
    subgraph "Log Returns (Add)"
        P0l["ln(100)"] -->|"+0.0488"| P1l["ln(105)"]
        P1l -->|"−0.0305"| P2l["ln(101.85)"]
        P2l -->|"+0.0198"| P3l["ln(103.89)"]
    end
    
    Result["Total: 0.0488 − 0.0305 + 0.0198 = 0.0381<br/>= ln(103.89/100) ✓"]
    P3l --> Result

2. Symmetry

Log returns treat gains and losses symmetrically, unlike simple returns:

ScenarioSimple ReturnLog Return
100→100 → 200 (double)+100%+69.3%
100→100 → 50 (halve)−50%−69.3%

With simple returns, doubling your money (+100%) is not offset by losing half (−50%). With log returns, these are perfect opposites (±69.3%), making statistical analysis more tractable.

3. Approximate Normality

Financial theory often assumes log returns follow a normal distribution (Gaussian). While empirical returns exhibit "fat tails" (more extreme events than predicted), the log-normal model for prices—which implies normally distributed log returns—remains a cornerstone assumption in:


Calculation Logic

flowchart TD
    subgraph Inputs["📥 Input Data"]
        P["Price Series<br/>(P₁, P₂, P₃, ..., Pₙ)"]
    end
    
    subgraph Calc["🔢 Calculation Process"]
        R["For each period t:"]
        R --> D["Compute ratio: P_t / P_{t-1}"]
        D --> L["Apply natural log: ln(ratio)"]
        L --> S["Store as r_t^log"]
    end
    
    subgraph Output["📤 Output"]
        O["Log Return Series<br/>(r₂, r₃, r₄, ..., rₙ)"]
        N["Note: First observed bar is null<br/>(no previous observed price);<br/>gap slots stay null, never fabricated"]
    end
    
    P --> R
    S --> O
    O --> N
    
    style Inputs fill:#e8f5e9
    style Calc fill:#fff3e0
    style Output fill:#e3f2fd

Worked Example: A Week Bridging the Weekend

Consider an asset with the following closing prices, observed only on trading days (this module's actual output, ×100 scale):

DayPrice ($)Price RatioDLR OutputCumulative DLR
Mon100.00—null0.000000
Tue103.501.0350+3.440143+3.440143
Wed101.200.9778−2.247286+1.192857
Thu105.801.0454+4.445176+5.638033
Fri104.200.9849−1.523839+4.114194
Sat/Sunclosed—(no bar)—
Mon106.901.0259+2.558169+6.672363

The weekend produces no output slots of its own (the market is closed — there is no bar to emit); the following Monday's DLR is computed against Friday's price, the last observed bar, bridging the two adjacent trading days exactly as a trader reads "since we last traded."

Verification of time additivity:

  • Cumulative DLR through Friday: 3.440143−2.247286+4.445176−1.523839=4.1141943.440143 - 2.247286 + 4.445176 - 1.523839 = 4.114194
  • Direct calculation: ln⁡(104.20/100.00)×100=4.114194\ln(104.20 / 100.00) \times 100 = 4.114194 ✓

Interpreting the result: A cumulative DLR of 4.114194 represents a 4.114194% continuously compounded growth rate. To convert back to simple return, divide by 100 and exponentiate: e0.04114194−1=4.20%e^{0.04114194} - 1 = 4.20\%.


Missing Data

Gaps — closed-market bars or genuine data outages — are never fabricated into a value:

  • A gap slot's DLR is null, never a stale carried-forward return or a 0.0 placeholder.
  • The log-diff is computed across observed bars: a weekend or holiday bridges the same way the worked example above bridges Friday to Monday.
  • The first observed bar in the series has no prior observed price and is null.
  • An all-null input series yields an all-null output — the module never raises for missing data.

Real-World Applications

Volatility Modeling (GARCH)

GARCH models (Generalized Autoregressive Conditional Heteroskedasticity) are the industry standard for volatility forecasting. These models universally operate on log returns because:

  1. Time additivity simplifies the variance calculations
  2. Approximate normality validates the model's distributional assumptions
  3. Symmetry allows cleaner mathematical formulations

The standard GARCH(1,1) model is specified as:

σt2=ω+α⋅rt−12+β⋅σt−12\sigma_t^2 = \omega + \alpha \cdot r_{t-1}^2 + \beta \cdot \sigma_{t-1}^2

Where rt−1r_{t-1} is the log return from period t−1t-1.

Risk Management: Value at Risk (VaR)

VaR calculations estimate potential losses at a given confidence level. Using log returns:

VaR95%=−μr⋅Δt+σr⋅Δt⋅z0.95\text{VaR}_{95\%} = -\mu_r \cdot \Delta t + \sigma_r \cdot \sqrt{\Delta t} \cdot z_{0.95}

Where μr\mu_r and σr\sigma_r are the mean and standard deviation of log returns.

Portfolio Analytics

When analyzing portfolio performance over time:

  • Use log returns for time-series aggregation (e.g., computing weekly from daily returns)
  • Use simple returns for cross-sectional aggregation (e.g., weighted average across assets)

When to Use Log Returns: A Decision Framework

flowchart TD
    Q1{"What type of<br/>analysis?"}
    
    Q1 -->|"Time-series aggregation"| LOG1["✅ Use Log Returns<br/>Sum to get multi-period returns"]
    Q1 -->|"Portfolio weighting"| SIMPLE1["✅ Use Simple Returns<br/>Weight by portfolio allocation"]
    Q1 -->|"Volatility modeling"| LOG2["✅ Use Log Returns<br/>Required for GARCH, VaR"]
    Q1 -->|"Statistical testing"| LOG3["✅ Use Log Returns<br/>Better normality assumption"]
    Q1 -->|"Client reporting"| SIMPLE2["✅ Use Simple Returns<br/>More intuitive interpretation"]
    
    style LOG1 fill:#c8e6c9
    style LOG2 fill:#c8e6c9
    style LOG3 fill:#c8e6c9
    style SIMPLE1 fill:#bbdefb
    style SIMPLE2 fill:#bbdefb

Empirical Reality: Fat Tails and Volatility Clustering

While log returns provide mathematical elegance, empirical market data reveals systematic deviations from the normal distribution assumption:

  1. Fat tails (excess kurtosis): Extreme returns occur 3-10× more frequently than a normal distribution predicts
  2. Volatility clustering: Large returns tend to follow large returns (captured by GARCH models)
  3. Negative skewness: Large negative returns are more common than large positive returns (in equity markets)

These "stylized facts" (documented by Cont, 2001) don't invalidate log returns—they simply require more sophisticated models that build upon the log return foundation.


Key Takeaways

ConceptSummary
Formulartlog=ln⁡(Pt/Pt−1)r_t^{log} = \ln(P_t / P_{t-1})
Best forTime aggregation, volatility modeling, statistical analysis
Not forPortfolio weighting, intuitive client reporting
Key propertyTime additivity: sum log returns for multi-period analysis
Approximationln⁡(1+r)≈r\ln(1+r) \approx r for small rr (daily returns)

Further Reading

Rendering diagrams...
© 2026 WanoLabs. All rights reservedAlpha build v0.1.5