local_whittle#
- cultivars.diagnostics.long_memory.local_whittle(endog, *, f_bandwidth=None, exponent=_WHITTLE_EXPONENT)[source]#
Robinson’s (1995) local Whittle estimate of \(d\).
The Gaussian semiparametric estimator minimizes the concentrated local Whittle objective over the first \(m\) Fourier frequencies,
\[R(d) = \log\Bigl(\frac{1}{m} \sum_{j = 1}^{m} \lambda_j^{2d} I(\lambda_j)\Bigr) - \frac{2d}{m} \sum_{j = 1}^{m} \log \lambda_j,\]which is the Whittle likelihood of the local model \(f(\lambda) = c\,\lambda^{-2d}\) with \(c\) concentrated out. Its limit is \(\sqrt{m}(\hat d - d) \to \mathcal{N}(0, 1/4)\) for \(-1/2 < d < 3/4\), more efficient than GPH at the same bandwidth by a factor of \(\pi^2 / 6\) in variance; it stays consistent up to \(d < 1\) but loses its limit law beyond \(3/4\), and the record says so when the estimate lands there. The search runs over \((-1/2, 1)\), so a unit-root series is reported at the upper boundary with a pointer to
exact_local_whittle(). The default bandwidth \(m = \lfloor T^{0.65} \rfloor\) is wider than GPH’s because the efficiency gain makes the variance side of the trade cheaper.- Parameters:
- Return type:
- Returns:
The
LongMemoryEstimate, withmethod="local_whittle", standard error \(1 / (2\sqrt{m})\), 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.
Note
An estimate at
1.0to display precision is the search bound, not a finding: the objective is still decreasing there and the series is at least a unit root. Switch toexact_local_whittle(), whose search extends to two, for the value.See also
exact_local_whittle()– the same objective on the fractionally differenced series, valid for any \(d\).gph()– the log-periodogram regression, less efficient and simpler.
References
Robinson, P. M. (1995). Gaussian semiparametric estimation of long range dependence. Annals of Statistics, 23(5), 1630-1661.
Künsch, H. R. (1987). Statistical aspects of self-similar processes. In Proceedings of the First World Congress of the Bernoulli Society (Vol. 1, pp. 67-74). VNU Science Press.
Phillips, P. C. B., & Shimotsu, K. (2004). Local Whittle estimation in nonstationary and unit root cases. Annals of Statistics, 32(2), 656-692.
Example
White noise is \(d = 0\); the default bandwidth is wider than GPH’s and the standard error correspondingly smaller:
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> est = local_whittle(rng.standard_normal(1000)) >>> bool(abs(est.d) < 3 * est.se), est.bandwidth, round(float(est.se), 3) (True, 89, 0.053)
A random walk lands on the search bound:
>>> round(local_whittle(np.cumsum(rng.standard_normal(500))).d, 3) 1.0