Systemicbeta

Daily Log Return

systemic:core-dlrIndicators

Inputs

NameTypeDescription
PriceNumber seriesThe series of asset prices used to calculate log returns, one price per bar.

Outputs

NameTypeDescription
DLRNumber seriesThe log return of each bar against the previous bar, expressed as a **percentage**.

Cost

6
credits per run
1,000
bars

0.205 + 0.00569·n credits for n bars, rounded up. The marks are each plan's limit of bars.

The Daily Log Return expresses price moves as continuously compounded returns, a basic tool of quantitative finance. A simple return asks "what percentage did I gain?". A log return asks "at what continuous rate did my investment grow?"

This small difference gives log returns useful mathematical properties. They are the preferred measure for volatility modeling, risk management, and statistical analysis.


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 bar tt (current bar)
  • Pt−1P_{t-1} = Price at bar t−1t-1 (previous bar)
  • ln⁡\ln = Natural logarithm (base e≈2.718e \approx 2.718)

The second form of the equation shows that log returns are simply the difference of log 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%. The formulas and figures below use the raw ratio unless stated; multiply by 100 to match the module's output.


Log Returns vs Simple Returns

To see why log returns matter, compare 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 moves (< 3%), log and simple returns are nearly the same, so you get the extra mathematical properties at almost no cost.


Key Mathematical Properties

1. Time Additivity

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 date range is the sum of the individual log returns. No compounding calculation is 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 → $200 (double)+100%+69.3%
$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 bar 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 bar with a price is empty<br/>(no previous price);<br/>gap bars stay empty"]
    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 on trading days (DLR Output is on the module's ×100 scale):

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

The weekend has no price, so the output is empty there. The following Monday's DLR is computed against Friday's price, the last bar with a price, just 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 data outages — are never filled:

  • On a gap bar the DLR is empty. It is not the previous return and not 0.0.
  • The return is computed between bars that have a price: a weekend or holiday is skipped, as in the Friday-to-Monday example above.
  • The first bar with a price has no earlier price to compare against, so it is empty.
  • An input series with no prices gives an output with no values.

Real-World Applications

Volatility Modeling (GARCH)

GARCH models (Generalized Autoregressive Conditional Heteroskedasticity) are a standard tool for volatility forecasting. These models work 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 of bar 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

Log returns are convenient mathematically, but real market data deviates from the normal distribution in consistent ways:

  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 call for more advanced models that still build on log returns.


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 reservedBeta v0.1.5