ARFIMA Python
A lightweight, fast Python library for modeling long-memory time series using AutoRegressive Fractionally Integrated Moving Average (ARFIMA) and Fractionally Integrated GARCH (FIGARCH) models.
The Math: ARFIMA
Traditional ARIMA models require integer differencing, which can erase long-term trends. ARFIMA allows for fractional differencing to capture "long-memory" processes. The model solves the general equation:
$$\phi(L)(1-L)^d y_t = \theta(L)w_t$$
Where:
- $L$ is the lag operator.
- $d$ is the fractional integration parameter ($-0.5 < d < 0.5$).
- $\phi$ and $\theta$ are the Autoregressive (AR) and Moving Average (MA) polynomials.
- $w_t$ represents the white noise.
The Math: FIGARCH
Traditional GARCH models assume that volatility shocks decay exponentially. FIGARCH introduces a fractional difference parameter to the variance equation to model hyperbolic decay, capturing long-memory volatility clustering. The conditional variance solves:
$$\sigma_t^2 = \omega^* + \left[ 1 - \frac{\phi(L)}{\beta(L)} (1-L)^{d_v} \right] \epsilon_t^2$$
Where:
- $\sigma_t^2$ is the conditional variance.
- $\omega^*$ is the adjusted baseline variance constant.
- $d_v$ is the fractional volatility parameter ($0 \le d_v \le 1$).
- $\phi(L)$ and $\beta(L)$ are the ARCH and GARCH polynomials.
- $\epsilon_t^2$ represents the squared residuals extracted from the mean equation.
Key Features
- Initialization: Uses the Geweke and Porter-Hudak (GPH) estimator to seed fractional parameters ($d$ and $d_v$) for optimization.
- Fractional Differencing: Computes fractional integration and variance convolutions using Fast Fourier Transform (FFT).
- Model Selection: Evaluates lag structures using bounded optimization and standard information criteria (AIC, BIC, HQIC, AICc).
- Inference: Extracts standard errors, t-statistics, and p-values from the inverse Hessian matrix.
- Forecasting: Calculates in-sample fitted values and out-of-sample predictions for both the mean and variance.
Installation
pip install arfima
Changelog
[1.1.0] - 2026-09-13 :
Added
Added a FIGARCH class to model fractionally integrated GARCH processes.
Added Guweke and Porter Hudak(GPH) estimator to generate a better seed fractional difference parameter for both ARFIMA and FIGARCH.
- v1.0.5: Fix import
- v1.0.4: Fix import
- v1.0.3: Fix import
- v1.0.2: Minor bug fixes and docstring improvements.
- v1.0.1: Fixed inverted AR/MA polynomials in forecast generation.
- v1.0.0: Initial release.
Metadata
Release files for arfima 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arfima-1.1.0.tar.gz | 11.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arfima-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.1 kB
Release files / arfima-1.1.0.tar.gz
| Download URL | arfima-1.1.0.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d784aaa397a47b04cc2dbb0c9dc71eedcca84744bbbc085309062007e0d62f88
|
|
BLAKE2b-256 checksum How to use checksums |
3bc63fbb8b2c20a639806cc2cc77c5ce7e37dec04b0b7331ba6eb2adf84c4383
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / arfima-1.1.0-py3-none-any.whl
| Download URL | arfima-1.1.0-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e5f560c550fc02286969b6a5d1ef0f5c9d5e9307309237414b7d9a2899ce539
|
|
BLAKE2b-256 checksum How to use checksums |
fb10dc1a296fefc844711207b8f6f38abec43dc950fe4e058377b4d29200ea8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|