Skip to main content

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.


Metadata

Release files for fracjax 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fracjax 0.1.1
File Size Uploaded
fracjax-0.1.1.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fracjax 0.1.1
File Interpreter ABI Platform
fracjax-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 33.5 kB

Release files / fracjax-0.1.1.tar.gz

Download URL fracjax-0.1.1.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f19cfa0bcf4cd0e8128ccfe0ba282505f7b1ea4ebe38e2332f96e155c396e9b4
BLAKE2b-256 checksum
How to use checksums
48a69aca5cc1941f4a0bcc4c9c2057beb9f2d93f6915956b92d8fabf7bea9456
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / fracjax-0.1.1-py3-none-any.whl

Download URL fracjax-0.1.1-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de9578f43a1faa6c6334917364511341faa2f57718153d2c168572a6e64e17a9
BLAKE2b-256 checksum
How to use checksums
20516ba06038242c679901f3949f1f305f278d84f7b7c453ec80c3dccffd4f30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page