DFA Node
Detrended Fluctuation Analysis
Overview
DFA (Detrended Fluctuation Analysis) quantifies long-range correlations and trends in non-stationary time series data. It's especially useful for price data that has trends, unlike traditional autocorrelation that requires stationarity. DFA reveals self-similarity and scaling properties in market data.
A DFA exponent of 0.5 indicates white noise/random walk. Higher values (0.5-1.0) indicate persistent positive correlations (trending). Lower values (0.25-0.5) indicate mean reversion. DFA is more robust to non-stationary data than traditional statistical tests, making it ideal for financial time series.
Formula & Calculation
2. Split into segments
3. Detrend each segment (remove local fit)
4. Calculate fluctuation at each scale
5. DFA(n) ∝ n^α where α is DFA exponent
α = 1.0: Black noise (strong persistence, trending)
α = 1.5+: Highly trending (bubble/crash risk)
α < 0.5: Mean reverting (oscillating)
Parameters
| Parameter | Default | Description |
|---|---|---|
| lookback | 200-500 | Data window for DFA calculation |
| scale_range | 10-lookback/2 | Range of scales to analyze |
Common Use Cases
1. Market Microstructure Analysis
Analyze how market structure changes across timeframes using scaling analysis of volatility.
2. Regime Detection
Monitor DFA changes to detect regime shifts between trending and mean-reverting markets.
3. Long-Range Correlations
Identify hidden long-term correlations that simple autocorrelation misses.
4. Volatility Prediction
Use scaling exponent changes to anticipate volatility regime changes.
Advantages & Limitations
Advantages
- Works with non-stationary data
- Reveals self-similarity patterns
- Detects hidden long-range correlations
- Robust to trends in data
Limitations
- Complex interpretation
- Computationally intensive
- Requires significant data
- Not widely known in trading community