Rolling Beta
Quick Reference
| Property | Value |
|---|---|
| Dimension | signal |
| Category | statistics |
| Version | v1.0 |
| Output Column | rolling_beta |
Rolling linear regression beta of series_a on series_b over a time window
Formula
rolling_corr(series_a, series_b, window_seconds) * (rolling_std(series_a, window_seconds) / (rolling_std(series_b, window_seconds) + 1e-10))
CDM Inputs
| Column | CDM Table | Description |
|---|---|---|
series_a | cdm_trade_enriched | Trade data enriched with bar context — price, volume, side, trade type |
series_b | cdm_trade_enriched | Trade data enriched with bar context — price, volume, side, trade type |
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
window_seconds | integer [60, 86400] | 1800 | Rolling window in seconds |
Output
Column: rolling_beta
Rolling beta coefficient
Market Intuition & Trading Rationale
Rolling beta computes the time-varying regression coefficient of series_a on series_b over a lookback window: corr(a, b) * (std(a) / std(b)). This is the classic ordinary least squares (OLS) beta — the change in series_a expected for a unit change in series_b. A rolling beta of 1.5 means that when series_b moves by 1%, series_a is expected to move by 1.5% in the same direction, over the specified window.
The rolling (rather than static) nature is critical for financial applications. Asset relationships are not stationary — betas shift with market regimes, volatility cycles, and fundamental changes. A 30-minute rolling window captures the current intraday relationship between an ETF and its underlying index, adapting instantly to changing market conditions. The window_seconds parameter governs the trade-off between responsiveness and stability: shorter windows react faster but are noisier; longer windows are smoother but lag structural breaks.
Rolling beta is the foundation of pairs trading, hedging, and lead-lag analysis. In pairs trading, the beta defines the hedge ratio that makes the pair stationary. In hedging, beta determines how many units of the hedge instrument are needed to offset exposure to the primary instrument. In lead-lag analysis, the rolling beta of a follower on a leader measures the current strength of the co-movement — a sudden beta shift may indicate a regime change in the relationship.
The decomposition of beta into correlation and volatility ratio is informative in itself. A high beta can arise from high correlation (strong linkage), high relative volatility (series_a is more volatile than series_b), or both. Monitoring the components separately helps diagnose the source of changing relationships — a beta increase driven by higher correlation is fundamentally different from one driven by a volatility spike in series_a.
Usage Cases
- Dynamic hedge ratio: Compute rolling_beta between a portfolio and its hedge instrument. Adjust the hedge position continuously as beta changes to maintain a market-neutral stance.
- Pairs trading entry: When the spread between series_a and beta_scaled_series_b deviates significantly from its historical mean (z-score > 2), enter a pairs trade betting on convergence.
- Cross-asset lead-lag: Compute rolling_beta of a follower asset on a leader asset. When beta suddenly changes, investigate for structural shifts in the relationship or arbitrage opportunities.
- Risk decomposition: Decompose portfolio risk into systematic (beta-scaled market exposure) and idiosyncratic (residual) components using rolling_beta against a benchmark.
YAML Definition
name: rolling_beta
description: Rolling linear regression beta of series_a on series_b over a time window
category: statistics
version: v0.9.0 (Beta)
dimension: signal
required_inputs:
- series_a
- series_b
output_column: rolling_beta
output_description: Rolling beta coefficient
tags:
- beta
- statistics
- signal
- cross_asset
parameters:
window_seconds:
type: integer
description: Rolling window in seconds
required: false
default: 1800
constraints:
min: 60
max: 86400
formula: rolling_corr(series_a, series_b, window_seconds) * (rolling_std(series_a,
window_seconds) / (rolling_std(series_b, window_seconds) + 1e-10))