ARFIMAResult#

class cultivars.univariate.fractional_integration.ARFIMAResult(*, endog, fittedvalues, resid, llf, nobs, n_params, order, truncation, d, mean, ar_params, ma_params, sigma2)[source]#

A fitted fractionally integrated ARMA.

The model

\[\phi(L)\,(1 - L)^d\,(y_t - \mu) = \theta(L)\,\varepsilon_t, \qquad \varepsilon_t \sim N(0, \sigma^2),\]

with the fractional operator expanded as

\[(1 - L)^d = \sum_{k=0}^{\infty} \pi_k L^k, \qquad \pi_k = \frac{\Gamma(k - d)}{\Gamma(-d)\,\Gamma(k + 1)},\]

cut at truncation terms. The autocorrelations decay as \(k^{2d-1}\) rather than geometrically, so d is the memory parameter: zero is a short-memory ARMA, \(0 < d < 0.5\) a stationary long-memory process, \(d \ge 0.5\) non-stationary, and \(d = 1\) a unit root. The record carries the estimate of d with the short-memory block and the innovation variance; the fitted values and residuals are on the fractionally differenced scale, where the model is an ARMA, not on the levels.

Variables:
  • endog – The full observed series.

  • fittedvalues – One-step fitted values on the fractionally differenced series.

  • resid – One-step residuals on the fractionally differenced series.

  • llf – Maximized joint log-likelihood.

  • nobs – Observations the likelihood was evaluated on.

  • n_params – Free parameter count, including d and the variance.

  • order – Short-memory (p, q).

  • truncation – Length of the fractional-difference filter.

  • d – Estimated fractional integration order.

  • mean – Estimated mean, or None when trend == "n".

  • ar_params – Short-memory AR coefficients.

  • ma_params – Short-memory MA coefficients.

  • sigma2 – Innovation variance.

Note

The estimator confines d to \((-0.499, 0.499)\) through a scaled tanh, so every fit satisfies |d| < 0.5 and the stationarity verdict reduces to the autoregressive block; a series with a unit root comes back with d pinned at the boundary and is_stationary still True. Read d near \(\pm 0.499\) as the data asking for integer differencing first, and is_mean_reverting as a condition the estimator cannot violate. ar_params and ma_params are searched through the partial autocorrelations, so the stability and invertibility verdicts verify the transform. Standard errors are not yet reported by this estimator.

See also

  • ARFIMA – the specification that produces this.

  • ARMAResult – the d = 0 case with the exact likelihood.

  • FIGARCHResult – long memory in the variance rather than the level.

  • unit_roots – whether integer differencing is wanted before a fractional fit.

References

Granger, C. W. J., & Joyeux, R. (1980). An introduction to long-memory time series models and fractional differencing. Journal of Time Series Analysis, 1(1), 15-29.

Hosking, J. R. M. (1981). Fractional differencing. Biometrika, 68(1), 165-176.

Sowell, F. (1992). Maximum likelihood estimation of stationary univariate fractionally integrated time series models. Journal of Econometrics, 53(1-3), 165-188.

Example

An ARFIMA(0, d, 0) with \(d = 0.3\), simulated by filtering white noise with the weights of \((1 - L)^{-0.3}\):

>>> import numpy as np
>>> from cultivars.engine._core._transforms import _fractional_difference_weights
>>> rng = np.random.default_rng(0)
>>> n = 600
>>> w = _fractional_difference_weights(-0.3, n)
>>> y = np.convolve(rng.standard_normal(n + 300), w)[300 : 300 + n]
>>> res = ARFIMA(y, order=(0, 0)).fit()
>>> list(res.params), res.nobs, res.n_params
(['mean', 'd', 'sigma2'], 600, 3)
>>> bool(abs(res.d - 0.3) < 0.1), res.is_stationary, res.has_long_memory
(True, True, True)
>>> res.fittedvalues.shape == res.endog.shape
True

Attributes#

endog

(n,) observed series, as given.

fittedvalues

(nobs,) one-step fitted values of the fractionally differenced series.

resid

(nobs,) one-step residuals of the fractionally differenced series.

llf

Maximized joint Gaussian log-likelihood.

nobs

Observations the likelihood was evaluated on.

n_params

the mean if estimated, d, p + q, and sigma2.

order

Short-memory (p, q).

truncation

Number of fractional-difference weights applied.

d

Fractional integration order, inside \((-0.499, 0.499)\).

mean

Estimated level \(\mu\), or None under trend="n".

ar_params

(p,) short-memory AR coefficients.

ma_params

(q,) short-memory MA coefficients, plus-sign convention.

sigma2

Innovation variance.

has_long_memory

Whether d is far enough from zero to imply hyperbolic decay.

information_criteria

AIC, BIC, and HQIC derived from the likelihood and parameter count.

invertibility

Full eigenvalue verdict for the moving-average polynomial.

is_invertible

Whether every companion eigenvalue of the MA block is inside the unit circle.

is_mean_reverting

Whether shocks die out, which holds on the wider range d < 1.

is_stationary

Whether the process is covariance stationary.

params

Estimated parameters keyed by display name, in table order.

stability

Full eigenvalue verdict for the autoregressive polynomial.

Methods#

compare(*others[, criterion])

Rank this result against others by an information criterion.

likelihood_ratio_test(unrestricted)

Test this result as the restricted model against a nesting one.

summary()

The estimation summary, renderable as text, HTML, or a dataframe.

to_dict()

The aligned per-observation outputs as plain numpy arrays.

to_pandas(*[, index])

The aligned per-observation outputs as a pandas.DataFrame.

to_polars()

The aligned per-observation outputs as a polars.DataFrame.