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
Click here for the documentation
Changelog
- v1.1.1: Added documentation
[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.1
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.1.tar.gz | 11.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arfima-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.3 kB
Release files / arfima-1.1.1.tar.gz
| Download URL | arfima-1.1.1.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8f49e10637507bbbade59627d57e4c4c79279cec97aff511bb9610bb5453624
|
|
BLAKE2b-256 checksum How to use checksums |
e403de70eb8f36b9139f8962d1a2ed07a966da30f78a8337675e8adfcd75c505
|
| 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.1-py3-none-any.whl
| Download URL | arfima-1.1.1-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
779fd1ae76b5030d17bedcf2bf470f91d1c3a48ee8d5f09feed499f4deef7bb8
|
|
BLAKE2b-256 checksum How to use checksums |
692b6c7023e09b6a6299bfbbcd1e2d31a6c07cef1a13c148e8bf5401e8e87a9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|