OpenQuant Docs banner
OpenQuant icon openquant-rs / documentation terminal

fracdiff

Market Microstructure, Dependence and Regime Detection

Fractional differentiation to improve stationarity while retaining memory.

Why This Module Exists

Balances stationarity and predictive memory better than integer differencing.

Key Public APIs

  • get_weights
  • get_weights_ffd
  • frac_diff
  • frac_diff_ffd

Core Math

FFD Weights

\[w_k = -w_{k-1}\frac{d-k+1}{k}\]

Fractional Difference

\[y_t=\sum_{k=0}^{\infty}w_k x_{t-k}\]

Code Examples

Compute fixed-width fracdiff

use openquant::fracdiff::frac_diff_ffd;

let series = vec![100.0, 100.2, 100.1, 100.4, 100.6];
let out = frac_diff_ffd(&series, 0.4, 1e-4);

Implementation Notes

  • Tune d using stationarity tests and information retention.
  • Threshold governs truncation error vs compute cost.