gph#

cultivars.diagnostics.long_memory.gph(endog, *, f_bandwidth=None, exponent=_GPH_EXPONENT)[source]#

Geweke-Porter-Hudak log-periodogram estimate of \(d\).

Near the origin the spectrum of a long-memory process behaves as \(f(\lambda) \sim c\,\lambda^{-2d}\), so the log periodogram at the first \(m\) Fourier frequencies \(\lambda_j = 2\pi j / T\) is a regression,

\[\log I(\lambda_j) = a - d \log\bigl(4 \sin^2(\lambda_j / 2)\bigr) + e_j, \qquad j = 1, \ldots, m,\]

and \(\hat d\) is the least-squares slope, with standard error \(\pi / \sqrt{24 m}\) from the known variance of the log-periodogram errors. The default bandwidth \(m = \lfloor T^{1/2} \rfloor\) is the paper’s; it trades bias from the short-run spectrum, which grows with \(m\), against variance, which shrinks with it, and the standard error is about 0.14 at \(T = 1000\), so the test has little power against \(d\) near zero at that length. The estimator is the oldest of the three and the least efficient at a given bandwidth; its justification is its simplicity, and the regression residuals are there to be looked at. Valid for \(d < 1/2\); on a series that may be integrated, difference first or use exact_local_whittle().

Parameters:
  • endog (ArrayLike) – The series, (T,), at least 64 observations.

  • f_bandwidth (int | None) – Fourier frequencies used, at least 2 and at most T // 2; None applies the rule.

  • exponent (float) – Exponent of the rule m = floor(T ** exponent), in (0, 1); 0.5 by default.

Return type:

LongMemoryEstimate

Returns:

The LongMemoryEstimate, with method="gph" and the test against \(d = 0\).

Raises:
  • SpecificationError – If the series is shorter than 64, the bandwidth is below 2 or above the available frequencies, or the exponent is outside (0, 1).

  • NumericalError – If a value is not finite or a periodogram ordinate is zero, which a constant series produces.

Note

A bandwidth of a handful of frequencies is accepted and gives a standard error above one; the estimate is then noise, and the record’s se says so rather than the call refusing.

See also

  • local_whittle() – the same bandwidth idea with a Gaussian objective, and a standard error smaller by a factor of \(\pi / \sqrt{6}\).

  • exact_local_whittle() – when \(d\) may be at or above one half.

References

Geweke, J., & Porter-Hudak, S. (1983). The estimation and application of long memory time series models. Journal of Time Series Analysis, 4(4), 221-238.

Robinson, P. M. (1995). Log-periodogram regression of time series with long range dependence. Annals of Statistics, 23(3), 1048-1072.

Hurvich, C. M., Deo, R., & Brodsky, J. (1998). The mean squared error of Geweke and Porter-Hudak’s estimator of the memory parameter of a long-memory time series. Journal of Time Series Analysis, 19(1), 19-46.

Example

White noise is \(d = 0\), and the estimate is within three standard errors of it at the default bandwidth:

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> est = gph(rng.standard_normal(1000))
>>> bool(abs(est.d) < 3 * est.se), est.bandwidth
(True, 31)

A wider bandwidth tightens the standard error at the price of short-run bias:

>>> gph(rng.standard_normal(1000), f_bandwidth=100).se < est.se
True