Skip to main content

High-Performance Fractal & Econophysics Tools for Financial Time Series using JAX (GPU-Accelerated)

Project description

FracJax 🚀

High-Performance Fractal & Econophysics Tools for Financial Time Series using JAX.

License: MIT Python JAX

FracJax is a production-grade Python library designed for quantitative finance and econophysics. It leverages Google JAX to perform heavy fractal and multifractal analysis on financial time series with GPU acceleration, achieving speeds up to 300x faster than standard CPU-based libraries (like nolds or hurst).

Key Feature: FracJax combines modern statistical robustness (Theil-Sen Estimator) with fractal theory (DFA, Wavelet Leaders) to extract noise-free, lag-free market regime signals.


⚡ Why FracJax?

Feature Standard Libs (nolds/hurst) FracJax
Backend CPU (NumPy) GPU/TPU (JAX)
Speed (1M points) ~5-10 Minutes ~1 Second
Regression Least Squares (Sensitive to noise) Theil-Sen (Robust to outliers)
Microscope Monofractal only Multifractal (Wavelet Leaders)
Stability Fails on short windows (<100) Stable on short windows

📦 Features

FracJax calculates 10+ advanced market features across multiple dimensions:

1. Fractal & Memory (The "Market Microscope")

  • DFA (Detrended Fluctuation Analysis): Robust long-term memory estimation (Trend vs. Mean Reversion).
  • Wavelet Leaders: Multifractal singularity spectrum analysis (Detects structural shocks).
  • Higuchi Fractal Dimension: Measures market roughness and complexity.

2. Microstructure & Liquidity

  • Rolling CVD Proxy: Estimates aggressive buy/sell pressure from OHLCV.
  • Amihud Illiquidity: Measures price impact per unit of volume.

3. Volatility & Risk

  • GARCH(1,1) Forecast: Forward-looking volatility prediction.
  • Realized Semivariance (RSV): Downside-specific volatility measure.
  • Hill Estimator: Tail risk and fat-tail index estimation.

4. Information Theory & Inter-market

  • Permutation Entropy: Measures time-series chaos and unpredictability.
  • Cointegration Z-Score: Robust spread analysis between asset pairs.
  • Lead-Lag Mutual Information: Measures non-linear information flow between assets (using Gaussian KDE).

🚀 Quick Start

FracJax provides a high-level API create_market_microscope that JIT-compiles kernels for maximum speed.

import numpy as np
from fracjax import create_market_microscope

# Generate dummy price data (Random Walk)
prices = np.cumsum(np.random.randn(10000)) + 1000

# 1. Initialize Kernels (Compiles once)
# Method options: 'dfa', 'wavelet', 'higuchi', 'garch', 'cvd', etc.
calc_dfa = create_market_microscope(
    method='dfa', 
    window_size=100, 
    batch_size=4096
)

calc_wavelet = create_market_microscope(
    method='wavelet', 
    window_size=100,
    max_level=4
)

# 2. Run on Data (Ultra Fast)
hurst_dfa = calc_dfa(prices)
hurst_wavelet = calc_wavelet(prices)

print(f"DFA Signal (Last): {hurst_dfa[-1]:.4f}")

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fracjax-0.1.1.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fracjax-0.1.1-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file fracjax-0.1.1.tar.gz.

File metadata

  • Download URL: fracjax-0.1.1.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for fracjax-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f19cfa0bcf4cd0e8128ccfe0ba282505f7b1ea4ebe38e2332f96e155c396e9b4
MD5 5f650ee9369f946b0ecc61b90b1c28ec
BLAKE2b-256 48a69aca5cc1941f4a0bcc4c9c2057beb9f2d93f6915956b92d8fabf7bea9456

See more details on using hashes here.

File details

Details for the file fracjax-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fracjax-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for fracjax-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de9578f43a1faa6c6334917364511341faa2f57718153d2c168572a6e64e17a9
MD5 e63d79fc57f22c345df60d79b2dc2b94
BLAKE2b-256 20516ba06038242c679901f3949f1f305f278d84f7b7c453ec80c3dccffd4f30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page